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

Test suite for hydration diff warnings #24229

Merged
merged 3 commits into from
Mar 31, 2022
Merged

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Mar 31, 2022

In preparation for #24167.

If we're doing something more ambitious like #24167 (comment) I want to have good coverage of different cases and make sure the right thing is being printed. There are existing tests in different places but I want to have an exhaustive suite dedicated just to this, and ideally it should be easy to iterate on. So I made these inline snapshots.

This just documents the current behavior. Follow-up will change the messages.

@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label Mar 31, 2022
in Mismatch (at **)",
"Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>.",
"Caught [Hydration failed because the initial UI does not match what was rendered on the server.]",
"Caught [Hydration failed because the initial UI does not match what was rendered on the server.]",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Curious that this error shows up twice.

@sizebot
Copy link

sizebot commented Mar 31, 2022

Comparing: b76103d...d55ca42

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.min.js = 131.30 kB 131.30 kB = 41.96 kB 41.96 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 136.36 kB 136.36 kB = 43.41 kB 43.41 kB
facebook-www/ReactDOM-prod.classic.js = 432.72 kB 432.72 kB = 79.59 kB 79.59 kB
facebook-www/ReactDOM-prod.modern.js = 417.72 kB 417.72 kB = 77.21 kB 77.21 kB
facebook-www/ReactDOMForked-prod.classic.js = 432.72 kB 432.72 kB = 79.59 kB 79.59 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against d55ca42

@gaearon
Copy link
Collaborator Author

gaearon commented Mar 31, 2022

Hmm apparently snapshot tests don't work with our "expect to fail" thing...

Copy link

@Mrfaisa6 Mrfaisa6 left a comment

Choose a reason for hiding this comment

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

Gmail

@gaearon gaearon merged commit 4db3ff6 into facebook:main Mar 31, 2022
rickhanlonii pushed a commit that referenced this pull request Apr 13, 2022
* Test suite for hydration diff warnings

* Test both variants

* Add more edge cases
rickhanlonii pushed a commit that referenced this pull request Apr 14, 2022
* Test suite for hydration diff warnings

* Test both variants

* Add more edge cases
rickhanlonii pushed a commit that referenced this pull request Apr 14, 2022
* Test suite for hydration diff warnings

* Test both variants

* Add more edge cases
zhengjitf pushed a commit to zhengjitf/react that referenced this pull request Apr 15, 2022
* Test suite for hydration diff warnings

* Test both variants

* Add more edge cases
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