GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix nodeName to UPPERCASE in insertStylesheetIntoRoot by sweetliquid · Pull Request #28255 · react/react

Conversation

@sweetliquid

@sweetliquid sweetliquid commented Feb 6, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

image

The condition node.nodeName === 'link' is always false, because node.nodeName is Uppercase in specification. And the condition node.nodeName === 'LINK' is unnecessary, because Fizz hoists tags when it's media attribute is "not all", whether it is a link or a style (line 36):

https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetExternalRuntime.js#L30-L44

https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineSource.js#L30-L44

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@facebook-github-bot

facebook-github-bot commented Feb 6, 2024

Copy link
Copy Markdown
Contributor

Hi @sweetliquid!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@react-sizebot

react-sizebot commented Feb 6, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Comparing: 7039834...8b3cf21

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.66 kB 6.66 kB = 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 494.06 kB 494.06 kB = 88.22 kB 88.22 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 498.86 kB 498.86 kB = 88.93 kB 88.93 kB
facebook-www/ReactDOM-prod.classic.js = 591.22 kB 591.22 kB = 103.96 kB 103.96 kB
facebook-www/ReactDOM-prod.modern.js = 567.44 kB 567.44 kB = 100.36 kB 100.36 kB
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Generated by 🚫 dangerJS against 8b3cf21

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sweetliquid

sweetliquid commented Feb 6, 2024

Copy link
Copy Markdown
Contributor Author

If there are any problems, please guide me. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@facebook-github-bot facebook-github-bot added the CLA Signed label Feb 6, 2024
@eps1lon
eps1lon requested a review from gnoff February 6, 2024 16:44
@rickhanlonii

rickhanlonii commented Feb 11, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

@gnoff seems legit, and if not could we add a test that would fail this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sweetliquid
sweetliquid force-pushed the fix/insertStylesheetIntoRoot-nodeName branch from 56b1460 to fca552b Compare March 6, 2024 10:23
@gnoff

gnoff commented May 2, 2024

Copy link
Copy Markdown
Collaborator

@sweetliquid the nodeName check is a shortcut to avoid the attribute lookup on link tags since it will likely be slower than just reading the node name. You're right thought that this is currently non-functional. But let's just fix it to uppercase so we can avoid the attr read for the majority of tags we process this way

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sweetliquid
sweetliquid force-pushed the fix/insertStylesheetIntoRoot-nodeName branch from fca552b to 7c5c931 Compare May 7, 2024 14:37
@sweetliquid

sweetliquid commented May 7, 2024

Copy link
Copy Markdown
Contributor Author

@gnoff I've added back the nodeName check and fix it to uppercase, thanks for your explanation~

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sweetliquid
Fix nodeName comparison in insertStylesheetIntoRoot
8b3cf21
@sweetliquid
sweetliquid force-pushed the fix/insertStylesheetIntoRoot-nodeName branch from 7c5c931 to 8b3cf21 Compare May 7, 2024 14:42
@sweetliquid sweetliquid changed the title Remove unnecessary check in insertStylesheetIntoRoot Fix nodeName comparison in insertStylesheetIntoRoot May 11, 2024
@sweetliquid sweetliquid changed the title Fix nodeName comparison in insertStylesheetIntoRoot Fix nodeName to UPPERCASE in insertStylesheetIntoRoot Jun 12, 2024
@github-actions

github-actions Bot commented Sep 10, 2024

Copy link
Copy Markdown

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the Resolution: Stale Automatically closed due to inactivity label Sep 10, 2024
@sweetliquid

sweetliquid commented Sep 14, 2024

Copy link
Copy Markdown
Contributor Author

bump

gnoff reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the Resolution: Stale Automatically closed due to inactivity label Sep 14, 2024
gnoff
gnoff approved these changes Sep 14, 2024
View reviewed changes
@gnoff
gnoff merged commit b75cc07 into react:main Sep 14, 2024
github-actions Bot pushed a commit that referenced this pull request Sep 14, 2024
@gnoff
Fix nodeName to UPPERCASE in insertStylesheetIntoRoot (#28255)
36ded71
## Summary

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

<img width="518" alt="image"
src="https://github.com/facebook/react/assets/18693190/6d12df76-7dae-403b-b486-4940992abe8d">

The condition `node.nodeName === 'link'` is always `false`, because
`node.nodeName` is Uppercase in specification. And the condition
`node.nodeName === 'LINK'` is unnecessary, because Fizz hoists tags when
it's `media` attribute is `"not all"`, whether it is a `link` or a
`style` (line 36):

https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetExternalRuntime.js#L30-L44

https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineSource.js#L30-L44

DiffTrain build for [b75cc07](b75cc07)
This was referenced Sep 16, 2024
Upgrade React from 206df66e-20240912 to ee1a403a-20240916 vercel/next.js#70158
Closed
Upgrade React from 206df66e-20240912 to f2df5694-20240916 vercel/next.js#70159
Closed
Upgrade React from 206df66e-20240912 to a99d8e8d-20240916 vercel/next.js#70190
Merged
eps1lon pushed a commit to vercel/next.js that referenced this pull request Sep 18, 2024
@vercel-release-bot
Upgrade React from 206df66e-20240912 to a99d8e8d-20240916 (#70190)
5791706
**breaking change for canary users: Bumps peer dependency of React from
`19.0.0-rc-206df66e-20240912` to `19.0.0-rc-a99d8e8d-20240916`**

[diff
react/react@206df66e...a99d8e8d](react/react@206df66...a99d8e8)

<details>
<summary>React upstream changes</summary>

- react/react#30977
- react/react#30971
- react/react#30922
- react/react#30917
- react/react#30902
- react/react#30912
- react/react#30970
- react/react#30969
- react/react#30967
- react/react#30966
- react/react#30960
- react/react#30968
- react/react#30961
- react/react#28255
- react/react#30957
- react/react#30958
- react/react#30959
- react/react#30951
- react/react#30954
- react/react#30920
- react/react#30942

</details>
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@sweetliquid
Fix nodeName to UPPERCASE in insertStylesheetIntoRoot (react#28255)
7abf10b
## Summary

<!--
Explain the **motivation** for making this change. What existing problem
does the pull request solve?
-->

<img width="518" alt="image"
src="https://github.com/facebook/react/assets/18693190/6d12df76-7dae-403b-b486-4940992abe8d">

The condition `node.nodeName === 'link'` is always `false`, because
`node.nodeName` is Uppercase in specification. And the condition
`node.nodeName === 'LINK'` is unnecessary, because Fizz hoists tags when
it's `media` attribute is `"not all"`, whether it is a `link` or a
`style` (line 36):


https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetExternalRuntime.js#L30-L44


https://github.com/facebook/react/blob/18cbcbf783377c5a22277a63ae41af54504502e0/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineSource.js#L30-L44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gnoff gnoff gnoff approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@sweetliquid @facebook-github-bot @react-sizebot @rickhanlonii @gnoff
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.