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

Refactor ReactDOMComponent to use flatter property operations #26433

Merged
merged 6 commits into from
Mar 21, 2023

Conversation

sebmarkbage
Copy link
Collaborator

This is in line with the refactor I already did on Fizz earlier and brings Fiber up to a similar structure.

We end up with a lot of extra checks due the extra abstractions we use to check the various properties. This uses a flatter and more inline model which makes it easier to see what each property does. The tradeoff is that a change might need changes in more places.

The general structure is that there's a switch for tag first, then a switch for each attribute special case, then a switch for the value. So it's easy to follow where each scenario will end up and there shouldn't be any unnecessary code executed along the way.

My goal is to eventually get rid of the meta-programming in DOMProperty and CSSProperty but I'm leaving that in for now - in line with Fizz.

My next step is moving around things a bit in the diff/commit phases. This is the first step to more refactors for perf and size, but also because I'm adding more special cases so I need to have a flatter structure that I can reason about for those special cases.

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

react-sizebot commented Mar 20, 2023

Comparing: 0131d0c...5396f17

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 +0.76% 158.03 kB 159.24 kB +0.16% 50.38 kB 50.46 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.85% 159.62 kB 160.98 kB +0.13% 50.91 kB 50.97 kB
facebook-www/ReactDOM-prod.classic.js +0.37% 544.06 kB 546.07 kB = 96.80 kB 96.78 kB
facebook-www/ReactDOM-prod.modern.js +0.38% 527.77 kB 529.78 kB = 94.33 kB 94.32 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/umd/react-dom.development.js +0.88% 1,280.61 kB 1,291.81 kB = 274.53 kB 274.54 kB
oss-experimental/react-dom/umd/react-dom.production.min.js +0.85% 159.57 kB 160.94 kB +0.18% 51.19 kB 51.28 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.85% 159.62 kB 160.98 kB +0.13% 50.91 kB 50.97 kB
oss-experimental/react-dom/cjs/react-dom.development.js +0.85% 1,221.92 kB 1,232.32 kB = 271.72 kB 271.72 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js +0.84% 1,240.03 kB 1,250.43 kB = 276.12 kB 276.08 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.production.min.js +0.82% 165.83 kB 167.19 kB +0.15% 53.26 kB 53.34 kB
oss-experimental/react-dom/umd/react-dom.profiling.min.js +0.81% 168.54 kB 169.90 kB +0.15% 53.52 kB 53.60 kB
oss-stable-semver/react-dom/umd/react-dom.development.js +0.81% 1,269.99 kB 1,280.23 kB +0.01% 272.63 kB 272.66 kB
oss-stable/react-dom/umd/react-dom.development.js +0.81% 1,270.02 kB 1,280.25 kB +0.01% 272.66 kB 272.69 kB
oss-experimental/react-dom/cjs/react-dom.profiling.min.js +0.80% 169.24 kB 170.60 kB +0.16% 53.33 kB 53.41 kB
oss-stable-semver/react-dom/cjs/react-dom.development.js +0.78% 1,211.83 kB 1,221.35 kB = 269.83 kB 269.83 kB
oss-stable/react-dom/cjs/react-dom.development.js +0.78% 1,211.86 kB 1,221.37 kB = 269.85 kB 269.85 kB
facebook-www/ReactDOM-dev.modern.js +0.78% 1,341.85 kB 1,352.33 kB +0.03% 292.69 kB 292.79 kB
facebook-www/ReactDOMTesting-dev.modern.js +0.77% 1,360.25 kB 1,370.73 kB +0.02% 297.06 kB 297.14 kB
oss-stable-semver/react-dom/umd/react-dom.production.min.js +0.77% 157.91 kB 159.12 kB +0.18% 50.60 kB 50.70 kB
facebook-www/ReactDOM-dev.classic.js +0.77% 1,369.46 kB 1,379.95 kB = 297.95 kB 297.96 kB
oss-stable/react-dom/umd/react-dom.production.min.js +0.77% 157.98 kB 159.19 kB +0.18% 50.63 kB 50.72 kB
oss-stable-semver/react-dom/cjs/react-dom.production.min.js +0.76% 157.96 kB 159.17 kB +0.16% 50.36 kB 50.44 kB
oss-stable/react-dom/cjs/react-dom.production.min.js +0.76% 158.03 kB 159.24 kB +0.16% 50.38 kB 50.46 kB
facebook-www/ReactDOMTesting-dev.classic.js +0.76% 1,387.95 kB 1,398.43 kB = 302.13 kB 302.11 kB
oss-stable-semver/react-dom/umd/react-dom.profiling.min.js +0.72% 166.88 kB 168.09 kB +0.24% 52.96 kB 53.09 kB
oss-stable/react-dom/umd/react-dom.profiling.min.js +0.72% 166.95 kB 168.16 kB +0.24% 52.98 kB 53.11 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.min.js +0.72% 167.58 kB 168.78 kB +0.11% 52.82 kB 52.88 kB
oss-stable/react-dom/cjs/react-dom.profiling.min.js +0.72% 167.65 kB 168.86 kB +0.09% 52.85 kB 52.90 kB
facebook-www/ReactDOM-prod.modern.js +0.38% 527.77 kB 529.78 kB = 94.33 kB 94.32 kB
facebook-www/ReactDOM-prod.classic.js +0.37% 544.06 kB 546.07 kB = 96.80 kB 96.78 kB
facebook-www/ReactDOMTesting-prod.modern.js +0.37% 544.31 kB 546.32 kB = 98.35 kB 98.34 kB
facebook-www/ReactDOM-profiling.modern.js +0.36% 558.06 kB 560.09 kB = 98.84 kB 98.84 kB
facebook-www/ReactDOMTesting-prod.classic.js +0.36% 558.62 kB 560.65 kB = 100.31 kB 100.31 kB
facebook-www/ReactDOM-profiling.classic.js +0.35% 574.41 kB 576.42 kB = 101.33 kB 101.30 kB
facebook-www/ReactDOMServerStreaming-prod.modern.js = 133.92 kB 133.53 kB = 25.59 kB 25.51 kB
facebook-www/ReactDOMServer-dev.classic.js = 373.73 kB 372.64 kB = 81.66 kB 81.43 kB
facebook-www/ReactDOMServer-prod.classic.js = 132.55 kB 132.16 kB = 25.01 kB 24.92 kB
facebook-www/ReactDOMServer-dev.modern.js = 366.33 kB 365.23 kB = 80.05 kB 79.82 kB
facebook-www/ReactDOMServer-prod.modern.js = 128.98 kB 128.59 kB = 24.31 kB 24.23 kB
facebook-www/ReactDOMServerStreaming-dev.modern.js = 361.25 kB 360.16 kB = 78.77 kB 78.53 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.development.js = 373.84 kB 372.69 kB = 80.45 kB 80.19 kB
oss-experimental/react-dom/umd/react-dom-server.browser.development.js = 372.97 kB 371.82 kB = 80.52 kB 80.26 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js = 358.92 kB 357.81 kB = 80.14 kB 79.88 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js = 357.61 kB 356.50 kB = 79.69 kB 79.43 kB
oss-experimental/react-dom/cjs/react-dom-static.node.development.js = 357.57 kB 356.46 kB = 79.77 kB 79.51 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js = 357.07 kB 355.97 kB = 79.64 kB 79.38 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.development.js = 356.36 kB 355.25 kB = 79.74 kB 79.48 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js = 356.22 kB 355.12 kB = 79.69 kB 79.43 kB
oss-experimental/react-dom/cjs/react-dom-static.edge.development.js = 355.67 kB 354.56 kB = 79.55 kB 79.29 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.development.js = 355.53 kB 354.42 kB = 79.51 kB 79.24 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js = 354.05 kB 352.94 kB = 79.04 kB 78.78 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.development.js = 371.75 kB 370.54 kB = 79.93 kB 79.67 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.development.js = 371.73 kB 370.52 kB = 79.91 kB 79.65 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.development.js = 356.93 kB 355.77 kB = 79.58 kB 79.32 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.development.js = 356.91 kB 355.75 kB = 79.56 kB 79.30 kB
oss-stable/react-dom/umd/react-dom-server.browser.development.js = 370.88 kB 369.67 kB = 80.00 kB 79.75 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.development.js = 370.86 kB 369.65 kB = 79.98 kB 79.72 kB
oss-stable/react-dom/cjs/react-dom-server.node.development.js = 355.62 kB 354.46 kB = 79.13 kB 78.87 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.development.js = 355.60 kB 354.44 kB = 79.11 kB 78.85 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.development.js = 355.09 kB 353.93 kB = 79.08 kB 78.83 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.development.js = 355.06 kB 353.90 kB = 79.07 kB 78.80 kB
oss-stable/react-dom/cjs/react-dom-server.edge.development.js = 354.38 kB 353.22 kB = 79.18 kB 78.92 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.development.js = 354.35 kB 353.19 kB = 79.16 kB 78.90 kB
oss-stable/react-dom/cjs/react-dom-server.browser.development.js = 354.24 kB 353.08 kB = 79.13 kB 78.87 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.development.js = 354.21 kB 353.05 kB = 79.11 kB 78.85 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js = 352.06 kB 350.90 kB = 78.48 kB 78.21 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js = 352.04 kB 350.88 kB = 78.46 kB 78.19 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js = 60.30 kB 60.10 kB = 18.68 kB 18.65 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js = 60.27 kB 60.07 kB = 18.66 kB 18.63 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.min.js = 60.04 kB 59.84 kB = 18.62 kB 18.59 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.min.js = 60.01 kB 59.81 kB = 18.60 kB 18.57 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 59.96 kB 59.76 kB = 17.93 kB 17.90 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 59.93 kB 59.73 kB = 17.91 kB 17.88 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js = 58.93 kB 58.73 kB = 17.87 kB 17.84 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js = 58.91 kB 58.71 kB = 17.85 kB 17.82 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js = 56.08 kB 55.88 kB = 17.32 kB 17.29 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js = 56.06 kB 55.86 kB = 17.30 kB 17.26 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js = 56.24 kB 56.04 kB = 17.59 kB 17.56 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js = 56.21 kB 56.01 kB = 17.57 kB 17.54 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 55.54 kB 55.34 kB = 16.74 kB 16.70 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 55.51 kB 55.31 kB = 16.72 kB 16.68 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 55.38 kB 55.18 kB = 16.45 kB 16.42 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 55.36 kB 55.16 kB = 16.43 kB 16.40 kB
oss-experimental/react-dom/cjs/react-dom-server.node.production.min.js = 60.73 kB 60.49 kB = 18.84 kB 18.78 kB
oss-experimental/react-dom/cjs/react-dom-static.node.production.min.js = 60.69 kB 60.45 kB = 18.82 kB 18.78 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.production.min.js = 60.47 kB 60.23 kB = 18.77 kB 18.72 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 60.39 kB 60.15 kB = 18.09 kB 18.04 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.production.min.js = 59.36 kB 59.12 kB = 18.03 kB 17.98 kB
oss-experimental/react-dom/cjs/react-dom-static.edge.production.min.js = 56.51 kB 56.27 kB = 17.45 kB 17.40 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.production.min.js = 56.45 kB 56.21 kB = 17.45 kB 17.39 kB
oss-experimental/react-dom/umd/react-dom-server.browser.production.min.js = 56.60 kB 56.36 kB = 17.71 kB 17.65 kB
oss-experimental/react-dom/cjs/react-dom-static.browser.production.min.js = 56.33 kB 56.09 kB = 17.39 kB 17.34 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 55.75 kB 55.51 kB = 16.58 kB 16.53 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 55.91 kB 55.66 kB = 16.87 kB 16.82 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js = 29.47 kB 29.27 kB = 10.09 kB 10.02 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js = 29.47 kB 29.27 kB = 10.09 kB 10.02 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js = 29.22 kB 29.03 kB = 9.99 kB 9.92 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js = 29.22 kB 29.03 kB = 9.99 kB 9.92 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.production.min.js = 28.51 kB 28.31 kB = 9.80 kB 9.74 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.production.min.js = 28.51 kB 28.31 kB = 9.80 kB 9.74 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js = 28.59 kB 28.39 kB = 9.81 kB 9.74 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js = 28.59 kB 28.39 kB = 9.81 kB 9.74 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js = 28.30 kB 28.11 kB = 9.70 kB 9.63 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js = 28.30 kB 28.11 kB = 9.70 kB 9.63 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js = 104.54 kB 103.71 kB = 25.41 kB 25.19 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js = 104.54 kB 103.71 kB = 25.41 kB 25.19 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js = 106.86 kB 106.01 kB = 25.19 kB 24.97 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js = 106.86 kB 106.01 kB = 25.19 kB 24.97 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js = 103.15 kB 102.32 kB = 25.02 kB 24.80 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js = 103.15 kB 102.32 kB = 25.02 kB 24.80 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js = 101.99 kB 101.16 kB = 25.05 kB 24.82 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js = 101.99 kB 101.16 kB = 25.05 kB 24.82 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js = 101.50 kB 100.67 kB = 24.90 kB 24.67 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js = 101.50 kB 100.67 kB = 24.90 kB 24.67 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.min.js = 29.51 kB 29.27 kB = 10.11 kB 10.02 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js = 29.27 kB 29.03 kB = 10.01 kB 9.92 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.production.min.js = 28.55 kB 28.31 kB = 9.82 kB 9.74 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js = 104.59 kB 103.71 kB = 25.43 kB 25.19 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.min.js = 28.63 kB 28.39 kB = 9.83 kB 9.74 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.min.js = 28.35 kB 28.11 kB = 9.73 kB 9.63 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js = 103.20 kB 102.32 kB = 25.04 kB 24.80 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js = 106.93 kB 106.01 kB = 25.21 kB 24.97 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js = 102.04 kB 101.16 kB = 25.07 kB 24.82 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js = 101.55 kB 100.67 kB = 24.92 kB 24.67 kB
facebook-www/ReactFlightDOMRelayServer-prod.classic.js = 37.45 kB 37.08 kB = 9.37 kB 9.25 kB
facebook-www/ReactFlightDOMRelayServer-prod.modern.js = 37.45 kB 37.08 kB = 9.37 kB 9.25 kB
facebook-www/ReactFlightDOMRelayServer-dev.modern.js = 75.62 kB 74.48 kB = 18.44 kB 18.09 kB
facebook-www/ReactFlightDOMRelayServer-dev.classic.js = 75.62 kB 74.48 kB = 18.44 kB 18.09 kB

Generated by 🚫 dangerJS against 5396f17

@sebmarkbage sebmarkbage force-pushed the refactorreactdomcomponent branch 3 times, most recently from 2b64767 to d5e5a65 Compare March 20, 2023 04:19
@sebmarkbage sebmarkbage force-pushed the refactorreactdomcomponent branch 3 times, most recently from 76e4906 to 4ad6e2d Compare March 20, 2023 19:25
These are now covered by switches inside each case.
This helps typos but it's unneccessarily clever.
This removes some runtime validation for the hydration path because we
generally don't do this kind of validation against the props there. Only
if the path ends up mismatching in the children somehow.

This leads to some duplication but I plan on unifying later.
We actually only use this for BOOLEANs anyway.
@sebmarkbage sebmarkbage force-pushed the refactorreactdomcomponent branch from c5281c9 to 5396f17 Compare March 20, 2023 23:43
@sebmarkbage
Copy link
Collaborator Author

I confirmed that the attribute-behavior fixture yields the same result as main (with the last fix included).

@sebmarkbage sebmarkbage merged commit 520f7f3 into facebook:main Mar 21, 2023
github-actions bot pushed a commit that referenced this pull request Mar 21, 2023
This is in line with the refactor I already did on Fizz earlier and
brings Fiber up to a similar structure.

We end up with a lot of extra checks due the extra abstractions we use
to check the various properties. This uses a flatter and more inline
model which makes it easier to see what each property does. The tradeoff
is that a change might need changes in more places.

The general structure is that there's a switch for tag first, then a
switch for each attribute special case, then a switch for the value. So
it's easy to follow where each scenario will end up and there shouldn't
be any unnecessary code executed along the way.

My goal is to eventually get rid of the meta-programming in DOMProperty
and CSSProperty but I'm leaving that in for now - in line with Fizz.

My next step is moving around things a bit in the diff/commit phases.
This is the first step to more refactors for perf and size, but also
because I'm adding more special cases so I need to have a flatter
structure that I can reason about for those special cases.

DiffTrain build for [520f7f3](520f7f3)
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Mar 29, 2023
Summary:
This sync includes the following changes:
- **[77ba1618a](facebook/react@77ba1618a )**: Bugfix: Remove extra render pass when reverting to client render ([#26445](facebook/react#26445)) //<Andrew Clark>//
- **[520f7f3ed](facebook/react@520f7f3ed )**: Refactor ReactDOMComponent to use flatter property operations ([#26433](facebook/react#26433)) //<Sebastian Markbåge>//
- **[0131d0cff](facebook/react@0131d0cff )**: Check if suspensey instance resolves in immediate task ([#26427](facebook/react#26427)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 3554c88...77ba161

jest_e2e[run_all_tests]

Reviewed By: poteto

Differential Revision: D44476026

fbshipit-source-id: c6935d760a068672b714722dee1fd24839c08c4b
jeongshin pushed a commit to jeongshin/react-native that referenced this pull request May 7, 2023
Summary:
This sync includes the following changes:
- **[77ba1618a](facebook/react@77ba1618a )**: Bugfix: Remove extra render pass when reverting to client render ([facebook#26445](facebook/react#26445)) //<Andrew Clark>//
- **[520f7f3ed](facebook/react@520f7f3ed )**: Refactor ReactDOMComponent to use flatter property operations ([facebook#26433](facebook/react#26433)) //<Sebastian Markbåge>//
- **[0131d0cff](facebook/react@0131d0cff )**: Check if suspensey instance resolves in immediate task ([facebook#26427](facebook/react#26427)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 3554c88...77ba161

jest_e2e[run_all_tests]

Reviewed By: poteto

Differential Revision: D44476026

fbshipit-source-id: c6935d760a068672b714722dee1fd24839c08c4b
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
This sync includes the following changes:
- **[77ba1618a](facebook/react@77ba1618a )**: Bugfix: Remove extra render pass when reverting to client render ([facebook#26445](facebook/react#26445)) //<Andrew Clark>//
- **[520f7f3ed](facebook/react@520f7f3ed )**: Refactor ReactDOMComponent to use flatter property operations ([facebook#26433](facebook/react#26433)) //<Sebastian Markbåge>//
- **[0131d0cff](facebook/react@0131d0cff )**: Check if suspensey instance resolves in immediate task ([facebook#26427](facebook/react#26427)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 3554c88...77ba161

jest_e2e[run_all_tests]

Reviewed By: poteto

Differential Revision: D44476026

fbshipit-source-id: c6935d760a068672b714722dee1fd24839c08c4b
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
This is in line with the refactor I already did on Fizz earlier and
brings Fiber up to a similar structure.

We end up with a lot of extra checks due the extra abstractions we use
to check the various properties. This uses a flatter and more inline
model which makes it easier to see what each property does. The tradeoff
is that a change might need changes in more places.

The general structure is that there's a switch for tag first, then a
switch for each attribute special case, then a switch for the value. So
it's easy to follow where each scenario will end up and there shouldn't
be any unnecessary code executed along the way.

My goal is to eventually get rid of the meta-programming in DOMProperty
and CSSProperty but I'm leaving that in for now - in line with Fizz.

My next step is moving around things a bit in the diff/commit phases.
This is the first step to more refactors for perf and size, but also
because I'm adding more special cases so I need to have a flatter
structure that I can reason about for those special cases.

DiffTrain build for commit 520f7f3.
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