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

Remove enableFilterEmptyStringAttributesDOM #31765

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

rickhanlonii
Copy link
Member

Base off #31764

This has landed everywhere

Copy link

vercel bot commented Dec 13, 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 13, 2024 8:55pm

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Dec 13, 2024
Copy link
Collaborator

@sebmarkbage sebmarkbage left a comment

Choose a reason for hiding this comment

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

I noticed a bug with this today. Empty href string doesn't hydrate on the client since the attribute is omitted from the server. Causing a hydration error (in addition to the warning).

@react-sizebot
Copy link

Comparing: 3ad17ec...fda9cd7

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 = 510.34 kB 510.34 kB = 91.32 kB 91.33 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 = 515.25 kB 515.25 kB = 92.02 kB 92.02 kB
facebook-www/ReactDOM-prod.classic.js = 595.18 kB 595.18 kB = 105.01 kB 105.01 kB
facebook-www/ReactDOM-prod.modern.js = 585.44 kB 585.44 kB = 103.45 kB 103.45 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against ad3968d

'or pass null to %s instead of an empty string.',
propKey,
propKey,
);
}
Copy link
Collaborator

@sebmarkbage sebmarkbage Dec 13, 2024

Choose a reason for hiding this comment

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

I think we should probably skip hydrateSanitizedAttribute below if we already warned above.

I.e. call continue in the branch above.

Otherwise we end up both logging the error and with a hydration error, because the server will have omitted this attribute.

The hydration error is also not correct because it's not what the client would've done.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean only in the DEV branch above? That seems weird to differ in behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think what you're saying is that this would be how to fix the bug you found, so i'll merge with the existing behavior and we can fix the bug in a follow up

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well the DEV branch is defensive. This whole function is inside a DEV branch so it's not divergent.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rickhanlonii rickhanlonii merged commit 4996a8f into facebook:main Dec 13, 2024
187 checks passed
@rickhanlonii rickhanlonii deleted the rh/rm-ff-filter-strings branch December 13, 2024 21:30
github-actions bot pushed a commit that referenced this pull request Dec 13, 2024
Base off #31764

This has landed everywhere

DiffTrain build for [4996a8f](4996a8f)
github-actions bot pushed a commit that referenced this pull request Dec 13, 2024
Base off #31764

This has landed everywhere

DiffTrain build for [4996a8f](4996a8f)
rickhanlonii added a commit that referenced this pull request Dec 13, 2024
github-actions bot pushed a commit to code/lib-react that referenced this pull request Dec 14, 2024
github-actions bot pushed a commit to code/lib-react that referenced this pull request Dec 14, 2024
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