Commit Graph
13657 Commits
Author SHA1 Message Date
Brian VaughnandGitHub 234d7d2147 Make DevTools Websocket retry delay configurable (#20107) 2020-10-28 22:08:47 -04:00
Andrew ClarkandGitHub 95b82a0622 Prevent inlining into recursive commit functions (#20105)
Adds a bunch of no-inline directives to commit phase functions to
prevent them from being inlined into one of our recursive algorithms.

The motivation is to minimize the number of variables in the recursive
functions, since each one contributes to the size of the stack frame.

Theoretically, this could help the performance of both the recursive
and non-recursive (iterative) implementations of the commit phase,
since even the iterative implementation sometimes uses the JS stack.
2020-10-27 12:51:34 -07:00
Andrew ClarkandGitHub 0c9ee6c483 Traverse commit phase effects iteratively (#20094)
* Move traversal logic to ReactFiberCommitWork

The current traversal logic is spread between ReactFiberWorkLoop and
ReactFiberCommitWork, and it's a bit awkward, especially when
refactoring. Idk the ideal module structure, so for now I'd rather keep
it all in one file.

* Traverse commit phase effects iteratively

We suspect that using the JS stack to traverse through the tree in the
commit phase is slower than traversing iteratively.

I've kept the recursive implementation behind a flag, both so we have
the option to run an experiment comparing the two, and so we can revert
it easily later if needed.
2020-10-27 12:02:19 -07:00
a9a8781f40 Allow Node 15.x (#20108)
Co-authored-by: Justus Hämäläinen <[email protected]>
2020-10-27 15:16:16 +00:00
Sy Tran DungandGitHub 7d4f9ada95 Fix error loading source maps for devtools extension (#20079) 2020-10-22 11:26:24 -04:00
1f7a3bafe3 Overly eager update-notifier usage in react-devtools (#20078)
Co-authored-by: abhyuday <[email protected]>
2020-10-22 08:52:14 -04:00
Dan Abramov a1f7caef10 17.0.1 2020-10-22 13:24:46 +01:00
Minh NguyenandGitHub 184d3e2d7d Use [email protected] in yarn.lock (#20072)
This ensures that tests are run against the latest published version. This
merely updates the version in `yarn.lock` and not in `react-test-renderer`'s
`package.json` to avoid having to cut another release of `react-test-renderer`.
2020-10-21 13:37:34 +01:00
Dan AbramovandGitHub 6988188b09 Remove usage of Array#fill (#20071) 2020-10-21 13:17:44 +01:00
Dan AbramovandGitHub c1f7dac6dc Update CHANGELOG.md 2020-10-21 01:15:28 +01:00
Dan AbramovandGitHub 134c3ec457 Link to the blog post 2020-10-20 21:51:41 +01:00
Dan AbramovandGitHub e73ba7897f Bump versions for 17 (#20062) 2020-10-20 21:41:18 +01:00
Dan AbramovandGitHub bd9060aad6 Add React 17 changelog 2020-10-20 21:22:00 +01:00
Brian VaughnandGitHub 16276d0fc4 Profiler: Include ref callbacks in onCommit duration (#20060) 2020-10-20 14:35:57 -04:00
Brian VaughnandGitHub 5df6fbd43a useRef: Warn about reading or writing mutable values during render (#18545)
Reading or writing a ref value during render is only safe if you are implementing the lazy initialization pattern.

Other types of reading are unsafe as the ref is a mutable source.

Other types of writing are unsafe as they are effectively side effects.

This change also refactors useTransition to no longer use a ref hook, but instead manage its own (stable) hook state.
2020-10-19 16:05:00 -04:00
Brian VaughnandGitHub abe673ce02 DevTools fix props editing for host components (#20055) 2020-10-19 15:21:41 -04:00
Brian Vaughn b96158b049 DevTools 4.8.2 -> 4.9.0 bump 2020-10-19 11:20:54 -04:00
Brian VaughnandGitHub b45373a671 Improved Profiler commit hooks test (#20053)
Previously the tests didn't ensure that time spent during cascading render was not included in duration reported by commit hooks.
2020-10-19 09:36:00 -04:00
Kai RiemannandGitHub e504387e81 [Fast Refresh] Fix crashes caused by rogue Proxies (#20030) (#20039) 2020-10-17 17:47:52 +01:00
Andrew ClarkandGitHub 30641fbc27 Use bitwise OR to define flag masks (#20044)
Easier to read, harder to mess up. These expressions get simplified by
Closure, so there's no runtime impact.
2020-10-16 13:30:35 -07:00
Andrew ClarkandGitHub 40b6cfcd06 Add Visibility flag for hiding/unhiding trees (#20043)
* Add Visibility flag for hiding/unhiding trees

There's `beforeblur` logic in the snapshot phase that needs to visit
every Suspense boundary whose visibility is toggled. Right now it does
that by visiting Placement and Deletion effects. That includes many
unrelated nodes.

By adding a new flag specifically for toggling Visibility, we will only
visit the relevant Suspense (and Offscreen) boundaries, instead of all
nodes that have a Placement.

Potential follow-ups (not urgent):

- The `beforeblur` logic also has a check to see whether the visibility
was toggled on or off. It only cares about things being hidden. As a
follow up, I can split the Visibility flag into separate Hide/Show
flags, and only visit Hide.
- Now that this is separate from Update, we can move the rest of the
Suspense's layout effects (like attaching retry listeners) to the
passive phase.

* Gate behind createEventHandle feature flag

Only need to visit deleted and hidden trees during the snapshot phase
if the experimental `createEventHandle` flag is enabled. Currently,
it's only used internally at Facebook, not open source.
2020-10-16 09:49:07 -07:00
Andrew ClarkandGitHub 4261327727 Remove last schedulePassiveEffectCallback call (#20042)
Now there's only a single place where the passive effect callback
is scheduled.
2020-10-16 09:06:55 -07:00
Dan AbramovandGitHub 80d3ddd6bb Remove Set bookkeeping for root events (#19990)
* Remove dead code branch

This function is only called when initializing roots/containers (where we skip non-delegated events) and in the createEventHandle path for non-DOM nodes (where we never hit this path because targetElement is null).

* Move related functions close to each other

* Fork listenToNativeEvent for createEventHandle

It doesn't need all of the logic that's needed for normal event path.

And the normal codepath doesn't use the last two arguments.

* Expand test coverage for non-delegated events

This changes a test to fail if we removed the event handler Sets. Previously, we didn't cover that.

* Add DEV-level check that top-level events and non-delegated events do not overlap

This makes us confident that they're mutually exclusive and there is no duplication between them.

* Add a test verifying selectionchange deduplication

This is why we still need the Set bookkeeping. Adding a test for it.

* Remove Set bookkeeping for root events

Root events don't intersect with non-delegated bubbled events (so no need to deduplicate there). They also don't intersect with createEventHandle non-managed events (because those don't go on the DOM elements). So we can remove the bookeeping because we already have code ensuring the eager subscriptions only run once per element.

I've moved the selectionchange special case outside, and added document-level deduplication for it alone.

Technically this might change the behavior of createEventHandle with selectionchange on the document, but we're not using that, and I'm not sure that behavior makes sense anyway.

* Flow
2020-10-16 16:49:41 +01:00
Sebastian SilbermannandGitHub 5a997537c9 test: Add regression test for hooks after error boundaries (#20002)
* test: Add regression test for hooks after error boundaries

* fix lint
2020-10-16 16:07:27 +01:00
oltrepandGitHub d4bced18a1 Bump to latest eslint-config-fbjs (#20029)
* bump package to latest

* update files to respect lint

* disable object-type-delimiter rule to work with prettier

* disable rule to let flow check pass
2020-10-16 16:06:08 +01:00
Andrew ClarkandGitHub d1d2c92a35 Remove Passive flag from "before mutation" phase (#20038)
We don't need to visit passive effect nodes during before mutation.

The only reason we were previously was to schedule the root-level
passive effect callback as early as possible, but now that
`subtreeFlags` exists, we can check that instead.

This should reduce the amount of traversal during the commit phase,
particularly when mounting or updating large trees that contain many
passive effects.
2020-10-16 08:21:58 -05:00
IDrissAitHafidandGitHub 0458757b6a fixed unfound node error when Suspense is filtered (#20019)
* fixed unfound node error when Suspense is filtered

* added a test for filtered Suspense node
2020-10-15 14:45:23 -04:00
fd672a70cd ReactIs.isValidElementType Unit Test extended with PureComponent case (#20033)
Co-authored-by: Adam Plocieniak <[email protected]>
2020-10-15 08:48:28 -04:00
Brian VaughnandGitHub 5833cf4917 Don't double-invoke effects in legacy roots (#20028)
Large legacy applications are likely to be difficult to update to handle this feature, and it wouldn't add any value– since newer APIs that require this resilience are not legacy compatible.
2020-10-15 08:40:12 -04:00
Dominic GannawayandGitHub 5dae441309 [EventSystem] Revise onBeforeBlur propagation mechanics (#20020) 2020-10-14 23:38:57 +01:00
Dan AbramovandGitHub ec23e4eecf Update changelog for 16.14, 15.7, 0.14.10 (#20027) 2020-10-14 20:52:37 +01:00
Simen BekkhusandGitHub 417cde0d40 chore: downgrade source-map-support for stack "fix" (#20026)
* chore: downgrade source-map-support for stack "fix"

* lint?
2020-10-14 20:45:54 +01:00
Saikat GuhaandGitHub 098d4ecc68 DevTools: Handle restricted browser pages properly like new tab page, extensions page etc(only chrome and edge for now) (#20023) 2020-10-14 13:59:05 -04:00
Dan AbramovandGitHub f06427fe47 Fixture: Legacy JSX Runtimes (#20012)
* Fixture: Legacy JSX Runtimes

* Add more comments
2020-10-14 18:28:03 +01:00
Brian VaughnandGitHub 03065f533b DevTools always overrides the dispatcher when shallow rendering (#20011)
This is done so that any effects scheduled by the shallow render are thrown away.

Unlike the code this was forked from (in ReactComponentStackFrame) DevTools should override the dispatcher even when DevTools is compiled in production mode, because the app itself may be in development mode and log errors/warnings.
2020-10-14 13:19:47 -04:00
RickyandGitHub 91e223fb55 Deprecate old test script commands (#19893)
* Deprecate old test script commands

* Update PR template test script

* Add test-stable and test-www-classic

* Update circle test names

* Rename test-www-classic to test-classic

* Missed some job renames

* Missed some more job renames
2020-10-14 08:54:34 -04:00
ee0b42b19b handled a missing suspense fiber when suspense is filtered on the profiler (#19987)
Co-authored-by: Brian Vaughn <[email protected]>
2020-10-13 13:38:58 -04:00
Brian VaughnandGitHub 45099227df Fix bad null check in DevTools highlight code (#20010) 2020-10-13 13:08:12 -04:00
c766f6c82d [DevTools] Add DevTools forked Feature flags (#18994)
Also resolve an uncaught error in extension build (#18843).

Co-authored-by: Brian Vaughn <[email protected]>
Co-authored-by: Brian Vaughn <[email protected]>
2020-10-12 13:07:10 -04:00
38a87c60c8 Updated OVERVIEW.md to the new infos required when adding a new leaf node to the tree (#19981)
Co-authored-by: Idriss AITHAFID <[email protected]>
2020-10-09 09:29:30 -04:00
Saikat GuhaandGitHub 7e360ca2c2 Update outdated links and fix two broken links (#19985)
* update all facebook.github.io links

* facebookincubator links : update some outdated links and fix two other broken links where they are actually the latest updated ones
2020-10-09 02:56:30 +01:00
Sebastian MarkbågeandGitHub ca766e61e6 [Flight] Don't warn for key, but error for ref (#19986)
* Improve error message by expanding the object in question

* Don't warn for key/ref getters

* Error if refs are passed in server components or to client components
2020-10-08 17:02:23 -07:00
Dan AbramovandGitHub 8285823a6d Enable eager listeners statically (#19983) 2020-10-08 19:32:28 +01:00
Sebastian MarkbågeandGitHub 58fb6b2f98 [Flight] Add Runtime Errors for Non-serializable Values (#19980)
* Error on encoding non-serializable props

* Add DEV time warnings to enforce that values are plain objects
2020-10-08 11:11:15 -07:00
4c53d9f7f6 updating the informations needed when adding a root node to a tree in react-devtools overview doc (#19979)
Co-authored-by: Idriss AITHAFID <[email protected]>
2020-10-08 08:46:15 -04:00
Shivam SandbhorandGitHub 67ed2649ea Treat <time> tag as a normal HTML tag. (#19951)
<time> tag has been supported by Chrome since Chrome 62.0.
Remove workarounds which were in place to avoid friction with
versions before Chrome 62.

Signed-off-by: Shivam Sandbhor <[email protected]>
2020-10-06 03:15:32 +01:00
Brian VaughnandGitHub b3097929ff Revert "Temporarily disable Profiler commit hooks flag (#19900)" (#19960) 2020-10-05 15:49:52 -04:00
Brian VaughnandGitHub 04f166a5e1 Removed skip-error-boundaries modifications from old fork (#19961)
Technically this change is unnecessary, since the feature is controlled by a flag, but since we decided not to ship this in v17– I'm going to remove it for now entirely.
2020-10-05 15:49:44 -04:00
Brian VaughnandGitHub ac3a932add Revert "DevTools: Improve browser extension iframe support (#19854)" (#19959)
This reverts commit dbc0833791.
2020-10-05 09:44:08 -04:00
Paul DoyleandGitHub 0ed319adbd Remove unnecessary error overriding in (#19949) 2020-10-02 22:10:46 +01:00