-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Suspense-wrapping heuristic #19368
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 43d92f8:
|
@@ -716,4 +716,93 @@ describe('ProfilingCache', () => { | |||
TestRenderer.create(<Validator commitIndex={0} rootID={rootID} />); | |||
}); | |||
}); | |||
|
|||
// See https://github.com/facebook/react/issues/18831 | |||
it('should not crash during route transitions with Suspense', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This newly added test caught the regression between 16.13.1 (NPM release) and previous DevTools master.
To be clear, I think we should still move forward with this fix and release an updated version of DevTools since this fixes the issue all open source users (who use Suspense) are currently facing. This can be confirmed by building and running the extension against this repro case I created: https://cx4rd.csb.app/ |
719ec6b
to
aded239
Compare
1fc2976
to
0025608
Compare
CI is failing because of the shallow renderer, which no longer lives in this repo. We can't update to point at v17 of it because that doesn't exist, and the latest version the does exist references react-is v16. |
0025608
to
972461a
Compare
I'm going to try removing all references to the shallow renderer to see if this fixes our CI failures. We can talk more before committing to this (or we could move forward and revert that specific part of the commit before the actual v17 release) but it would be nice to buy ourselves time without having to commit to v17 of shallow renderer. |
This PR seems to have gotten screwed up by a Circle CI issue, so I'm just going to close it and move to #19373 |
Fixes #18831
This PR also includes a package version bump (
16.13.1
->17.0.0-alpha.0
) so that DevTools tests will pass CI.PR #19108 broke DevTools
Suspense
integration.DevTools uses the renderer's version number to figure out what the tag numbers are:
react/packages/react-devtools-shared/src/backend/renderer.js
Lines 156 to 240 in 45eef8b
As of #19108, DevTools also decides how to traverse Suspense fibers using the tag values as a form of feature detection:
react/packages/react-devtools-shared/src/backend/renderer.js
Lines 1241 to 1247 in 45eef8b
The reason this PR also bumps version numbers is that we previously had multiple
Suspense
implementations published under 16.13.1 (both the NPM releases and our CI-built releases that tests run against), so the DevTools heuristic failed.To prevent this type of regression from happening again, a larger effort needs to be made in the form of follow up PRs to get CI running DevTools tests against a range of React releases (not just what's in master).