Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

Assertively claim a SuspenseInstance. We already know we're hydrating.

If there's no match, it throws anyway. So there's no other code path.

Assertively claim a SuspenseInstance. We already know we're hydrating.

If there's no match, it throws anyway. So there's no other code path.
warnNonHydratedInstance(fiber, nextInstance);
throwOnHydrationMismatch(fiber);
throw throwOnHydrationMismatch(fiber);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Satisfies Flow. Does Flow not have something like never where this is asserted to always throw?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't work

// To avoid a stack mismatch we need to pop the Suspense handler that we
// pushed above. This will become less awkward when move the hydration
// logic to its own fiber.
popSuspenseHandler(workInProgress);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code path became unreachable once we started throwing for all hydration mismatches but we didn't know that due to the code structure.

@react-sizebot
Copy link

Comparing: 8a3c5e1...73cd22d

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB +0.05% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 517.25 kB 516.18 kB = 91.98 kB 91.88 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 622.05 kB 621.42 kB = 110.05 kB 109.98 kB
facebook-www/ReactDOM-prod.classic.js = 655.28 kB 654.75 kB = 115.63 kB 115.56 kB
facebook-www/ReactDOM-prod.modern.js = 645.56 kB 645.03 kB = 114.08 kB 114.03 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-reconciler/cjs/react-reconciler.production.js = 392.31 kB 391.50 kB = 63.83 kB 63.75 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 517.25 kB 516.18 kB = 91.98 kB 91.88 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.js = 392.28 kB 391.47 kB = 63.81 kB 63.72 kB
oss-stable-semver/react-dom/cjs/react-dom-client.production.js = 517.12 kB 516.05 kB = 91.95 kB 91.85 kB

Generated by 🚫 dangerJS against 73cd22d

@sebmarkbage sebmarkbage merged commit 961b625 into facebook:main Apr 11, 2025
243 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 11, 2025
Assertively claim a SuspenseInstance. We already know we're hydrating.

If there's no match, it throws anyway. So there's no other code path.

DiffTrain build for [961b625](961b625)
github-actions bot pushed a commit that referenced this pull request Apr 11, 2025
Assertively claim a SuspenseInstance. We already know we're hydrating.

If there's no match, it throws anyway. So there's no other code path.

DiffTrain build for [961b625](961b625)
sebmarkbage added a commit that referenced this pull request Apr 22, 2025
Stacked on #32851 and #32900.

This implements the equivalent Configs for ActivityInstance as we have
for SuspenseInstance. These can be implemented as comments but they
don't have to be and can be implemented differently in the renderer.

This seems like a lot duplication but it's actually ends mostly just
calling the same methods underneath and the wrappers compiles out.

This doesn't leave the Activity dehydrated yet. It just hydrates into it
immediately.
github-actions bot pushed a commit that referenced this pull request Apr 22, 2025
Stacked on #32851 and #32900.

This implements the equivalent Configs for ActivityInstance as we have
for SuspenseInstance. These can be implemented as comments but they
don't have to be and can be implemented differently in the renderer.

This seems like a lot duplication but it's actually ends mostly just
calling the same methods underneath and the wrappers compiles out.

This doesn't leave the Activity dehydrated yet. It just hydrates into it
immediately.

DiffTrain build for [17f88c8](17f88c8)
github-actions bot pushed a commit that referenced this pull request Apr 22, 2025
Stacked on #32851 and #32900.

This implements the equivalent Configs for ActivityInstance as we have
for SuspenseInstance. These can be implemented as comments but they
don't have to be and can be implemented differently in the renderer.

This seems like a lot duplication but it's actually ends mostly just
calling the same methods underneath and the wrappers compiles out.

This doesn't leave the Activity dehydrated yet. It just hydrates into it
immediately.

DiffTrain build for [17f88c8](17f88c8)
github-actions bot pushed a commit to code/lib-react that referenced this pull request Apr 23, 2025
Stacked on facebook#32851 and facebook#32900.

This implements the equivalent Configs for ActivityInstance as we have
for SuspenseInstance. These can be implemented as comments but they
don't have to be and can be implemented differently in the renderer.

This seems like a lot duplication but it's actually ends mostly just
calling the same methods underneath and the wrappers compiles out.

This doesn't leave the Activity dehydrated yet. It just hydrates into it
immediately.

DiffTrain build for [17f88c8](facebook@17f88c8)
github-actions bot pushed a commit to code/lib-react that referenced this pull request Apr 23, 2025
Stacked on facebook#32851 and facebook#32900.

This implements the equivalent Configs for ActivityInstance as we have
for SuspenseInstance. These can be implemented as comments but they
don't have to be and can be implemented differently in the renderer.

This seems like a lot duplication but it's actually ends mostly just
calling the same methods underneath and the wrappers compiles out.

This doesn't leave the Activity dehydrated yet. It just hydrates into it
immediately.

DiffTrain build for [17f88c8](facebook@17f88c8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants