Skip to content
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

[Fiber] Mark hydrated components in tertiary color (green) #31829

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

sebmarkbage
Copy link
Collaborator

This is a follow up to #31752.

This keeps track in the commit phase whether this subtree was hydrated. If it was, then we mark those components in the Components track as green. Just like the phase itself is marked as green.

If the boundary client rendered we instead mark it as "errored" and its children given the plain primary render color (blue). I also collect the hydration error for this case so we can include its message in the details view. (Unfortunately this doesn't support newlines atm.)

Most of the time this happens in separate commits for each boundary but it is possible to force a client render in the same pass as a hydration. Such as if an update flows into a boundary that has been put into fallback state after it was initially attempted.

Screenshot 2024-12-18 at 12 06 54 AM

Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 7:48pm

@react-sizebot
Copy link

react-sizebot commented Dec 18, 2024

Comparing: 74dd2da...a1858c4

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 +0.13% 510.71 kB 511.38 kB +0.10% 91.29 kB 91.38 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js +0.13% 516.86 kB 517.53 kB +0.10% 92.24 kB 92.34 kB
facebook-www/ReactDOM-prod.classic.js +0.11% 592.42 kB 593.09 kB +0.07% 104.37 kB 104.45 kB
facebook-www/ReactDOM-prod.modern.js +0.11% 582.68 kB 583.35 kB +0.08% 102.82 kB 102.90 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-art/cjs/react-art.development.js +0.87% 581.99 kB 587.07 kB +0.91% 93.14 kB 93.99 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js +0.83% 436.67 kB 440.29 kB +0.95% 70.18 kB 70.85 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js +0.74% 665.22 kB 670.13 kB +0.78% 105.67 kB 106.49 kB
oss-experimental/react-dom/cjs/react-dom-profiling.profiling.js +0.61% 565.22 kB 568.65 kB +0.72% 99.82 kB 100.54 kB
oss-experimental/react-dom/cjs/react-dom-client.development.js +0.52% 969.83 kB 974.84 kB +0.65% 163.13 kB 164.19 kB
oss-experimental/react-dom/cjs/react-dom-profiling.development.js +0.51% 986.27 kB 991.28 kB +0.63% 165.96 kB 167.01 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js +0.51% 986.76 kB 991.78 kB +0.62% 166.91 kB 167.95 kB
oss-stable-semver/react-art/cjs/react-art.production.js +0.21% 299.34 kB 299.98 kB +0.15% 51.20 kB 51.28 kB
oss-stable/react-art/cjs/react-art.production.js +0.21% 299.41 kB 300.06 kB +0.15% 51.23 kB 51.30 kB
oss-experimental/react-art/cjs/react-art.production.js +0.21% 304.36 kB 305.00 kB +0.16% 52.00 kB 52.08 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.js +0.21% 310.45 kB 311.09 kB +0.15% 54.46 kB 54.54 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.js +0.21% 310.53 kB 311.17 kB +0.14% 54.49 kB 54.57 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.js +0.21% 310.70 kB 311.34 kB +0.14% 54.52 kB 54.60 kB

Generated by 🚫 dangerJS against 8a5241e

This might be either due to concurrent errors recovering from a sync render
or hydration errors.
@sebmarkbage sebmarkbage merged commit 17520b6 into facebook:main Dec 19, 2024
187 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 19, 2024
This is a follow up to #31752.

This keeps track in the commit phase whether this subtree was hydrated.
If it was, then we mark those components in the Components track as
green. Just like the phase itself is marked as green.

If the boundary client rendered we instead mark it as "errored" and its
children given the plain primary render color (blue). I also collect the
hydration error for this case so we can include its message in the
details view. (Unfortunately this doesn't support newlines atm.)

Most of the time this happens in separate commits for each boundary but
it is possible to force a client render in the same pass as a hydration.
Such as if an update flows into a boundary that has been put into
fallback state after it was initially attempted.

<img width="1487" alt="Screenshot 2024-12-18 at 12 06 54 AM"
src="https://github.com/user-attachments/assets/74c57291-4d11-414c-9751-3dac3285a89a"
/>

DiffTrain build for [17520b6](17520b6)
github-actions bot pushed a commit that referenced this pull request Dec 19, 2024
This is a follow up to #31752.

This keeps track in the commit phase whether this subtree was hydrated.
If it was, then we mark those components in the Components track as
green. Just like the phase itself is marked as green.

If the boundary client rendered we instead mark it as "errored" and its
children given the plain primary render color (blue). I also collect the
hydration error for this case so we can include its message in the
details view. (Unfortunately this doesn't support newlines atm.)

Most of the time this happens in separate commits for each boundary but
it is possible to force a client render in the same pass as a hydration.
Such as if an update flows into a boundary that has been put into
fallback state after it was initially attempted.

<img width="1487" alt="Screenshot 2024-12-18 at 12 06 54 AM"
src="https://github.com/user-attachments/assets/74c57291-4d11-414c-9751-3dac3285a89a"
/>

DiffTrain build for [17520b6](17520b6)
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.

4 participants