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

[Float] handle non-void resources properly #25535

Closed
wants to merge 2 commits into from

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Oct 22, 2022

Resources used to be all void but script and title have changed that. There was an implicit assumption that resources would be void and therefore the Fizz runtime did not have to consider whether it had pushed a Resource or Element.

Now that this void invariant no longer holds (title and script are not void) we need to augment Fizz runtime to fork pushing behavior. This implementation uses a sentinel value when a push is turned into a Resource. If found Fizz will omit the closing tag and any children (there are no children when pushing a resource).

There are some alternative factorings of this but this felt like the approach given our current constraints with a potential further refactor in the future now that Float is a bit more well developed.

@sizebot
Copy link

sizebot commented Oct 22, 2022

Comparing: 9341775...17cce5b

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 = 136.02 kB 136.02 kB = 43.54 kB 43.54 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 154.36 kB 154.36 kB = 49.22 kB 49.22 kB
facebook-www/ReactDOM-prod.classic.js = 493.96 kB 493.96 kB = 87.91 kB 87.91 kB
facebook-www/ReactDOM-prod.modern.js = 479.22 kB 479.22 kB = 85.73 kB 85.73 kB
facebook-www/ReactDOMForked-prod.classic.js = 493.96 kB 493.96 kB = 87.91 kB 87.91 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-server/cjs/react-server.development.js +0.24% 144.99 kB 145.34 kB +0.30% 36.12 kB 36.23 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.development.js +0.20% 311.26 kB 311.89 kB +0.31% 71.69 kB 71.91 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js +0.20% 311.96 kB 312.59 kB +0.31% 71.88 kB 72.10 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js +0.20% 312.92 kB 313.56 kB +0.30% 71.76 kB 71.97 kB
oss-experimental/react-dom/cjs/react-dom-static.node.development.js +0.20% 313.18 kB 313.81 kB +0.30% 71.94 kB 72.16 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js +0.20% 313.22 kB 313.85 kB +0.30% 71.85 kB 72.07 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js +0.20% 314.63 kB 315.26 kB +0.30% 72.22 kB 72.44 kB

Generated by 🚫 dangerJS against 17cce5b

@gnoff gnoff closed this Oct 22, 2022
@gnoff gnoff deleted the float-title-end-tag branch October 22, 2022 20:45
gnoff added a commit that referenced this pull request Oct 22, 2022
…5536)

replaces: #25535

This takes a more huerstic based approach with no new conditionals on
the hot path of fizz rendering.

If float is enabled
* title and script can only have simple children
* if non-simple children are found they will be ignored
* title and script are pushed in a single unit during pushStartInstance
including their children and closing tags

If float is not enabled
* the original pushing behaviors are in place and you can have complex
children but you will get warnings
rickhanlonii pushed a commit that referenced this pull request Dec 3, 2022
…5536)

replaces: #25535

This takes a more huerstic based approach with no new conditionals on
the hot path of fizz rendering.

If float is enabled
* title and script can only have simple children
* if non-simple children are found they will be ignored
* title and script are pushed in a single unit during pushStartInstance
including their children and closing tags

If float is not enabled
* the original pushing behaviors are in place and you can have complex
children but you will get warnings
mofeiZ pushed a commit to mofeiZ/react that referenced this pull request Dec 5, 2022
…cebook#25536)

replaces: facebook#25535

This takes a more huerstic based approach with no new conditionals on
the hot path of fizz rendering.

If float is enabled
* title and script can only have simple children
* if non-simple children are found they will be ignored
* title and script are pushed in a single unit during pushStartInstance
including their children and closing tags

If float is not enabled
* the original pushing behaviors are in place and you can have complex
children but you will get warnings
jerrydev0927 added a commit to jerrydev0927/react that referenced this pull request Jan 5, 2024
…5536)

replaces: facebook/react#25535

This takes a more huerstic based approach with no new conditionals on
the hot path of fizz rendering.

If float is enabled
* title and script can only have simple children
* if non-simple children are found they will be ignored
* title and script are pushed in a single unit during pushStartInstance
including their children and closing tags

If float is not enabled
* the original pushing behaviors are in place and you can have complex
children but you will get warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants