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

Fix and update attribute-behavior fixture #26114

Merged
merged 6 commits into from
Feb 10, 2023

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Feb 6, 2023

Summary

Due to #25928 the attribute fixture could no longer finish since it expects at least something to render. But since Fizz currently breaks down completely on malformed <meta> tags, the fixture could no longer handle this.

The fixture now renders valid types for meta tags.

Note that the snapshot change to viewTarget`` is already on main`. Review by commit helps to understand this.

Added html[lang] so that we test at least one standard attribute on <html>. version is obsolete so results are not that trustworthy.

How did you test this change?

With Chrome Version 109.0.5414.119 (Official Build) (64-bit)

  • yarn build --type=UMD_DEV react/index,react-dom && cd fixtures/attribute-behavior && yarn install && yarn start

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 6, 2023
@react-sizebot
Copy link

react-sizebot commented Feb 6, 2023

Comparing: 55542bc...dfb5f26

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 = 154.56 kB 154.56 kB = 48.84 kB 48.84 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 156.56 kB 156.56 kB = 49.46 kB 49.46 kB
facebook-www/ReactDOM-prod.classic.js = 529.69 kB 529.69 kB = 94.36 kB 94.36 kB
facebook-www/ReactDOM-prod.modern.js = 514.91 kB 514.91 kB = 92.16 kB 92.16 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against dfb5f26

@gnoff
Copy link
Collaborator

gnoff commented Feb 8, 2023

@eps1lon once #26106 lands the meta tags will get hoisted but won't require the extra props to avoid getting dropped. do you want to wait for that to land this or undo these changes once that one is incorporated? Also is this running on oss-stable only? It seems it is not flagged but we could in theory have singletons and hoistables on for some builds and not others

@eps1lon
Copy link
Collaborator Author

eps1lon commented Feb 8, 2023

@eps1lon once #26106 lands the meta tags will get hoisted but won't require the extra props to avoid getting dropped. do you want to wait for that to land this or undo these changes once that one is incorporated?

I think it's better to wait for #26106 for now.

Also is this running on oss-stable only?

It's running on the published latest and on main. But I think only main is actually used for the snapshot.

@eps1lon eps1lon marked this pull request as draft February 8, 2023 21:14
Ran without `<meta>` tags which currently crash
the fixture
@eps1lon eps1lon force-pushed the test/attribute-fixture-update branch from 1adecbe to 5f9e4ff Compare February 10, 2023 13:06
@eps1lon eps1lon changed the title [attribute-fixture] Fix and update Fix and update attribute-behavior fixture Feb 10, 2023
`version` is obsolete so I was hoping this result doesn't matter.
But `lang`  has the same behavior i.e. isn't added to the DOM on the client
@eps1lon eps1lon force-pushed the test/attribute-fixture-update branch from 96dd1bf to 9a2f7f7 Compare February 10, 2023 13:31
@@ -282,12 +284,12 @@ function getRenderedAttributeValue(
try {
let container = createContainer();
renderer.render(react.createElement(tagName, baseProps), container);
defaultValue = read(container.firstChild);
defaultValue = read(container.lastChild);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Consistent with how we read the value of server-rendered markup. firstChild returns the DOCTYPE now if we render into a document on the client.

@eps1lon eps1lon requested a review from gnoff February 10, 2023 13:34
@eps1lon eps1lon marked this pull request as ready for review February 10, 2023 13:34
fixtures/attribute-behavior/src/attributes.js Outdated Show resolved Hide resolved
@@ -764,7 +772,7 @@ class App extends React.Component {
ReactDOMStable:
'https://unpkg.com/react-dom@latest/umd/react-dom.development.js',
ReactDOMServerStable:
'https://unpkg.com/react-dom@latest/umd/react-dom-server.browser.development.js',
'https://unpkg.com/react-dom@latest/umd/react-dom-server-legacy.browser.development.js',
Copy link
Collaborator

Choose a reason for hiding this comment

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

What caused this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

renderToString is no longer included in react-dom-server.browser. Makes sense considering renderToString is considered legacy. renderToString was already excluded from the 18.0.0 UMD bundle so there was no change to the UMD bundle in a SemVer minor.

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh odd, I thought that was already the case. sounds good

@eps1lon eps1lon requested a review from gnoff February 10, 2023 15:54
@eps1lon eps1lon merged commit b8ae89f into facebook:main Feb 10, 2023
@eps1lon eps1lon deleted the test/attribute-fixture-update branch February 10, 2023 18:19
github-actions bot pushed a commit that referenced this pull request Feb 10, 2023
## Summary

Due to #25928 the attribute
fixture could no longer finish since it expects at least something to
render. But since Fizz currently breaks down completely on malformed
`<meta>` tags, the fixture could no longer handle this.

The fixture now renders valid types for `meta` tags.

Note that the snapshot change to `viewTarget`` is already on `main`.
Review by commit helps to understand this.

Added `html[lang]` so that we test at least one standard attribute on
`<html>`. `version` is obsolete so results are not that trustworthy.

## How did you test this change?

With Chrome Version 109.0.5414.119 (Official Build) (64-bit)

- `yarn build --type=UMD_DEV react/index,react-dom && cd
fixtures/attribute-behavior && yarn install && yarn start`

DiffTrain build for [b8ae89f](b8ae89f)
[View git log for this commit](https://github.com/facebook/react/commits/b8ae89f38288bfae37dff54fa1ec4bf3b4555ed5)
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