Commit Graph

12219 Commits

Author SHA1 Message Date
Brian Vaughn 4c4f5fd27f Disable @babel/plugin-transform-block-scoping "throwIfClosureRequired" option for tests 2019-08-14 19:04:43 -07:00
Brian Vaughn 41db902ed4 Removed unused __TEST__ files 2019-08-14 19:03:32 -07:00
Brian Vaughn 9ec9938ff4 print-warnings script should ignore DevTools packages 2019-08-14 14:02:12 -07:00
Brian Vaughn a473dca59e Merge branch 'master' into devtools-v4-merge 2019-08-14 14:01:46 -07:00
Brian Vaughn 868d02d6c6 Added better error reporting for print-warnings errors (#16394) 2019-08-14 14:01:29 -07:00
Dan Abramov 4ba1412305 Revert "[Scheduler] Profiling features (#16145)" (#16392)
This reverts commit a34ca7bce6.
2019-08-14 20:02:41 +01:00
Brian Vaughn 4078167255 Removed (no longer necessary) node->node-events mapping 2019-08-14 11:43:59 -07:00
Brian Vaughn d7ca8847f5 Add build-info.json to package files array for non-private DT packages 2019-08-14 11:40:09 -07:00
Brian Vaughn 39209dc5b5 Update react-devtools-inline to embed react-debug-tools since it's not published yet 2019-08-14 11:37:48 -07:00
Brian Vaughn 45dff31a75 Patched up react-devtools-core Webpack configs 2019-08-14 11:22:28 -07:00
Brian Vaughn 58b39c60db Fixed web extensions 2019-08-14 10:33:33 -07:00
Brian Vaughn 30b8ef3756 Iterated on Webpack configs until I got the inline and shell packages seemingly working 2019-08-14 09:24:35 -07:00
Brian Vaughn 44e410900d Merged master (with events -> legacy-events package rename) 2019-08-14 07:35:49 -07:00
Brian Vaughn b1a03dfdc8 Rename legacy "events" package to "legacy-events" (#16388)
* Renamed 'events' package to 'legacy-events'
* Updated 'events' references to point to 'legacy-events'
2019-08-14 07:32:42 -07:00
Hristo Kanchev 9e64bf18e1 [eslint-plugin-react-hooks] Fixed crash when referencing arguments in arrow functions. (#16356)
* Fixed issue with def being undefined while referencing arguments.

* Removed todo comment.

* Skip exhaustive deps check if def is null.

* Fixed code formatting in ExhaustiveDeps.

* Removed unneeded comment in ExhaustiveDeps.
2019-08-14 14:44:06 +01:00
Simen Bekkhus e308a037be chore: make tests compatible with Jest 24 (#15779)
* chore: make tests compatible with Jest 24

* remove fake rafs

* rollback jsdom for localstorage compat

* Apply suggestions from code review

Co-Authored-By: Sunil Pai <threepointone@oculus.com>

* chore: cleanup lockfile
2019-08-14 12:32:26 +01:00
Simen Bekkhus 5fa99b5aa6 chore: add eslint-plugin-jest's valid-expect rule (#16332)
* chore: add eslint-plugin-jest's valid-expect rule

* update assertion
2019-08-14 11:51:01 +01:00
Brian Vaughn 441d014cef Cleaned up some extnesions build script stuff 2019-08-13 22:15:38 -07:00
Brian Vaughn 380da5fccc Moved OVERVIEW 2019-08-13 22:09:20 -07:00
Brian Vaughn b73e293cc5 Moved CHANGELOG 2019-08-13 22:05:45 -07:00
Brian Vaughn ac2e861fbe Fixed a bunch of Lint issues 2019-08-13 21:59:07 -07:00
Andrew Clark a34ca7bce6 [Scheduler] Profiling features (#16145)
* [Scheduler] Mark user-timing events

Marks when Scheduler starts and stops running a task. Also marks when
a task is initially scheduled, and when Scheduler is waiting for a
callback, which can't be inferred from a sample-based JavaScript CPU
profile alone.

The plan is to use the user-timing events to build a Scheduler profiler
that shows how the lifetime of tasks interact with each other and
with unscheduled main thread work.

The test suite works by printing an text representation of a
Scheduler flamegraph.

* Expose shared array buffer with profiling info

Array contains

- the priority Scheduler is currently running
- the size of the queue
- the id of the currently running task

* Replace user-timing calls with event log

Events are written to an array buffer using a custom instruction format.
For now, this is only meant to be used during page start up, before the
profiler worker has a chance to start up. Once the worker is ready, call
`stopLoggingProfilerEvents` to return the log up to that point, then
send the array buffer to the worker.

Then switch to the sampling based approach.

* Record the current run ID

Each synchronous block of Scheduler work is given a unique run ID. This
is different than a task ID because a single task will have more than
one run if it yields with a continuation.
2019-08-13 19:01:17 -07:00
Lee Byron 56636353d8 Partial support for React.lazy() in server renderer. (#16383)
Provides partial support for React.lazy() components from the existing PartialRenderer server-side renderer.

Lazy components which are already resolved (or rejected), perhaps with something like `react-ssr-prepass`, can be continued into synchronously. If they have not yet been initialized, they'll be initialized before checking, opening the possibility to exploit this capability with a babel transform. If they're pending (which will typically be the case for a just initialized async ctor) then the existing invariant continues to be thrown.
2019-08-13 18:51:20 -07:00
Sebastian Markbåge 6fbe630549 [Partial Hydration] Attempt hydration at a higher pri first if props/context changes (#16352)
* Test that we can suspend updates while waiting to hydrate

* Attempt hydration at a higher pri first if props/context changes

* Retrying a dehydrated boundary pings at the earliest forced time

This might quickly become an already expired time.

* Mark the render as delayed if we have to retry

This allows the suspense config to kick in and we can wait for much longer
before we're forced to give up on hydrating.
2019-08-13 18:26:21 -07:00
Brian Vaughn 51626ae2f9 Prettier 2019-08-13 18:12:19 -07:00
Brian Vaughn f7afe1b864 Moved shell fixture into packages/react-devtools-shell 2019-08-13 18:11:59 -07:00
Brian Vaughn 183f96f2ac Prettier 2019-08-13 17:58:03 -07:00
Brian Vaughn edc46d7be7 Misc Flow and import fixes
1. Fixed all reported Flow errors
2. Added a few missing package declarations
3. Deleted ReactDebugHooks fork in favor of react-debug-tools
2019-08-13 17:53:28 -07:00
Brian Vaughn 08743b1a8e Reorganized folders into packages/* 2019-08-13 15:59:43 -07:00
Dan Abramov e0a521b02a Make component stack last argument for deprecation warnings (#16384) 2019-08-13 23:25:03 +01:00
Dan Abramov 1fd3906e92 Remove "Waiting for async callback" User Timing measurement (#16379)
* Remove "Waiting for async callback" User Timing measurement

* Fix User Timing in PROD mode
2019-08-13 22:03:29 +01:00
lunaruan 89bbffed6e Cleanup Babel PR (ReactFreshPlugin) (#16340)
* fix babel 7 issues

* fix babel 7 issues
2019-08-13 21:18:40 +01:00
Dan Abramov dc3160887b [CI] Disable coverage (#16380)
Looks like it's broken. Don't know if this will work to disable it while we figure out why?
2019-08-13 21:11:51 +01:00
Brian Vaughn ec7ef50e8b Reorganized things again into packages 2019-08-13 11:37:25 -07:00
Brian Vaughn 7cabb3946e Reorganized fixtures 2019-08-13 11:11:25 -07:00
Brian Vaughn c8922c3dbf Updated yarn.lock file 2019-08-13 11:08:40 -07:00
Brian Vaughn 9c825b59f1 Moved dev shell into fixtures/devtools 2019-08-13 11:05:37 -07:00
Brian Vaughn 65b93cd165 Merge remote-tracking branch 'devtools-merge/master' into devtools-v4-merge 2019-08-13 10:46:18 -07:00
Brian Vaughn 56b1c20cf0 Reorganized to avoid merge conflicts with React repo folder structure 2019-08-13 10:33:56 -07:00
Brian Vaughn e3ac9d219d Merging DevTools fork 2019-08-13 10:10:41 -07:00
Brian Vaughn 848327760f Initializing empty merge repo 2019-08-13 10:09:17 -07:00
Andrew Clark 21d6395a14 Add test case for #16359 (#16371) 2019-08-12 19:00:50 -07:00
Sebastian Markbåge a29adc9f62 Dehydrated suspense boundaries in suspense list (#16369)
If we get an insertion after a boundary, that has not yet been hydrated,
we take our best guess at which state the HTML is showing.

isSuspenseInstancePending means that we're still waiting for more server
HTML before we can hydrate. This should mean that we're showing the
fallback state.

isSuspenseInstanceFallback means that we want to client render something.
That most likely means that the server was unable to render and is
displaying a fallback state in this slot.

Adds tests to ensure that dehydrated components don't consider the force
flag.
2019-08-12 16:28:02 -07:00
Sebastian Markbåge 50addf4c0e Refactor Partial Hydration (#16346)
* Move dehydrated to be child of regular SuspenseComponent

We now store the comment node on SuspenseState instead and that indicates
that this SuspenseComponent is still dehydrated.

We also store a child but that is only used to represent the DOM node for
deletions and getNextHostSibling.

* Move logic from DehydratedSuspenseComponent to SuspenseComponent

Forked based on SuspenseState.dehydrated instead.

* Retry logic for dehydrated boundary

We can now simplify the logic for retrying dehydrated boundaries without
hydrating. This is becomes simply a reconciliation against the dehydrated
fragment which gets deleted, and the new children gets inserted.

* Remove dehydrated from throw

Instead we use the regular Suspense path. To save code, we attach retry
listeners in the commit phase even though technically we don't have to.

* Pop to nearest Suspense

I think this is right...?

* Popping hydration state should skip past the dehydrated instance

* Split mount from update and special case suspended second pass

The DidCapture flag isn't used consistently in the same way. We need
further refactor for this.

* Reorganize update path

If we remove the dehydration status in the first pass and then do a second
pass because we suspended, then we need to continue as if it didn't
previously suspend. Since there is no fragment child etc.

However, we must readd the deletion.

* Schedule context work on the boundary and not the child

* Warn for Suspense hydration in legacy mode

It does a two pass render that client renders the content.

* Rename DehydratedSuspenseComponent -> DehydratedFragment

This now doesn't represent a suspense boundary itself. Its parent does.

This Fiber represents the fragment around the dehydrated content.

* Refactor returns

Avoids the temporary mutable variables. I kept losing track of them.

* Add a comment explaining the type.

Placing it in the type since that's the central point as opposed to spread
out.
2019-08-12 15:58:38 -07:00
Andrew Clark c2034716a5 Fix typo in error code map (#16373)
"responer" -> "responder"

I also removed an unused error code that never shipped.
2019-08-12 14:56:09 -07:00
Andrew Clark 62b04cfa75 Remove unused import
That's why you wait for the lint job to finish, Andrew!!!!!!
2019-08-12 14:35:33 -07:00
Andrew Clark 3eeb645515 Remove flag that reverts #15650 (#16372)
The change in #15650 has fully rolled out, so we can remove the flag
that reverts it.
2019-08-12 14:31:12 -07:00
Sebastian Markbåge 2716d91ec4 Reset didReceiveUpdate in beginWork (#16359)
This is a bad bug. It means that we sometimes inherit
didReceiveUpdate from a previous component's begin.

Effectively this only means that we're overrendering in some cases.

We should refactor to get rid of this as a global flag.
2019-08-12 14:16:25 -07:00
Nicolas Gallagher 9449f8bf39 [react-events] Fix keyboard responder test (#16368) 2019-08-12 13:51:00 -07:00
Brian Vaughn 6eb04b2b16 4.0.0-alpha.8 -> 4.0.0-alpha.9 2019-08-12 11:34:00 -07:00