Skip to content

Use underscore instead of « » for useId algorithm #33422

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

Merged
merged 3 commits into from
Jun 3, 2025

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Jun 3, 2025

Alternative to #33421. The difference is that this also adds an underscore between the "R" and the ID.

The reason we wanted to use special characters is because we use the full spectrum of A-Z 0-9 in our ID generation so we can basically collide with any common word (or anyone using a similar algorithm, base64 or even base16). It's a little less likely that someone would put _R_ specifically unless you generate like two IDs separated by underscore.

9w2ogt

@sebmarkbage sebmarkbage requested a review from eps1lon June 3, 2025 14:37
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jun 3, 2025
@react-sizebot
Copy link

react-sizebot commented Jun 3, 2025

Comparing: 2b4064e...7d3cefc

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 = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 529.84 kB 529.82 kB = 93.52 kB 93.51 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 = 650.94 kB 650.91 kB = 114.65 kB 114.63 kB
facebook-www/ReactDOM-prod.classic.js = 675.89 kB 675.86 kB = 118.93 kB 118.91 kB
facebook-www/ReactDOM-prod.modern.js = 666.17 kB 666.14 kB = 117.32 kB 117.30 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-noop-renderer/cjs/react-noop-renderer-server.development.js = 7.95 kB 7.93 kB = 1.67 kB 1.67 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-server.development.js = 7.95 kB 7.93 kB = 1.67 kB 1.67 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-server.development.js = 7.95 kB 7.93 kB = 1.67 kB 1.67 kB
oss-experimental/react-server/cjs/react-server.development.js = 210.48 kB 210.04 kB = 36.48 kB 36.40 kB
oss-stable-semver/react-server/cjs/react-server.development.js = 193.36 kB 192.92 kB = 34.29 kB 34.21 kB
oss-stable/react-server/cjs/react-server.development.js = 193.36 kB 192.92 kB = 34.29 kB 34.21 kB

Generated by 🚫 dangerJS against 7d3cefc

Copy link
Collaborator

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineCodeStrings.js has the lowercase unicode delimiters e.g. \u00ab

@sebmarkbage sebmarkbage merged commit 1ae0a84 into facebook:main Jun 3, 2025
240 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 3, 2025
Alternative to #33421. The difference is that this also adds an
underscore between the "R" and the ID.

The reason we wanted to use special characters is because we use the
full spectrum of A-Z 0-9 in our ID generation so we can basically
collide with any common word (or anyone using a similar algorithm,
base64 or even base16). It's a little less likely that someone would put
`_R_` specifically unless you generate like two IDs separated by
underscore.

![9w2ogt](https://github.com/user-attachments/assets/21b2d2ac-1a3a-4657-ba0b-1616e49dfdee)

DiffTrain build for [1ae0a84](1ae0a84)
github-actions bot pushed a commit that referenced this pull request Jun 3, 2025
Alternative to #33421. The difference is that this also adds an
underscore between the "R" and the ID.

The reason we wanted to use special characters is because we use the
full spectrum of A-Z 0-9 in our ID generation so we can basically
collide with any common word (or anyone using a similar algorithm,
base64 or even base16). It's a little less likely that someone would put
`_R_` specifically unless you generate like two IDs separated by
underscore.

![9w2ogt](https://github.com/user-attachments/assets/21b2d2ac-1a3a-4657-ba0b-1616e49dfdee)

DiffTrain build for [1ae0a84](1ae0a84)
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