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

Remove module pattern function component support #27742

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Nov 22, 2023

The module pattern

function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}

has been deprecated for approximately 5 years now. This PR removes support for this pattern. It also simplifies a number of code paths in particular related to the concept of IndeterminateComponent types.

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

react-sizebot commented Nov 22, 2023

Comparing: 05797cc...081a4a9

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.93 kB 176.35 kB = 54.99 kB 54.83 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 173.11 kB 172.85 kB = 53.94 kB 53.89 kB
facebook-www/ReactDOM-prod.classic.js = 592.81 kB 591.94 kB = 103.99 kB 103.83 kB
facebook-www/ReactDOM-prod.modern.js = 574.40 kB 574.01 kB = 101.00 kB 100.89 kB
test_utils/ReactAllWarnings.js Deleted 65.05 kB 0.00 kB Deleted 16.26 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
react-native/implementations/ReactNativeRenderer-prod.fb.js = 374.51 kB 373.73 kB = 65.59 kB 65.52 kB
react-native/implementations/ReactFabric-prod.fb.js = 367.11 kB 366.34 kB = 64.29 kB 64.23 kB
facebook-www/ReactART-prod.classic.js = 363.85 kB 363.08 kB = 61.58 kB 61.47 kB
react-native/implementations/ReactNativeRenderer-profiling.fb.js = 401.86 kB 401.00 kB = 69.85 kB 69.76 kB
facebook-www/ReactDOMTesting-dev.modern.js = 1,675.58 kB 1,671.98 kB = 333.60 kB 333.02 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.min.js = 122.22 kB 121.96 kB = 37.44 kB 37.40 kB
react-native/implementations/ReactFabric-profiling.fb.js = 394.39 kB 393.54 kB = 68.52 kB 68.44 kB
facebook-www/ReactDOM-dev.modern.js = 1,655.10 kB 1,651.50 kB = 329.17 kB 328.59 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js = 105.41 kB 105.18 kB = 32.71 kB 32.62 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js = 105.12 kB 104.88 kB = 32.34 kB 32.28 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js = 1,345.42 kB 1,342.44 kB = 297.42 kB 296.82 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js = 113.18 kB 112.93 kB = 35.11 kB 35.07 kB
facebook-www/ReactDOMTesting-dev.classic.js = 1,708.77 kB 1,704.98 kB = 339.36 kB 338.76 kB
oss-experimental/react-dom/cjs/react-dom.development.js = 1,327.62 kB 1,324.65 kB = 293.16 kB 292.57 kB
facebook-www/ReactDOM-dev.classic.js = 1,687.00 kB 1,683.20 kB = 334.78 kB 334.18 kB
oss-experimental/react-dom/umd/react-dom.development.js = 1,391.66 kB 1,388.53 kB = 296.14 kB 295.53 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-profiling.js = 331.10 kB 330.33 kB = 58.09 kB 58.00 kB
oss-experimental/react-art/cjs/react-art.production.min.js = 98.29 kB 98.05 kB = 30.20 kB 30.14 kB
oss-stable/react-dom/cjs/react-dom-server.edge.production.min.js = 86.34 kB 86.13 kB = 26.98 kB 26.94 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.production.min.js = 86.31 kB 86.11 kB = 26.95 kB 26.91 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 85.85 kB 85.64 kB = 26.40 kB 26.35 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.production.min.js = 85.82 kB 85.61 kB = 26.37 kB 26.33 kB
oss-stable/react-dom/cjs/react-dom-server.node.production.min.js = 84.47 kB 84.27 kB = 26.13 kB 26.09 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.production.min.js = 84.45 kB 84.24 kB = 26.11 kB 26.07 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-prod.js = 315.31 kB 314.53 kB = 55.62 kB 55.53 kB
oss-stable/react-dom/cjs/react-dom-server.bun.production.min.js = 82.73 kB 82.52 kB = 25.19 kB 25.16 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.production.min.js = 82.70 kB 82.49 kB = 25.16 kB 25.14 kB
oss-stable/react-dom/umd/react-dom-server.browser.production.min.js = 81.39 kB 81.18 kB = 25.60 kB 25.58 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.production.min.js = 81.36 kB 81.16 kB = 25.58 kB 25.55 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 80.42 kB 80.22 kB = 24.87 kB 24.82 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.production.min.js = 80.39 kB 80.19 kB = 24.84 kB 24.80 kB
oss-stable/react-dom/cjs/react-dom-server.browser.production.min.js = 81.33 kB 81.12 kB = 25.34 kB 25.31 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.production.min.js = 81.30 kB 81.09 kB = 25.31 kB 25.28 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 80.34 kB 80.14 kB = 24.49 kB 24.46 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.production.min.js = 80.32 kB 80.11 kB = 24.47 kB 24.44 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.js = 685.18 kB 683.42 kB = 150.45 kB 150.16 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.js = 726.52 kB 724.64 kB = 157.87 kB 157.57 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.js = 603.91 kB 602.30 kB = 135.05 kB 134.77 kB
oss-experimental/react-art/cjs/react-art.production.js = 599.49 kB 597.88 kB = 133.91 kB 133.61 kB
oss-experimental/react-dom/umd/react-dom-server.browser.development.js = 465.77 kB 464.50 kB = 99.85 kB 99.53 kB
oss-stable-semver/react-server/cjs/react-server.production.js = 156.00 kB 155.57 kB = 36.74 kB 36.61 kB
oss-stable/react-server/cjs/react-server.production.js = 156.00 kB 155.57 kB = 36.74 kB 36.61 kB
oss-experimental/react-dom/cjs/react-dom-server.edge.development.js = 445.57 kB 444.34 kB = 99.02 kB 98.71 kB
oss-experimental/react-dom/umd/react-dom-server-legacy.browser.development.js = 456.71 kB 455.44 kB = 98.79 kB 98.47 kB
oss-experimental/react-dom/cjs/react-dom-server.browser.development.js = 444.99 kB 443.75 kB = 98.89 kB 98.58 kB
oss-experimental/react-dom/cjs/react-dom-server.node.development.js = 443.36 kB 442.12 kB = 98.08 kB 97.77 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.node.development.js = 438.05 kB 436.81 kB = 98.24 kB 97.91 kB
oss-experimental/react-dom/cjs/react-dom-server-legacy.browser.development.js = 436.33 kB 435.09 kB = 97.80 kB 97.47 kB
oss-experimental/react-dom/cjs/react-dom-server.bun.development.js = 430.02 kB 428.78 kB = 95.89 kB 95.57 kB
facebook-www/ReactDOMServer-dev.classic.js = 497.16 kB 495.67 kB = 101.28 kB 100.91 kB
oss-experimental/react-art/umd/react-art.development.js = 959.37 kB 956.39 kB = 201.16 kB 200.59 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js = 940.56 kB 937.59 kB = 201.54 kB 200.92 kB
oss-stable/react-dom/cjs/react-dom.profiling.min.js = 186.40 kB 185.81 kB = 57.36 kB 57.18 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.min.js = 186.33 kB 185.74 kB = 57.33 kB 57.15 kB
oss-stable/react-dom/umd/react-dom.profiling.min.js = 185.70 kB 185.11 kB = 57.57 kB 57.40 kB
oss-stable-semver/react-dom/umd/react-dom.profiling.min.js = 185.63 kB 185.04 kB = 57.54 kB 57.37 kB
facebook-www/ReactDOMServer-dev.modern.js = 494.59 kB 493.01 kB = 100.79 kB 100.43 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js = 1,113.64 kB 1,110.06 kB = 221.82 kB 221.17 kB
facebook-www/ReactART-dev.modern.js = 1,068.56 kB 1,065.12 kB = 208.97 kB 208.35 kB
facebook-www/ReactDOMServerStreaming-dev.modern.js = 487.64 kB 486.06 kB = 99.18 kB 98.82 kB
react-native/implementations/ReactFabric-dev.fb.js = 1,099.02 kB 1,095.45 kB = 217.95 kB 217.32 kB
oss-stable/react-dom/cjs/react-dom.production.min.js = 176.93 kB 176.35 kB = 54.99 kB 54.83 kB
oss-stable-semver/react-dom/cjs/react-dom.production.min.js = 176.85 kB 176.27 kB = 54.97 kB 54.80 kB
oss-stable/react-dom/umd/react-dom.production.min.js = 176.67 kB 176.09 kB = 55.21 kB 55.10 kB
oss-stable-semver/react-dom/umd/react-dom.production.min.js = 176.59 kB 176.01 kB = 55.19 kB 55.07 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.development.js = 821.53 kB 818.83 kB = 178.65 kB 178.02 kB
oss-stable/react-dom/cjs/react-dom.profiling.js = 989.35 kB 986.09 kB = 220.24 kB 219.73 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.js = 989.32 kB 986.07 kB = 220.21 kB 219.70 kB
oss-stable/react-dom/cjs/react-dom.production.js = 947.41 kB 944.29 kB = 212.71 kB 212.04 kB
oss-stable-semver/react-dom/cjs/react-dom.production.js = 947.38 kB 944.26 kB = 212.68 kB 212.01 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.development.js = 860.41 kB 857.58 kB = 180.73 kB 180.09 kB
facebook-www/ReactART-dev.classic.js = 1,080.76 kB 1,077.13 kB = 211.44 kB 210.78 kB
oss-experimental/react-art/cjs/react-art.development.js = 842.67 kB 839.83 kB = 181.87 kB 181.22 kB
facebook-www/ReactTestRenderer-dev.classic.js = 967.55 kB 964.13 kB = 192.18 kB 191.56 kB
facebook-www/ReactTestRenderer-dev.modern.js = 967.55 kB 964.13 kB = 192.18 kB 191.56 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js = 947.17 kB 943.76 kB = 187.93 kB 187.32 kB
oss-stable/react-dom/umd/react-dom.development.js = 1,400.79 kB 1,395.51 kB = 297.68 kB 296.79 kB
oss-stable-semver/react-dom/umd/react-dom.development.js = 1,400.76 kB 1,395.48 kB = 297.65 kB 296.76 kB
oss-stable/react-dom/cjs/react-dom.development.js = 1,336.49 kB 1,331.43 kB = 294.72 kB 293.82 kB
oss-stable-semver/react-dom/cjs/react-dom.development.js = 1,336.47 kB 1,331.40 kB = 294.69 kB 293.80 kB
react-native/implementations/ReactNativeRenderer-profiling.js = 339.11 kB 337.78 kB = 59.23 kB 59.05 kB
react-native/implementations/ReactFabric-profiling.js = 329.60 kB 328.26 kB = 57.55 kB 57.38 kB
oss-stable/react-art/umd/react-art.production.min.js = 138.00 kB 137.43 kB = 42.97 kB 42.87 kB
oss-stable-semver/react-art/umd/react-art.production.min.js = 137.95 kB 137.37 kB = 42.95 kB 42.84 kB
react-native/implementations/ReactNativeRenderer-prod.js = 319.90 kB 318.56 kB = 56.02 kB 55.85 kB
react-native/implementations/ReactFabric-prod.js = 311.14 kB 309.80 kB = 54.48 kB 54.31 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.js = 730.74 kB 727.49 kB = 158.73 kB 158.21 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.js = 730.71 kB 727.46 kB = 158.70 kB 158.18 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.js = 689.39 kB 686.27 kB = 151.28 kB 150.73 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.js = 689.37 kB 686.25 kB = 151.25 kB 150.70 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js = 124.00 kB 123.41 kB = 37.93 kB 37.76 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.min.js = 123.97 kB 123.38 kB = 37.91 kB 37.73 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.js = 614.83 kB 611.85 kB = 137.58 kB 137.09 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.js = 614.80 kB 611.82 kB = 137.55 kB 137.06 kB
oss-stable/react-art/cjs/react-art.production.js = 603.71 kB 600.73 kB = 134.77 kB 134.27 kB
oss-stable-semver/react-art/cjs/react-art.production.js = 603.68 kB 600.70 kB = 134.75 kB 134.25 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js = 114.95 kB 114.37 kB = 35.55 kB 35.37 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.min.js = 114.92 kB 114.34 kB = 35.53 kB 35.35 kB
oss-stable/react-dom/umd/react-dom-server-legacy.browser.development.js = 443.30 kB 441.03 kB = 96.50 kB 96.08 kB
oss-stable-semver/react-dom/umd/react-dom-server-legacy.browser.development.js = 443.28 kB 441.01 kB = 96.48 kB 96.06 kB
oss-stable/react-dom/umd/react-dom-server.browser.development.js = 442.65 kB 440.38 kB = 96.59 kB 96.17 kB
oss-stable-semver/react-dom/umd/react-dom-server.browser.development.js = 442.62 kB 440.35 kB = 96.57 kB 96.15 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js = 109.78 kB 109.21 kB = 33.95 kB 33.79 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.production.min.js = 109.73 kB 109.16 kB = 33.93 kB 33.76 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.node.development.js = 425.19 kB 422.97 kB = 95.97 kB 95.54 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.node.development.js = 425.16 kB 422.95 kB = 95.95 kB 95.52 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js = 109.49 kB 108.92 kB = 33.55 kB 33.41 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.min.js = 109.44 kB 108.87 kB = 33.52 kB 33.39 kB
oss-stable/react-dom/cjs/react-dom-server-legacy.browser.development.js = 423.47 kB 421.25 kB = 95.54 kB 95.11 kB
oss-stable-semver/react-dom/cjs/react-dom-server-legacy.browser.development.js = 423.44 kB 421.23 kB = 95.51 kB 95.08 kB
oss-stable/react-dom/cjs/react-dom-server.edge.development.js = 423.41 kB 421.19 kB = 95.76 kB 95.33 kB
oss-stable-semver/react-dom/cjs/react-dom-server.edge.development.js = 423.38 kB 421.17 kB = 95.74 kB 95.31 kB
oss-stable/react-dom/cjs/react-dom-server.browser.development.js = 422.82 kB 420.61 kB = 95.63 kB 95.20 kB
oss-stable-semver/react-dom/cjs/react-dom-server.browser.development.js = 422.80 kB 420.58 kB = 95.61 kB 95.17 kB
oss-stable/react-dom/cjs/react-dom-server.node.development.js = 421.73 kB 419.51 kB = 94.50 kB 94.07 kB
oss-stable-semver/react-dom/cjs/react-dom-server.node.development.js = 421.70 kB 419.48 kB = 94.48 kB 94.05 kB
oss-stable-semver/react-server/cjs/react-server.production.min.js = 38.07 kB 37.86 kB = 12.12 kB 12.05 kB
oss-stable/react-server/cjs/react-server.production.min.js = 38.07 kB 37.86 kB = 12.12 kB 12.05 kB
oss-stable/react-art/umd/react-art.development.js = 965.93 kB 960.80 kB = 202.97 kB 202.13 kB
oss-stable-semver/react-art/umd/react-art.development.js = 965.90 kB 960.77 kB = 202.94 kB 202.11 kB
oss-stable/react-dom/cjs/react-dom-server.bun.development.js = 417.16 kB 414.94 kB = 93.61 kB 93.18 kB
oss-stable-semver/react-dom/cjs/react-dom-server.bun.development.js = 417.14 kB 414.92 kB = 93.59 kB 93.16 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js = 944.37 kB 939.31 kB = 202.38 kB 201.45 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.development.js = 944.35 kB 939.29 kB = 202.36 kB 201.42 kB
react-native/implementations/ReactNativeRenderer-dev.js = 989.46 kB 983.94 kB = 198.94 kB 198.05 kB
react-native/implementations/ReactFabric-dev.js = 974.56 kB 969.04 kB = 195.25 kB 194.38 kB
oss-stable/react-art/cjs/react-art.production.min.js = 100.79 kB 100.22 kB = 30.88 kB 30.75 kB
oss-stable-semver/react-art/cjs/react-art.production.min.js = 100.74 kB 100.17 kB = 30.85 kB 30.72 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js = 875.21 kB 870.23 kB = 183.66 kB 182.82 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.development.js = 875.18 kB 870.20 kB = 183.62 kB 182.79 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js = 835.74 kB 830.95 kB = 181.67 kB 180.78 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.development.js = 835.72 kB 830.93 kB = 181.64 kB 180.75 kB
oss-stable/react-art/cjs/react-art.development.js = 849.08 kB 844.15 kB = 183.73 kB 182.90 kB
oss-stable-semver/react-art/cjs/react-art.development.js = 849.05 kB 844.13 kB = 183.70 kB 182.87 kB
oss-experimental/react-server/cjs/react-server.development.js = 209.48 kB 208.24 kB = 48.68 kB 48.36 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
oss-stable-semver/react-server/cjs/react-server.development.js = 200.90 kB 198.69 kB = 47.14 kB 46.72 kB
oss-stable/react-server/cjs/react-server.development.js = 200.90 kB 198.69 kB = 47.14 kB 46.72 kB
test_utils/ReactAllWarnings.js Deleted 65.05 kB 0.00 kB Deleted 16.26 kB 0.00 kB

Generated by 🚫 dangerJS against 081a4a9

@@ -53,7 +52,6 @@ export function describeFiber(
case SuspenseListComponent:
return describeBuiltInComponentFrame('SuspenseList', owner);
case FunctionComponent:
case IndeterminateComponent:
Copy link
Contributor

Choose a reason for hiding this comment

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

We should keep it here for compatibility with React versions < 19

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good call, thanks!

@@ -220,7 +220,7 @@ export function getInternalReactConstants(version: string): {
HostSingleton: 27, // Same as above
HostText: 6,
IncompleteClassComponent: 17,
IndeterminateComponent: 2,
IndeterminateComponent: 2, // removed in 19.0.0
Copy link
Contributor

@hoxyq hoxyq Nov 23, 2023

Choose a reason for hiding this comment

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

I think better way is to add an extra gte(version, '19.0.0') check at the top of these if / else statements, which will return the same ReactTypeOfWork, but with IndeterminateComponent: -1 // Removed.

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 originally did this but Seb pointed out, and I think this makes sense, that we really only need to create a new config by version when we modify the number used for a certain kind of component. In 19 there simply will be no IndeterminateComponent's in the tree but we don't really need to enforce this via devtools so we can just mark this as removed in a comment and if we have some other motivation to clean this up in the future we can get rid of it then.

It'd be interesting as an exercise to potentially collapse the config to be only when the tag numbers changed, it might make the tool slightly smaller and we'd have fewer branches for this tag map

Copy link
Member

@kassens kassens left a comment

Choose a reason for hiding this comment

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

Neat

@@ -1338,7 +1336,7 @@ let hasWarnedAboutUsingContextAsConsumer = false;

// This would typically be a function component but we still support module pattern
Copy link
Member

Choose a reason for hiding this comment

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

old comment

@@ -55,7 +55,6 @@ export const enableSuspenseCallback = false;
export const disableLegacyContext = false;
export const enableTrustedTypesIntegration = false;
export const disableTextareaChildren = false;
export const disableModulePatternComponents = false;
Copy link
Member

Choose a reason for hiding this comment

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

The PR needs to rebase on #27739 and should wait for that feature flag to be enabled.

@gnoff gnoff force-pushed the remove-indeterminate-components branch 2 times, most recently from ad0f5a6 to 2e5b24b Compare November 29, 2023 20:37
kassens added a commit that referenced this pull request Dec 6, 2023
#27742 will remove this feature flag altogether, this just already
removes the dynamic flag for the Meta React Native build ahead of time.
@gnoff gnoff added the React 19 label Mar 13, 2024
@gnoff gnoff force-pushed the remove-indeterminate-components branch 3 times, most recently from 732f992 to 4f22516 Compare March 28, 2024 16:08
@gnoff
Copy link
Collaborator Author

gnoff commented Mar 28, 2024

@kassens @rickhanlonii I rebased on main. This PR removes the flag entirely. Are we blocked on landing this because of RN?

…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.
@gnoff gnoff force-pushed the remove-indeterminate-components branch from 4f22516 to 081a4a9 Compare March 28, 2024 16:13
@rickhanlonii
Copy link
Member

@gnoff no we can remove

@gnoff gnoff merged commit cc56bed into facebook:main Mar 28, 2024
38 checks passed
@gnoff gnoff deleted the remove-indeterminate-components branch March 28, 2024 20:08
github-actions bot pushed a commit that referenced this pull request Mar 28, 2024
The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern. It also simplifies a number of code paths in
particular related to the concept of `IndeterminateComponent` types.

DiffTrain build for [cc56bed](cc56bed)
rickhanlonii added a commit that referenced this pull request Mar 29, 2024
kassens added a commit to kassens/react that referenced this pull request Mar 29, 2024
> This is a redo of facebook#27742, but only including the flag removal, excluding further simplifications.

The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern.
kassens added a commit to kassens/react that referenced this pull request Mar 29, 2024
> This is a redo of facebook#27742, but only including the flag removal, excluding further simplifications.

The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern.
kassens added a commit to kassens/react that referenced this pull request Mar 29, 2024
> This is a redo of facebook#27742, but only including the flag removal, excluding further simplifications.

The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern.
kassens added a commit that referenced this pull request Mar 29, 2024
Remove module pattern function component support (flag only)

> This is a redo of #27742, but only including the flag removal,
excluding further simplifications.

The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern.
github-actions bot pushed a commit that referenced this pull request Mar 29, 2024
Remove module pattern function component support (flag only)

> This is a redo of #27742, but only including the flag removal,
excluding further simplifications.

The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern.

DiffTrain build for [a73c345](a73c345)
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
)

facebook#27742 will remove this feature flag altogether, this just already
removes the dynamic flag for the Meta React Native build ahead of time.
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern. It also simplifies a number of code paths in
particular related to the concept of `IndeterminateComponent` types.
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
…k#28671)

Remove module pattern function component support (flag only)

> This is a redo of facebook#27742, but only including the flag removal,
excluding further simplifications.

The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern.
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
#27742 will remove this feature flag altogether, this just already
removes the dynamic flag for the Meta React Native build ahead of time.

DiffTrain build for commit be8aa76.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern. It also simplifies a number of code paths in
particular related to the concept of `IndeterminateComponent` types.

DiffTrain build for commit cc56bed.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
Remove module pattern function component support (flag only)

> This is a redo of #27742, but only including the flag removal,
excluding further simplifications.

The module pattern

```
function MyComponent() {
  return {
    render() {
      return this.state.foo
    }
  }
}
```

has been deprecated for approximately 5 years now. This PR removes
support for this pattern.

DiffTrain build for commit a73c345.
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 React 19
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants