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

Move ReactDOMLegacy implementation into RootFB #28656

Merged
merged 4 commits into from
Apr 3, 2024

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Mar 27, 2024

Only the FB entry point has legacy mode now so we can move the remaining code in there.

Also enable disableLegacyMode in modern www builds since it doesn't expose those entry points.

Now dependent on #28709.

@sebmarkbage sebmarkbage requested a review from gnoff March 27, 2024 05:02
@sebmarkbage sebmarkbage marked this pull request as draft March 27, 2024 05:02
@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label Mar 27, 2024
Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -416,3 +457,81 @@ export function unstable_renderSubtreeIntoContainer(
callback,
);
}

export function unmountComponentAtNode(container: Container): boolean {
if (disableLegacyMode) {
Copy link
Member

Choose a reason for hiding this comment

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

In legacy mode, can this log "has not been supported since React 18"?

@gnoff
Copy link
Collaborator

gnoff commented Mar 27, 2024

@sebmarkbage the underlying landed

@@ -330,6 +339,38 @@ function legacyRenderSubtreeIntoContainer(
return getPublicRootInstance(root);
}

export function findDOMNode(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this go somewhere else since it'll still be on secret internals for now?

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 added essentially a re-export of findHostInstance in the internals instead which doesn't have the extra warnings and type checks. If you're using the internals you better know what you're doing.

@react-sizebot
Copy link

react-sizebot commented Apr 2, 2024

Comparing: 5de8703...12ab8d6

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 = 176.82 kB 173.32 kB = 54.94 kB 53.92 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 170.95 kB 170.94 kB = 53.31 kB 53.25 kB
facebook-www/ReactDOM-prod.classic.js = 591.01 kB 588.57 kB = 103.63 kB 103.51 kB
facebook-www/ReactDOM-prod.modern.js = 573.22 kB 566.68 kB = 100.70 kB 99.52 kB
oss-stable/react-art/cjs/react-art.production.js = 603.46 kB 591.37 kB = 134.70 kB 132.48 kB
oss-stable-semver/react-art/cjs/react-art.production.js = 603.43 kB 591.34 kB = 134.68 kB 132.46 kB
facebook-www/ReactART-dev.modern.js = 1,066.91 kB 1,045.17 kB = 208.56 kB 204.82 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.js = 612.46 kB 599.88 kB = 137.11 kB 134.77 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.js = 612.43 kB 599.86 kB = 137.08 kB 134.75 kB
oss-stable/react-dom/umd/react-dom.development.js = 1,400.91 kB 1,371.11 kB = 298.01 kB 292.36 kB
oss-stable-semver/react-dom/umd/react-dom.development.js = 1,400.88 kB 1,371.08 kB = 297.98 kB 292.32 kB
oss-stable/react-dom/cjs/react-dom.development.js = 1,336.64 kB 1,307.93 kB = 295.04 kB 289.35 kB
oss-stable-semver/react-dom/cjs/react-dom.development.js = 1,336.61 kB 1,307.90 kB = 295.02 kB 289.32 kB
test_utils/ReactAllWarnings.js Deleted 64.58 kB 0.00 kB Deleted 16.14 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
facebook-www/ReactDOMTesting-dev.classic.js = 1,703.27 kB 1,697.96 kB = 338.45 kB 337.44 kB
facebook-www/ReactDOM-dev.classic.js = 1,681.50 kB 1,676.18 kB = 333.85 kB 332.84 kB
facebook-www/ReactDOM-profiling.classic.js = 620.51 kB 618.06 kB = 108.01 kB 107.89 kB
facebook-www/ReactDOMTesting-prod.classic.js = 605.56 kB 603.12 kB = 107.33 kB 107.21 kB
facebook-www/ReactDOM-prod.classic.js = 591.01 kB 588.57 kB = 103.63 kB 103.51 kB
oss-stable/react/umd/react.development.js = 122.62 kB 122.06 kB = 31.24 kB 31.13 kB
oss-stable-semver/react/umd/react.development.js = 122.59 kB 122.04 kB = 31.21 kB 31.11 kB
facebook-www/React-dev.modern.js = 126.53 kB 125.96 kB = 29.74 kB 29.63 kB
oss-stable/react/cjs/react.development.js = 99.96 kB 99.44 kB = 26.66 kB 26.56 kB
oss-stable-semver/react/cjs/react.development.js = 99.94 kB 99.41 kB = 26.63 kB 26.53 kB
facebook-www/ReactDOMTesting-prod.modern.js = 588.98 kB 582.43 kB = 104.71 kB 103.43 kB
facebook-www/ReactDOM-prod.modern.js = 573.22 kB 566.68 kB = 100.70 kB 99.52 kB
facebook-www/ReactDOM-profiling.modern.js = 602.65 kB 595.54 kB = 105.02 kB 103.65 kB
oss-stable/react-art/umd/react-art.production.min.js = 137.67 kB 135.87 kB = 42.87 kB 42.33 kB
oss-stable-semver/react-art/umd/react-art.production.min.js = 137.62 kB 135.82 kB = 42.84 kB 42.31 kB
facebook-www/ReactDOMTesting-dev.modern.js = 1,670.36 kB 1,644.94 kB = 332.74 kB 328.09 kB
facebook-www/ReactDOM-dev.modern.js = 1,649.88 kB 1,624.46 kB = 328.34 kB 323.70 kB
oss-stable/react-art/umd/react-art.development.js = 962.54 kB 946.90 kB = 202.39 kB 199.46 kB
oss-stable-semver/react-art/umd/react-art.development.js = 962.51 kB 946.87 kB = 202.37 kB 199.43 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js = 114.32 kB 112.45 kB = 35.36 kB 34.77 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.min.js = 114.29 kB 112.43 kB = 35.34 kB 34.75 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js = 940.86 kB 925.19 kB = 201.75 kB 198.74 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.development.js = 940.83 kB 925.17 kB = 201.72 kB 198.72 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js = 123.36 kB 121.26 kB = 37.70 kB 37.01 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.min.js = 123.33 kB 121.24 kB = 37.68 kB 36.99 kB
facebook-www/ReactART-prod.modern.js = 353.85 kB 347.78 kB = 59.67 kB 58.83 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-persistent.development.js = 42.34 kB 41.60 kB = 9.61 kB 9.61 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-persistent.development.js = 42.34 kB 41.60 kB = 9.61 kB 9.61 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer.development.js = 42.21 kB 41.47 kB = 9.59 kB 9.59 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer.development.js = 42.21 kB 41.47 kB = 9.59 kB 9.59 kB
oss-stable/react-art/cjs/react-art.production.min.js = 100.46 kB 98.69 kB = 30.83 kB 30.27 kB
oss-stable-semver/react-art/cjs/react-art.production.min.js = 100.41 kB 98.64 kB = 30.80 kB 30.24 kB
oss-stable/react-art/cjs/react-art.development.js = 845.83 kB 830.72 kB = 183.20 kB 180.23 kB
oss-stable-semver/react-art/cjs/react-art.development.js = 845.81 kB 830.69 kB = 183.17 kB 180.20 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js = 108.85 kB 106.89 kB = 33.35 kB 32.70 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.min.js = 108.80 kB 106.84 kB = 33.32 kB 32.68 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.js = 687.54 kB 675.07 kB = 150.93 kB 148.57 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.js = 687.51 kB 675.05 kB = 150.90 kB 148.54 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js = 109.14 kB 107.15 kB = 33.74 kB 33.06 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.production.min.js = 109.09 kB 107.10 kB = 33.72 kB 33.04 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js = 871.15 kB 855.06 kB = 182.91 kB 179.88 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.development.js = 871.12 kB 855.04 kB = 182.88 kB 179.85 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js = 831.85 kB 816.31 kB = 180.93 kB 177.96 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.development.js = 831.82 kB 816.28 kB = 180.90 kB 177.93 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.js = 728.75 kB 715.09 kB = 158.40 kB 155.82 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.js = 728.73 kB 715.07 kB = 158.37 kB 155.80 kB
oss-stable/react-dom/cjs/react-dom.production.js = 947.16 kB 929.19 kB = 212.67 kB 209.28 kB
oss-stable-semver/react-dom/cjs/react-dom.production.js = 947.13 kB 929.17 kB = 212.64 kB 209.25 kB
oss-stable/react-dom/cjs/react-dom.profiling.js = 988.96 kB 969.80 kB = 220.38 kB 216.59 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.js = 988.93 kB 969.78 kB = 220.35 kB 216.56 kB
oss-stable/react-dom/umd/react-dom.production.min.js = 176.56 kB 173.13 kB = 55.25 kB 54.41 kB
oss-stable-semver/react-dom/umd/react-dom.production.min.js = 176.48 kB 173.05 kB = 55.22 kB 54.39 kB
oss-stable/react-dom/umd/react-dom.profiling.min.js = 185.58 kB 181.91 kB = 57.59 kB 56.66 kB
oss-stable-semver/react-dom/umd/react-dom.profiling.min.js = 185.50 kB 181.84 kB = 57.56 kB 56.64 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-persistent.production.min.js = 15.64 kB 15.34 kB = 4.73 kB 4.69 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-persistent.production.min.js = 15.64 kB 15.34 kB = 4.73 kB 4.69 kB
oss-stable/react-dom/cjs/react-dom.production.min.js = 176.82 kB 173.32 kB = 54.94 kB 53.92 kB
oss-stable-semver/react-dom/cjs/react-dom.production.min.js = 176.74 kB 173.24 kB = 54.92 kB 53.90 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer.production.min.js = 15.56 kB 15.26 kB = 4.71 kB 4.68 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer.production.min.js = 15.56 kB 15.26 kB = 4.71 kB 4.68 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-persistent.production.js = 36.29 kB 35.57 kB = 7.67 kB 7.66 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-persistent.production.js = 36.29 kB 35.57 kB = 7.67 kB 7.66 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer.production.js = 36.16 kB 35.44 kB = 7.65 kB 7.64 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer.production.js = 36.16 kB 35.44 kB = 7.65 kB 7.64 kB
oss-stable/react-dom/cjs/react-dom.profiling.min.js = 186.28 kB 182.56 kB = 57.32 kB 56.23 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.min.js = 186.20 kB 182.48 kB = 57.30 kB 56.20 kB
oss-stable/react-art/cjs/react-art.production.js = 603.46 kB 591.37 kB = 134.70 kB 132.48 kB
oss-stable-semver/react-art/cjs/react-art.production.js = 603.43 kB 591.34 kB = 134.68 kB 132.46 kB
facebook-www/ReactART-dev.modern.js = 1,066.91 kB 1,045.17 kB = 208.56 kB 204.82 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.js = 612.46 kB 599.88 kB = 137.11 kB 134.77 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.js = 612.43 kB 599.86 kB = 137.08 kB 134.75 kB
oss-stable/react-dom/umd/react-dom.development.js = 1,400.91 kB 1,371.11 kB = 298.01 kB 292.36 kB
oss-stable-semver/react-dom/umd/react-dom.development.js = 1,400.88 kB 1,371.08 kB = 297.98 kB 292.32 kB
oss-stable/react-dom/cjs/react-dom.development.js = 1,336.64 kB 1,307.93 kB = 295.04 kB 289.35 kB
oss-stable-semver/react-dom/cjs/react-dom.development.js = 1,336.61 kB 1,307.90 kB = 295.02 kB 289.32 kB
test_utils/ReactAllWarnings.js Deleted 64.58 kB 0.00 kB Deleted 16.14 kB 0.00 kB

Generated by 🚫 dangerJS against 12ab8d6

@sebmarkbage sebmarkbage marked this pull request as ready for review April 2, 2024 16:19
@sebmarkbage sebmarkbage force-pushed the rmlegacy branch 6 times, most recently from c2ad4af to 2f4b580 Compare April 3, 2024 01:10
sebmarkbage and others added 2 commits April 2, 2024 21:15
Only the FB entry point has legacy mode now so we can move the remaining
code in there.
@sebmarkbage sebmarkbage force-pushed the rmlegacy branch 2 times, most recently from 585be19 to 4ffb70f Compare April 3, 2024 01:41
These already don't expose the entry points to create legacy roots.
@sebmarkbage sebmarkbage merged commit 8f55a6a into facebook:main Apr 3, 2024
38 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 3, 2024
Only the FB entry point has legacy mode now so we can move the remaining
code in there.

Also enable disableLegacyMode in modern www builds since it doesn't
expose those entry points.

Now dependent on #28709.

---------

Co-authored-by: Josh Story <story@hey.com>

DiffTrain build for [8f55a6a](8f55a6a)
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
Only the FB entry point has legacy mode now so we can move the remaining
code in there.

Also enable disableLegacyMode in modern www builds since it doesn't
expose those entry points.

Now dependent on facebook#28709.

---------

Co-authored-by: Josh Story <story@hey.com>
hoxyq added a commit that referenced this pull request Apr 15, 2024
Full list of changes:
* Look for a ReactMemoCacheSentinel on state
([gsathya](https://github.com/gsathya) in
[#28831](#28831))
* Use use() in the Cache if available
([sebmarkbage](https://github.com/sebmarkbage) in
[#28793](#28793))
* feat[devtools-fusebox]: support theme option
([hoxyq](https://github.com/hoxyq) in
[#28832](#28832))
* feat[devtools]: add package for fusebox integration
([hoxyq](https://github.com/hoxyq) in
[#28553](#28553))
* feat[devtools]: add method for connecting backend with custom
messaging protocol ([hoxyq](https://github.com/hoxyq) in
[#28552](#28552))
* Rename SECRET INTERNALS to
`__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE`
([sebmarkbage](https://github.com/sebmarkbage) in
[#28789](#28789))
* Flatten ReactSharedInternals
([sebmarkbage](https://github.com/sebmarkbage) in
[#28783](#28783))
* feat[devtools]: ship source maps for content scripts and ignore list
installHook script ([hoxyq](https://github.com/hoxyq) in
[#28730](#28730))
* Track Owner for Server Components in DEV
([sebmarkbage](https://github.com/sebmarkbage) in
[#28753](#28753))
* Move ReactDOMLegacy implementation into RootFB
([sebmarkbage](https://github.com/sebmarkbage) in
[#28656](#28656))
* Reland #28672: Remove IndeterminateComponent
([gnoff](https://github.com/gnoff) in
[#28681](#28681))
* Remove reference to deleted <Cache> in un-linted file
([josephsavona](https://github.com/josephsavona) in
[#28715](#28715))
* [be] Remove unshipped experimental <Cache> element type
([josephsavona](https://github.com/josephsavona) in
[#28698](#28698))
* Revert "Remove module pattern function component support"
([rickhanlonii](https://github.com/rickhanlonii) in
[#28670](#28670))
* Remove module pattern function component support
([gnoff](https://github.com/gnoff) in
[#27742](#27742))
* [RTR] Enable warning flag ([jackpope](https://github.com/jackpope) in
[#28419](#28419))
* Update error messages ([rickhanlonii](https://github.com/rickhanlonii)
in [#28652](#28652))
* fix[devtools/ci]: split profiling cache test for different react
versions and toEqual checker ([hoxyq](https://github.com/hoxyq) in
[#28628](#28628))
* Guard against legacy context not being supported in DevTools fixture
([eps1lon](https://github.com/eps1lon) in
[#28596](#28596))
* Use `declare const` instead of `declare var`
([kassens](https://github.com/kassens) in
[#28599](#28599))
* Update isConcurrent RTR option usage
([jackpope](https://github.com/jackpope) in
[#28546](#28546))
* Disable legacy context ([kassens](https://github.com/kassens) in
[#27991](#27991))
* Remove invokeGuardedCallback and replay trick
([sebmarkbage](https://github.com/sebmarkbage) in
[#28515](#28515))
* Remove remaining usages of ReactTestUtils in tests unrelated to
`react-dom/test-util` ([eps1lon](https://github.com/eps1lon) in
[#28534](#28534))
* fix[devtools/e2e]: fixed source inspection in e2e tests
([hoxyq](https://github.com/hoxyq) in
[#28518](#28518))
* Devtools: Display actual pending state when inspecting `useTransition`
([eps1lon](https://github.com/eps1lon) in
[#28499](#28499))
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.

5 participants