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

Reland #28672: Remove IndeterminateComponent #28681

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Mar 29, 2024

This PR relands #28672 on top of the flag removal and the test demonstrating a breakage in Suspense for legacy mode.

React has deprecated module pattern Function Components for many years at this point. Supporting this pattern required React to have a concept of an indeterminate component so that when a component first renders it can turn into either a ClassComponent or a FunctionComponent depending on what it returns. While this feature was deprecated and put behind a flag it is still in stable. This change remvoes the flag, removes the warnings, and removes the concept of IndeterminateComponent from the React codebase.

While removing IndeterminateComponent type Seb and I discovered that we needed a concept of IncompleteFunctionComponent to support Suspense in legacy mode. This new work tag is only needed as long as legacy mode is around and ideally any code that considers this tag will be excludable from OSS builds once we land extra gates using disableLegacyMode flag.

…s at this point. Supporting this pattern required React to have a concept of an indeterminate component so that when a component first renders it can turn into either a ClassComponent or a FunctionComponent depending on what it returns. While this feature was deprecated and put behind a flag it is still in stable. This change remvoes the flag, removes the warnings, and removes the concept of IndeterminateComponent from the React codebase.

While removing IndeterminateComponent type Seb and I discovered that we needed a concept of IncompleteFunctionComponent to support Suspense in legacy mode. This new work tag is only needed as long as legacy mode is around and ideally any code that considers this tag will be excludable from OSS builds once we land extra gates using `disableLegacyMode` flag.
@gnoff gnoff requested a review from rickhanlonii March 29, 2024 21:47
@facebook-github-bot facebook-github-bot added the React Core Team Opened by a member of the React Core Team label Mar 29, 2024
@react-sizebot
Copy link

Comparing: 23b32d3...e8d3c6b

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 = 177.14 kB 177.02 kB = 55.06 kB 55.01 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 172.96 kB 172.87 kB = 53.92 kB 53.88 kB
facebook-www/ReactDOM-prod.classic.js = 592.88 kB 592.71 kB = 104.01 kB 103.91 kB
facebook-www/ReactDOM-prod.modern.js +0.05% 574.57 kB 574.88 kB = 101.03 kB 100.96 kB
test_utils/ReactAllWarnings.js Deleted 65.18 kB 0.00 kB Deleted 16.30 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
oss-stable/react-test-renderer/umd/react-test-renderer.development.js = 873.82 kB 872.07 kB = 183.50 kB 183.03 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.development.js = 873.79 kB 872.04 kB = 183.47 kB 183.00 kB
facebook-www/ReactART-dev.classic.js = 1,081.43 kB 1,079.25 kB = 211.54 kB 211.01 kB
facebook-www/ReactTestRenderer-dev.classic.js = 968.26 kB 966.30 kB = 192.28 kB 191.82 kB
facebook-www/ReactTestRenderer-dev.modern.js = 968.26 kB 966.30 kB = 192.28 kB 191.82 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js = 943.01 kB 941.08 kB = 202.22 kB 201.68 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.development.js = 942.98 kB 941.05 kB = 202.19 kB 201.66 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js = 947.88 kB 945.93 kB = 188.03 kB 187.57 kB
oss-stable/react-art/cjs/react-art.development.js = 847.68 kB 845.89 kB = 183.58 kB 183.13 kB
oss-stable-semver/react-art/cjs/react-art.development.js = 847.65 kB 845.86 kB = 183.56 kB 183.10 kB
oss-experimental/react-dom/umd/react-dom-server.browser.development.js = 465.65 kB 464.41 kB = 99.85 kB 99.53 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.development.js = 456.58 kB 455.35 kB = 98.79 kB 98.47 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.development.js = 445.47 kB 444.26 kB = 99.03 kB 98.71 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js = 444.88 kB 443.67 kB = 98.90 kB 98.58 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js = 443.25 kB 442.04 kB = 98.08 kB 97.77 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js = 437.94 kB 436.73 kB = 98.24 kB 97.91 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js = 436.22 kB 435.01 kB = 97.80 kB 97.48 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.development.js = 442.78 kB 441.55 kB = 96.50 kB 96.18 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.development.js = 442.76 kB 441.53 kB = 96.48 kB 96.16 kB
oss-stable/react-dom/umd/react-dom-server.browser.development.js = 442.13 kB 440.90 kB = 96.60 kB 96.27 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.development.js = 442.10 kB 440.87 kB = 96.57 kB 96.25 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js = 429.91 kB 428.71 kB = 95.90 kB 95.57 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.development.js = 424.67 kB 423.47 kB = 95.96 kB 95.64 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.development.js = 424.65 kB 423.44 kB = 95.94 kB 95.61 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.development.js = 422.95 kB 421.75 kB = 95.52 kB 95.20 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.development.js = 422.93 kB 421.72 kB = 95.50 kB 95.17 kB
oss-stable/react-dom/cjs/react-dom-server.edge.development.js = 422.89 kB 421.68 kB = 95.75 kB 95.43 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.development.js = 422.86 kB 421.66 kB = 95.73 kB 95.40 kB
oss-stable/react-dom/cjs/react-dom-server.browser.development.js = 422.31 kB 421.10 kB = 95.62 kB 95.29 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.development.js = 422.28 kB 421.07 kB = 95.59 kB 95.27 kB
oss-stable/react-dom/cjs/react-dom-server.node.development.js = 421.21 kB 420.00 kB = 94.49 kB 94.17 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.development.js = 421.18 kB 419.98 kB = 94.47 kB 94.14 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js = 416.64 kB 415.44 kB = 93.60 kB 93.27 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js = 416.62 kB 415.41 kB = 93.58 kB 93.25 kB
facebook-www/ReactDOMServer-dev.classic.js = 497.14 kB 495.62 kB = 101.29 kB 100.92 kB
facebook-www/ReactDOMServer-dev.modern.js = 494.47 kB 492.96 kB = 100.79 kB 100.43 kB
facebook-www/ReactDOMServerStreaming-dev.modern.js = 487.53 kB 486.01 kB = 99.18 kB 98.83 kB
oss-experimental/react-server/cjs/react-server.development.js = 209.45 kB 208.24 kB = 48.68 kB 48.36 kB
oss-stable-semver/react-server/cjs/react-server.development.js = 199.89 kB 198.69 kB = 47.04 kB 46.72 kB
oss-stable/react-server/cjs/react-server.development.js = 199.89 kB 198.69 kB = 47.04 kB 46.72 kB
oss-experimental/react-reconciler/cjs/react-reconciler-reflection.development.js = 18.81 kB 18.69 kB = 5.40 kB 5.36 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler-reflection.development.js = 18.81 kB 18.69 kB = 5.40 kB 5.36 kB
oss-stable/react-reconciler/cjs/react-reconciler-reflection.development.js = 18.81 kB 18.69 kB = 5.40 kB 5.36 kB
test_utils/ReactAllWarnings.js Deleted 65.18 kB 0.00 kB Deleted 16.30 kB 0.00 kB

Generated by 🚫 dangerJS against e8d3c6b

@gnoff gnoff merged commit 5998a77 into facebook:main Apr 3, 2024
38 checks passed
@gnoff gnoff deleted the remove-indeterminate-components branch April 3, 2024 00:42
github-actions bot pushed a commit that referenced this pull request Apr 3, 2024
This PR relands #28672 on top of the flag removal and the test
demonstrating a breakage in Suspense for legacy mode.

React has deprecated module pattern Function Components for many years
at this point. Supporting this pattern required React to have a concept
of an indeterminate component so that when a component first renders it
can turn into either a ClassComponent or a FunctionComponent depending
on what it returns. While this feature was deprecated and put behind a
flag it is still in stable. This change remvoes the flag, removes the
warnings, and removes the concept of IndeterminateComponent from the
React codebase.

While removing IndeterminateComponent type Seb and I discovered that we
needed a concept of IncompleteFunctionComponent to support Suspense in
legacy mode. This new work tag is only needed as long as legacy mode is
around and ideally any code that considers this tag will be excludable
from OSS builds once we land extra gates using `disableLegacyMode` flag.

DiffTrain build for [5998a77](5998a77)
sebmarkbage added a commit that referenced this pull request Apr 3, 2024
…#28657)

Saves some bytes and ensures that we're actually disabling it.

Turns out this flag wasn't disabling React Native/Fabric, React Noop and
React ART legacy modes so those are updated too.

Should be rebased on #28681.
github-actions bot pushed a commit that referenced this pull request Apr 3, 2024
…#28657)

Saves some bytes and ensures that we're actually disabling it.

Turns out this flag wasn't disabling React Native/Fabric, React Noop and
React ART legacy modes so those are updated too.

Should be rebased on #28681.

DiffTrain build for [5de8703](5de8703)
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
This PR relands facebook#28672 on top of the flag removal and the test
demonstrating a breakage in Suspense for legacy mode.

React has deprecated module pattern Function Components for many years
at this point. Supporting this pattern required React to have a concept
of an indeterminate component so that when a component first renders it
can turn into either a ClassComponent or a FunctionComponent depending
on what it returns. While this feature was deprecated and put behind a
flag it is still in stable. This change remvoes the flag, removes the
warnings, and removes the concept of IndeterminateComponent from the
React codebase.

While removing IndeterminateComponent type Seb and I discovered that we
needed a concept of IncompleteFunctionComponent to support Suspense in
legacy mode. This new work tag is only needed as long as legacy mode is
around and ideally any code that considers this tag will be excludable
from OSS builds once we land extra gates using `disableLegacyMode` flag.
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
…facebook#28657)

Saves some bytes and ensures that we're actually disabling it.

Turns out this flag wasn't disabling React Native/Fabric, React Noop and
React ART legacy modes so those are updated too.

Should be rebased on facebook#28681.
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))
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
This PR relands #28672 on top of the flag removal and the test
demonstrating a breakage in Suspense for legacy mode.

React has deprecated module pattern Function Components for many years
at this point. Supporting this pattern required React to have a concept
of an indeterminate component so that when a component first renders it
can turn into either a ClassComponent or a FunctionComponent depending
on what it returns. While this feature was deprecated and put behind a
flag it is still in stable. This change remvoes the flag, removes the
warnings, and removes the concept of IndeterminateComponent from the
React codebase.

While removing IndeterminateComponent type Seb and I discovered that we
needed a concept of IncompleteFunctionComponent to support Suspense in
legacy mode. This new work tag is only needed as long as legacy mode is
around and ideally any code that considers this tag will be excludable
from OSS builds once we land extra gates using `disableLegacyMode` flag.

DiffTrain build for commit 5998a77.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
…#28657)

Saves some bytes and ensures that we're actually disabling it.

Turns out this flag wasn't disabling React Native/Fabric, React Noop and
React ART legacy modes so those are updated too.

Should be rebased on #28681.

DiffTrain build for commit 5de8703.
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