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

Put common aliases in Map/Set instead of switch over strings #26551

Merged
merged 5 commits into from
Apr 4, 2023

Conversation

sebmarkbage
Copy link
Collaborator

This is a follow up to #26546

This is strictly a perf optimization since we know that switches over strings aren't optimally implemented in current engines. Basically they're a sequence of ifs.

As a result, we're better off putting the unusual cases in a Map and the very common cases in the beginning of the switch. We might be better off putting very common cases in explicit ifs - just in case the engine does optimize switches to a hash table which is potentially worse.

…rmance

Unfortunately VMs don't optimize this well enough yet.

Most special cases are still in the switch but now there are few enough
cases that it's not bad.
This ensures that when the look up is not optimized, we hit them early in
the if sequence. We might actually consider moving these to separate ifs
to ensure that even when the switch is optimized to a hash table, these
remain as ifs.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 4, 2023
@react-sizebot
Copy link

react-sizebot commented Apr 4, 2023

Comparing: eeabb73...f9665d5

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 = 166.41 kB 165.24 kB +0.04% 51.86 kB 51.88 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 167.99 kB 166.81 kB +0.05% 52.37 kB 52.40 kB
facebook-www/ReactDOM-prod.classic.js = 560.87 kB 555.76 kB = 98.53 kB 98.49 kB
facebook-www/ReactDOM-prod.modern.js = 544.72 kB 539.60 kB = 95.88 kB 95.83 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js = 63.39 kB 61.80 kB = 19.12 kB 19.03 kB
oss-experimental/react-dom/cjs/react-dom-static.node.production.min.js = 63.35 kB 61.76 kB = 19.14 kB 19.03 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.min.js = 63.17 kB 61.58 kB = 19.08 kB 18.97 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 63.07 kB 61.49 kB = 18.28 kB 18.25 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js = 63.01 kB 61.43 kB = 19.01 kB 18.91 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js = 62.99 kB 61.40 kB = 18.99 kB 18.88 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.min.js = 62.80 kB 61.21 kB = 18.96 kB 18.84 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.min.js = 62.77 kB 61.19 kB = 18.94 kB 18.82 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 62.70 kB 61.11 kB = 18.15 kB 18.12 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 62.68 kB 61.09 kB = 18.13 kB 18.10 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.min.js = 62.05 kB 60.46 kB = 18.28 kB 18.22 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js = 61.67 kB 60.09 kB = 18.16 kB 18.09 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js = 61.65 kB 60.06 kB = 18.14 kB 18.07 kB
oss-experimental/react-dom/umd/react-dom-server.browser.production.min.js = 59.32 kB 57.73 kB = 17.89 kB 17.82 kB
oss-experimental/react-dom/cjs/react-dom-static.edge.production.min.js = 59.21 kB 57.63 kB = 17.75 kB 17.64 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js = 59.15 kB 57.56 kB = 17.74 kB 17.64 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.production.min.js = 59.03 kB 57.44 kB = 17.69 kB 17.59 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js = 59.01 kB 57.42 kB = 17.76 kB 17.75 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js = 58.99 kB 57.40 kB = 17.74 kB 17.73 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js = 58.84 kB 57.26 kB = 17.66 kB 17.54 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js = 58.82 kB 57.23 kB = 17.64 kB 17.51 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 58.61 kB 57.02 kB = 16.99 kB 16.99 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 58.44 kB 56.85 kB = 16.81 kB 16.76 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 58.30 kB 56.71 kB = 16.90 kB 16.88 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 58.27 kB 56.68 kB = 16.88 kB 16.86 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 58.13 kB 56.54 kB = 16.71 kB 16.65 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 58.10 kB 56.52 kB = 16.69 kB 16.63 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js = 139.04 kB 133.21 kB = 25.63 kB 25.51 kB
facebook-www/ReactDOMServer-prod.classic.js = 137.74 kB 131.91 kB = 25.06 kB 24.96 kB
facebook-www/ReactDOMServer-prod.modern.js = 134.17 kB 128.34 kB = 24.35 kB 24.26 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-dom/cjs/react-dom.profiling.min.js = 177.61 kB 176.43 kB +0.01% 54.79 kB 54.80 kB
oss-stable/react-dom/cjs/react-dom.profiling.min.js = 176.03 kB 174.85 kB = 54.33 kB 54.31 kB
oss-experimental/react-dom/umd/react-dom.profiling.min.js = 176.87 kB 175.69 kB = 55.16 kB 55.12 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.min.js = 175.96 kB 174.78 kB = 54.31 kB 54.28 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.production.min.js = 174.20 kB 173.03 kB +0.04% 54.72 kB 54.74 kB
oss-stable/react-dom/umd/react-dom.profiling.min.js = 175.29 kB 174.11 kB = 54.66 kB 54.60 kB
oss-stable-semver/react-dom/umd/react-dom.profiling.min.js = 175.22 kB 174.04 kB = 54.63 kB 54.58 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 167.99 kB 166.81 kB +0.05% 52.37 kB 52.40 kB
oss-experimental/react-dom/umd/react-dom.production.min.js = 167.91 kB 166.72 kB = 52.86 kB 52.77 kB
oss-stable/react-dom/cjs/react-dom.production.min.js = 166.41 kB 165.24 kB +0.04% 51.86 kB 51.88 kB
oss-stable-semver/react-dom/cjs/react-dom.production.min.js = 166.34 kB 165.16 kB +0.04% 51.84 kB 51.86 kB
oss-stable/react-dom/umd/react-dom.production.min.js = 166.32 kB 165.14 kB = 52.34 kB 52.31 kB
oss-stable-semver/react-dom/umd/react-dom.production.min.js = 166.25 kB 165.07 kB = 52.31 kB 52.29 kB
facebook-www/ReactDOM-profiling.classic.js = 591.33 kB 586.22 kB = 103.08 kB 103.03 kB
facebook-www/ReactDOMTesting-prod.classic.js = 575.58 kB 570.47 kB = 102.21 kB 102.15 kB
facebook-www/ReactDOM-profiling.modern.js = 575.11 kB 570.00 kB = 100.37 kB 100.34 kB
facebook-www/ReactDOMTesting-prod.modern.js = 561.26 kB 556.14 kB = 100.05 kB 100.00 kB
facebook-www/ReactDOM-prod.classic.js = 560.87 kB 555.76 kB = 98.53 kB 98.49 kB
facebook-www/ReactDOM-prod.modern.js = 544.72 kB 539.60 kB = 95.88 kB 95.83 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js = 1,297.61 kB 1,283.13 kB = 284.26 kB 282.71 kB
oss-experimental/react-dom/cjs/react-dom.development.js = 1,279.50 kB 1,265.01 kB = 279.80 kB 278.23 kB
oss-stable/react-dom/cjs/react-dom.development.js = 1,268.57 kB 1,254.08 kB = 277.81 kB 276.23 kB
oss-stable-semver/react-dom/cjs/react-dom.development.js = 1,268.54 kB 1,254.06 kB = 277.78 kB 276.21 kB
oss-experimental/react-dom/umd/react-dom.development.js = 1,341.75 kB 1,326.34 kB = 282.66 kB 281.18 kB
oss-stable/react-dom/umd/react-dom.development.js = 1,330.22 kB 1,314.81 kB = 280.70 kB 279.17 kB
oss-stable-semver/react-dom/umd/react-dom.development.js = 1,330.19 kB 1,314.79 kB = 280.68 kB 279.15 kB
facebook-www/ReactDOMServer-dev.classic.js = 374.32 kB 369.58 kB = 81.07 kB 80.80 kB
facebook-www/ReactDOMTesting-dev.classic.js = 1,444.15 kB 1,425.49 kB = 310.28 kB 308.73 kB
facebook-www/ReactDOMServer-dev.modern.js = 366.90 kB 362.15 kB = 79.46 kB 79.20 kB
facebook-www/ReactDOM-dev.classic.js = 1,425.75 kB 1,407.09 kB = 306.03 kB 304.54 kB
facebook-www/ReactDOMServerStreaming-dev.modern.js = 361.80 kB 357.06 kB = 78.19 kB 77.91 kB
facebook-www/ReactDOMTesting-dev.modern.js = 1,416.41 kB 1,397.75 kB = 304.96 kB 303.47 kB
facebook-www/ReactDOM-dev.modern.js = 1,398.01 kB 1,379.35 kB = 300.45 kB 298.94 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js = 360.35 kB 355.33 kB = 79.45 kB 79.19 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js = 359.12 kB 354.11 kB = 79.05 kB 78.79 kB
oss-experimental/react-dom/cjs/react-dom-static.node.development.js = 359.08 kB 354.07 kB = 79.13 kB 78.87 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js = 358.59 kB 353.57 kB = 78.98 kB 78.72 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.development.js = 358.32 kB 353.30 kB = 78.91 kB 78.64 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.development.js = 358.30 kB 353.28 kB = 78.89 kB 78.62 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.development.js = 357.89 kB 352.88 kB = 79.09 kB 78.84 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js = 357.75 kB 352.74 kB = 79.05 kB 78.79 kB
oss-experimental/react-dom/cjs/react-dom-static.edge.development.js = 357.20 kB 352.18 kB = 78.91 kB 78.65 kB
oss-stable/react-dom/cjs/react-dom-server.node.development.js = 357.10 kB 352.08 kB = 78.52 kB 78.25 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.development.js = 357.07 kB 352.06 kB = 78.50 kB 78.23 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.development.js = 357.06 kB 352.04 kB = 78.86 kB 78.61 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.development.js = 356.56 kB 351.55 kB = 78.45 kB 78.17 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.development.js = 356.54 kB 351.52 kB = 78.43 kB 78.15 kB
oss-stable/react-dom/cjs/react-dom-server.edge.development.js = 355.86 kB 350.85 kB = 78.57 kB 78.30 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.development.js = 355.84 kB 350.82 kB = 78.54 kB 78.28 kB
oss-stable/react-dom/cjs/react-dom-server.browser.development.js = 355.73 kB 350.71 kB = 78.52 kB 78.25 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.development.js = 355.70 kB 350.69 kB = 78.50 kB 78.23 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js = 355.58 kB 350.56 kB = 78.38 kB 78.11 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js = 353.55 kB 348.53 kB = 77.85 kB 77.57 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js = 353.53 kB 348.51 kB = 77.82 kB 77.55 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.development.js = 375.84 kB 370.27 kB = 79.82 kB 79.52 kB
oss-experimental/react-dom/umd/react-dom-server.browser.development.js = 374.98 kB 369.41 kB = 79.91 kB 79.62 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.development.js = 373.70 kB 368.13 kB = 79.31 kB 79.02 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.development.js = 373.68 kB 368.11 kB = 79.29 kB 79.00 kB
oss-stable/react-dom/umd/react-dom-server.browser.development.js = 372.85 kB 367.27 kB = 79.40 kB 79.10 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.development.js = 372.82 kB 367.25 kB = 79.39 kB 79.08 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js = 63.39 kB 61.80 kB = 19.12 kB 19.03 kB
oss-experimental/react-dom/cjs/react-dom-static.node.production.min.js = 63.35 kB 61.76 kB = 19.14 kB 19.03 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.min.js = 63.17 kB 61.58 kB = 19.08 kB 18.97 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 63.07 kB 61.49 kB = 18.28 kB 18.25 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js = 63.01 kB 61.43 kB = 19.01 kB 18.91 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js = 62.99 kB 61.40 kB = 18.99 kB 18.88 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.min.js = 62.80 kB 61.21 kB = 18.96 kB 18.84 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.min.js = 62.77 kB 61.19 kB = 18.94 kB 18.82 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 62.70 kB 61.11 kB = 18.15 kB 18.12 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 62.68 kB 61.09 kB = 18.13 kB 18.10 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.min.js = 62.05 kB 60.46 kB = 18.28 kB 18.22 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js = 61.67 kB 60.09 kB = 18.16 kB 18.09 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js = 61.65 kB 60.06 kB = 18.14 kB 18.07 kB
oss-experimental/react-dom/umd/react-dom-server.browser.production.min.js = 59.32 kB 57.73 kB = 17.89 kB 17.82 kB
oss-experimental/react-dom/cjs/react-dom-static.edge.production.min.js = 59.21 kB 57.63 kB = 17.75 kB 17.64 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js = 59.15 kB 57.56 kB = 17.74 kB 17.64 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.production.min.js = 59.03 kB 57.44 kB = 17.69 kB 17.59 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js = 59.01 kB 57.42 kB = 17.76 kB 17.75 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js = 58.99 kB 57.40 kB = 17.74 kB 17.73 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js = 58.84 kB 57.26 kB = 17.66 kB 17.54 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js = 58.82 kB 57.23 kB = 17.64 kB 17.51 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 58.61 kB 57.02 kB = 16.99 kB 16.99 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 58.44 kB 56.85 kB = 16.81 kB 16.76 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 58.30 kB 56.71 kB = 16.90 kB 16.88 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 58.27 kB 56.68 kB = 16.88 kB 16.86 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 58.13 kB 56.54 kB = 16.71 kB 16.65 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 58.10 kB 56.52 kB = 16.69 kB 16.63 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js = 139.04 kB 133.21 kB = 25.63 kB 25.51 kB
facebook-www/ReactDOMServer-prod.classic.js = 137.74 kB 131.91 kB = 25.06 kB 24.96 kB
facebook-www/ReactDOMServer-prod.modern.js = 134.17 kB 128.34 kB = 24.35 kB 24.26 kB

Generated by 🚫 dangerJS against f9665d5

hydrateAttribute(
domElement,
propKey,
'fill-opacity',
'x-height',
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you mean to have x-height here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea, this is just a weird diff view. It's part of the case above.

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm? in ReactDOMComponent I see xHeight as the only call to hydrateAttribute() other than className tabIndex and the namespaced ones

case 'a':
case 'g':
case 'p':
case 'li': {
Copy link
Collaborator

Choose a reason for hiding this comment

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

https://almanac.httparchive.org/en/2021/markup#top-elements
looks like i and ul are also popular… wonder if it's worth including them? and moving the img/link special case up? and maybe adding meta? (does float go through this path?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess they're less popular. Didn't show up in my testing. It's interesting that groupings like ul and tbody or even tr inherently are less common than the n items below them.

Float doesn't go through this path.

I tried to keep things somewhat grouped together in groups that make sense. Could maybe group all void elements but I think we're going to end up special casing img soon for suspensey images so then we can move it up.

Co-authored-by: Sophie Alpert <git@sophiebits.com>
@sebmarkbage sebmarkbage merged commit c155796 into facebook:main Apr 4, 2023
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Apr 13, 2023
Summary:
This sync includes the following changes:
- **[58742c21b](facebook/react@58742c21b )**: Delete unused `eventTimes` Fiber field ([#26599](facebook/react#26599)) //<Andrew Clark>//
- **[0b931f90e](facebook/react@0b931f90e )**: Remove JND delay for non-transition updates ([#26597](facebook/react#26597)) //<Andrew Clark>//
- **[ac43bf687](facebook/react@ac43bf687 )**: Move validation of text nesting into ReactDOMComponent  ([#26594](facebook/react#26594)) //<Sebastian Markbåge>//
- **[ca41adb8c](facebook/react@ca41adb8c )**: Diff properties in the commit phase instead of generating an update payload ([#26583](facebook/react#26583)) //<Sebastian Markbåge>//
- **[dd0619b2e](facebook/react@dd0619b2e )**: rename $$$hostConfig to $$$config ([#26593](facebook/react#26593)) //<Josh Story>//
- **[b55d31955](facebook/react@b55d31955 )**: Rename HostConfig files to FiberConfig to clarify they are configs fo… ([#26592](facebook/react#26592)) //<Josh Story>//
- **[ffb8eaca5](facebook/react@ffb8eaca5 )**: Rename ReactServerFormatConfig to ReactFizzConfig ([#26591](facebook/react#26591)) //<Josh Story>//
- **[f4f873f62](facebook/react@f4f873f62 )**: Implements wiring for Flight to have it's own "HostConfig" ([#26590](facebook/react#26590)) //<Josh Story>//
- **[44db16afc](facebook/react@44db16afc )**: Normalize ReactFlightServerConfig and related files ([#26589](facebook/react#26589)) //<Josh Story>//
- **[fec97ecbc](facebook/react@fec97ecbc )**: act: Move didScheduleLegacyUpdate to ensureRootIsScheduled ([#26552](facebook/react#26552)) //<Andrew Clark>//
- **[9a9da7721](facebook/react@9a9da7721 )**: Don't update textarea defaultValue and input checked unnecessarily ([#26580](facebook/react#26580)) //<Sebastian Markbåge>//
- **[e5146cb52](facebook/react@e5146cb52 )**: Refactor some controlled component stuff ([#26573](facebook/react#26573)) //<Sebastian Markbåge>//
- **[657698e48](facebook/react@657698e48 )**: [Tests] `waitForThrow` should diff strings ([#26568](facebook/react#26568)) //<Josh Story>//
- **[85bb7b685](facebook/react@85bb7b685 )**: Fix: Move `destroy` field to shared instance object ([#26561](facebook/react#26561)) //<Andrew Clark>//
- **[9cfba0f6e](facebook/react@9cfba0f6e )**: Clean up discrete event replaying ([#26558](facebook/react#26558)) //<Sebastian Markbåge>//
- **[790ebc962](facebook/react@790ebc962 )**: Remove no-fallthrough lint suppressions ([#26553](facebook/react#26553)) //<Sophie Alpert>//
- **[c15579631](facebook/react@c15579631 )**: Put common aliases in Map/Set instead of switch over strings ([#26551](facebook/react#26551)) //<Sebastian Markbåge>//
- **[d5fd60f7e](facebook/react@d5fd60f7e )**: Remove findInstanceBlockingEvent unused parameters ([#26534](facebook/react#26534)) //<Mohammad Ghorbani>//
- **[eeabb7312](facebook/react@eeabb7312 )**: Refactor DOM Bindings Completely Off of DOMProperty Meta Programming ([#26546](facebook/react#26546)) //<Sebastian Markbåge>//
- **[da94e8b24](facebook/react@da94e8b24 )**: Revert "Cleanup enableSyncDefaultUpdate flag ([#26236](facebook/react#26236))" ([#26528](facebook/react#26528)) //<Jan Kassens>//
- **[0700dd50b](facebook/react@0700dd50b )**: Implement public instances for text nodes in Fabric ([#26516](facebook/react#26516)) //<Rubén Norte>//
- **[4a1cc2ddd](facebook/react@4a1cc2ddd )**: Fix logic around attribute seralization ([#26526](facebook/react#26526)) //<Josh Story>//
- **[7329ea81c](facebook/react@7329ea81c )**: Fix suspense replaying forward refs ([#26535](facebook/react#26535)) //<Hans Otto Wirtz>//
- **[0ae348018](facebook/react@0ae348018 )**: [Float] Suspend unstyled content for up to 1 minute ([#26532](facebook/react#26532)) //<Andrew Clark>//
- **[888874673](facebook/react@888874673 )**: Allow transitions to interrupt Suspensey commits ([#26531](facebook/react#26531)) //<Andrew Clark>//
- **[09c8d2563](facebook/react@09c8d2563 )**: Move update scheduling to microtask ([#26512](facebook/react#26512)) //<Andrew Clark>//
- **[8310854ce](facebook/react@8310854ce )**: Clean up enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay ([#26521](facebook/react#26521)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions ca01f35...58742c2

jest_e2e[run_all_tests]
bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44872333

fbshipit-source-id: 0695e86645955aac7a20afdaf3ed02ad33592f5c
kassens added a commit to kassens/react that referenced this pull request Apr 17, 2023
kassens added a commit that referenced this pull request Apr 20, 2023
github-actions bot pushed a commit that referenced this pull request Apr 20, 2023
kassens added a commit that referenced this pull request Apr 20, 2023
kassens added a commit that referenced this pull request Apr 20, 2023
jeongshin pushed a commit to jeongshin/react-native that referenced this pull request May 7, 2023
Summary:
This sync includes the following changes:
- **[58742c21b](facebook/react@58742c21b )**: Delete unused `eventTimes` Fiber field ([facebook#26599](facebook/react#26599)) //<Andrew Clark>//
- **[0b931f90e](facebook/react@0b931f90e )**: Remove JND delay for non-transition updates ([facebook#26597](facebook/react#26597)) //<Andrew Clark>//
- **[ac43bf687](facebook/react@ac43bf687 )**: Move validation of text nesting into ReactDOMComponent  ([facebook#26594](facebook/react#26594)) //<Sebastian Markbåge>//
- **[ca41adb8c](facebook/react@ca41adb8c )**: Diff properties in the commit phase instead of generating an update payload ([facebook#26583](facebook/react#26583)) //<Sebastian Markbåge>//
- **[dd0619b2e](facebook/react@dd0619b2e )**: rename $$$hostConfig to $$$config ([facebook#26593](facebook/react#26593)) //<Josh Story>//
- **[b55d31955](facebook/react@b55d31955 )**: Rename HostConfig files to FiberConfig to clarify they are configs fo… ([facebook#26592](facebook/react#26592)) //<Josh Story>//
- **[ffb8eaca5](facebook/react@ffb8eaca5 )**: Rename ReactServerFormatConfig to ReactFizzConfig ([facebook#26591](facebook/react#26591)) //<Josh Story>//
- **[f4f873f62](facebook/react@f4f873f62 )**: Implements wiring for Flight to have it's own "HostConfig" ([facebook#26590](facebook/react#26590)) //<Josh Story>//
- **[44db16afc](facebook/react@44db16afc )**: Normalize ReactFlightServerConfig and related files ([facebook#26589](facebook/react#26589)) //<Josh Story>//
- **[fec97ecbc](facebook/react@fec97ecbc )**: act: Move didScheduleLegacyUpdate to ensureRootIsScheduled ([facebook#26552](facebook/react#26552)) //<Andrew Clark>//
- **[9a9da7721](facebook/react@9a9da7721 )**: Don't update textarea defaultValue and input checked unnecessarily ([facebook#26580](facebook/react#26580)) //<Sebastian Markbåge>//
- **[e5146cb52](facebook/react@e5146cb52 )**: Refactor some controlled component stuff ([facebook#26573](facebook/react#26573)) //<Sebastian Markbåge>//
- **[657698e48](facebook/react@657698e48 )**: [Tests] `waitForThrow` should diff strings ([facebook#26568](facebook/react#26568)) //<Josh Story>//
- **[85bb7b685](facebook/react@85bb7b685 )**: Fix: Move `destroy` field to shared instance object ([facebook#26561](facebook/react#26561)) //<Andrew Clark>//
- **[9cfba0f6e](facebook/react@9cfba0f6e )**: Clean up discrete event replaying ([facebook#26558](facebook/react#26558)) //<Sebastian Markbåge>//
- **[790ebc962](facebook/react@790ebc962 )**: Remove no-fallthrough lint suppressions ([facebook#26553](facebook/react#26553)) //<Sophie Alpert>//
- **[c15579631](facebook/react@c15579631 )**: Put common aliases in Map/Set instead of switch over strings ([facebook#26551](facebook/react#26551)) //<Sebastian Markbåge>//
- **[d5fd60f7e](facebook/react@d5fd60f7e )**: Remove findInstanceBlockingEvent unused parameters ([facebook#26534](facebook/react#26534)) //<Mohammad Ghorbani>//
- **[eeabb7312](facebook/react@eeabb7312 )**: Refactor DOM Bindings Completely Off of DOMProperty Meta Programming ([facebook#26546](facebook/react#26546)) //<Sebastian Markbåge>//
- **[da94e8b24](facebook/react@da94e8b24 )**: Revert "Cleanup enableSyncDefaultUpdate flag ([facebook#26236](facebook/react#26236))" ([facebook#26528](facebook/react#26528)) //<Jan Kassens>//
- **[0700dd50b](facebook/react@0700dd50b )**: Implement public instances for text nodes in Fabric ([facebook#26516](facebook/react#26516)) //<Rubén Norte>//
- **[4a1cc2ddd](facebook/react@4a1cc2ddd )**: Fix logic around attribute seralization ([facebook#26526](facebook/react#26526)) //<Josh Story>//
- **[7329ea81c](facebook/react@7329ea81c )**: Fix suspense replaying forward refs ([facebook#26535](facebook/react#26535)) //<Hans Otto Wirtz>//
- **[0ae348018](facebook/react@0ae348018 )**: [Float] Suspend unstyled content for up to 1 minute ([facebook#26532](facebook/react#26532)) //<Andrew Clark>//
- **[888874673](facebook/react@888874673 )**: Allow transitions to interrupt Suspensey commits ([facebook#26531](facebook/react#26531)) //<Andrew Clark>//
- **[09c8d2563](facebook/react@09c8d2563 )**: Move update scheduling to microtask ([facebook#26512](facebook/react#26512)) //<Andrew Clark>//
- **[8310854ce](facebook/react@8310854ce )**: Clean up enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay ([facebook#26521](facebook/react#26521)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions ca01f35...58742c2

jest_e2e[run_all_tests]
bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44872333

fbshipit-source-id: 0695e86645955aac7a20afdaf3ed02ad33592f5c
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
This sync includes the following changes:
- **[58742c21b](facebook/react@58742c21b )**: Delete unused `eventTimes` Fiber field ([facebook#26599](facebook/react#26599)) //<Andrew Clark>//
- **[0b931f90e](facebook/react@0b931f90e )**: Remove JND delay for non-transition updates ([facebook#26597](facebook/react#26597)) //<Andrew Clark>//
- **[ac43bf687](facebook/react@ac43bf687 )**: Move validation of text nesting into ReactDOMComponent  ([facebook#26594](facebook/react#26594)) //<Sebastian Markbåge>//
- **[ca41adb8c](facebook/react@ca41adb8c )**: Diff properties in the commit phase instead of generating an update payload ([facebook#26583](facebook/react#26583)) //<Sebastian Markbåge>//
- **[dd0619b2e](facebook/react@dd0619b2e )**: rename $$$hostConfig to $$$config ([facebook#26593](facebook/react#26593)) //<Josh Story>//
- **[b55d31955](facebook/react@b55d31955 )**: Rename HostConfig files to FiberConfig to clarify they are configs fo… ([facebook#26592](facebook/react#26592)) //<Josh Story>//
- **[ffb8eaca5](facebook/react@ffb8eaca5 )**: Rename ReactServerFormatConfig to ReactFizzConfig ([facebook#26591](facebook/react#26591)) //<Josh Story>//
- **[f4f873f62](facebook/react@f4f873f62 )**: Implements wiring for Flight to have it's own "HostConfig" ([facebook#26590](facebook/react#26590)) //<Josh Story>//
- **[44db16afc](facebook/react@44db16afc )**: Normalize ReactFlightServerConfig and related files ([facebook#26589](facebook/react#26589)) //<Josh Story>//
- **[fec97ecbc](facebook/react@fec97ecbc )**: act: Move didScheduleLegacyUpdate to ensureRootIsScheduled ([facebook#26552](facebook/react#26552)) //<Andrew Clark>//
- **[9a9da7721](facebook/react@9a9da7721 )**: Don't update textarea defaultValue and input checked unnecessarily ([facebook#26580](facebook/react#26580)) //<Sebastian Markbåge>//
- **[e5146cb52](facebook/react@e5146cb52 )**: Refactor some controlled component stuff ([facebook#26573](facebook/react#26573)) //<Sebastian Markbåge>//
- **[657698e48](facebook/react@657698e48 )**: [Tests] `waitForThrow` should diff strings ([facebook#26568](facebook/react#26568)) //<Josh Story>//
- **[85bb7b685](facebook/react@85bb7b685 )**: Fix: Move `destroy` field to shared instance object ([facebook#26561](facebook/react#26561)) //<Andrew Clark>//
- **[9cfba0f6e](facebook/react@9cfba0f6e )**: Clean up discrete event replaying ([facebook#26558](facebook/react#26558)) //<Sebastian Markbåge>//
- **[790ebc962](facebook/react@790ebc962 )**: Remove no-fallthrough lint suppressions ([facebook#26553](facebook/react#26553)) //<Sophie Alpert>//
- **[c15579631](facebook/react@c15579631 )**: Put common aliases in Map/Set instead of switch over strings ([facebook#26551](facebook/react#26551)) //<Sebastian Markbåge>//
- **[d5fd60f7e](facebook/react@d5fd60f7e )**: Remove findInstanceBlockingEvent unused parameters ([facebook#26534](facebook/react#26534)) //<Mohammad Ghorbani>//
- **[eeabb7312](facebook/react@eeabb7312 )**: Refactor DOM Bindings Completely Off of DOMProperty Meta Programming ([facebook#26546](facebook/react#26546)) //<Sebastian Markbåge>//
- **[da94e8b24](facebook/react@da94e8b24 )**: Revert "Cleanup enableSyncDefaultUpdate flag ([facebook#26236](facebook/react#26236))" ([facebook#26528](facebook/react#26528)) //<Jan Kassens>//
- **[0700dd50b](facebook/react@0700dd50b )**: Implement public instances for text nodes in Fabric ([facebook#26516](facebook/react#26516)) //<Rubén Norte>//
- **[4a1cc2ddd](facebook/react@4a1cc2ddd )**: Fix logic around attribute seralization ([facebook#26526](facebook/react#26526)) //<Josh Story>//
- **[7329ea81c](facebook/react@7329ea81c )**: Fix suspense replaying forward refs ([facebook#26535](facebook/react#26535)) //<Hans Otto Wirtz>//
- **[0ae348018](facebook/react@0ae348018 )**: [Float] Suspend unstyled content for up to 1 minute ([facebook#26532](facebook/react#26532)) //<Andrew Clark>//
- **[888874673](facebook/react@888874673 )**: Allow transitions to interrupt Suspensey commits ([facebook#26531](facebook/react#26531)) //<Andrew Clark>//
- **[09c8d2563](facebook/react@09c8d2563 )**: Move update scheduling to microtask ([facebook#26512](facebook/react#26512)) //<Andrew Clark>//
- **[8310854ce](facebook/react@8310854ce )**: Clean up enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay ([facebook#26521](facebook/react#26521)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions ca01f35...58742c2

jest_e2e[run_all_tests]
bypass-github-export-checks

Reviewed By: sammy-SC

Differential Revision: D44872333

fbshipit-source-id: 0695e86645955aac7a20afdaf3ed02ad33592f5c
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
…k#26551)

This is a follow up to facebook#26546

This is strictly a perf optimization since we know that switches over
strings aren't optimally implemented in current engines. Basically
they're a sequence of ifs.

As a result, we're better off putting the unusual cases in a Map and the
very common cases in the beginning of the switch. We might be better off
putting very common cases in explicit ifs - just in case the engine does
optimize switches to a hash table which is potentially worse.

---------

Co-authored-by: Sophie Alpert <git@sophiebits.com>
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