From 90817f8810da9d993bf93a75b673399b112af67e Mon Sep 17 00:00:00 2001 From: Ricky Date: Mon, 27 Oct 2025 17:38:56 -0400 Subject: [PATCH] [rn] delete the legacy renderers from the sync (#34946) Now that RN is only on the New Architecture, we can stop stop syncing the legacy React Native renderers. In this diff, I just stop syncing them. In a follow up I'll delete the code for them so only Fabric is left. This will also allow us to remove the `enableLegacyMode` feature flag. --- .../workflows/runtime_commit_artifacts.yml | 7 ++-- packages/react-native-renderer/index.js | 1 + packages/react-reconciler/README.md | 2 +- scripts/rollup/bundles.js | 36 ------------------- .../rollup/shims/react-native/ReactNative.js | 1 + 5 files changed, 8 insertions(+), 39 deletions(-) diff --git a/.github/workflows/runtime_commit_artifacts.yml b/.github/workflows/runtime_commit_artifacts.yml index b982d561ed..2809df1815 100644 --- a/.github/workflows/runtime_commit_artifacts.yml +++ b/.github/workflows/runtime_commit_artifacts.yml @@ -162,10 +162,13 @@ jobs: mv build/facebook-react-native/react-is/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/react-is/ mv build/facebook-react-native/react-test-renderer/cjs/ $BASE_FOLDER/RKJSModules/vendor/react/react-test-renderer/ - # Delete OSS renderer. OSS renderer is synced through internal script. + # Delete the OSS renderers, these are sync'd to RN separately. RENDERER_FOLDER=$BASE_FOLDER/react-native-github/Libraries/Renderer/implementations/ + SHIM_FOLDER=$BASE_FOLDER/react-native-github/Libraries/Renderer/shims/ rm $RENDERER_FOLDER/ReactFabric-{dev,prod,profiling}.js - rm $RENDERER_FOLDER/ReactNativeRenderer-{dev,prod,profiling}.js + + # Delete the legacy renderer shim, this is not sync'd and will get deleted in the future. + rm $SHIM_FOLDER/ReactNative.js # Copy eslint-plugin-react-hooks # NOTE: This is different from www, here we include the full package diff --git a/packages/react-native-renderer/index.js b/packages/react-native-renderer/index.js index ecc5e58c3d..131c066ff4 100644 --- a/packages/react-native-renderer/index.js +++ b/packages/react-native-renderer/index.js @@ -12,4 +12,5 @@ import * as ReactNative from './src/ReactNativeRenderer'; // Assert that the exports line up with the type we're going to expose. (ReactNative: ReactNativeType); +// TODO: Delete the legacy renderer, only Fabric is used now. export * from './src/ReactNativeRenderer'; diff --git a/packages/react-reconciler/README.md b/packages/react-reconciler/README.md index b30387c591..82080513a4 100644 --- a/packages/react-reconciler/README.md +++ b/packages/react-reconciler/README.md @@ -59,7 +59,7 @@ The examples in the React repository are declared a bit differently than a third * [React ART](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactART.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactFiberConfigART.js) * [React DOM](https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOM.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js) -* [React Native](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeRenderer.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFiberConfigNative.js) +* [React Native](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFabric.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFiberConfigFabric.js) If these links break please file an issue and we’ll fix them. They intentionally link to the latest versions since the API is still evolving. If you have more questions please file an issue and we’ll try to help! diff --git a/scripts/rollup/bundles.js b/scripts/rollup/bundles.js index 0a7b17ec2c..69d0b534fc 100644 --- a/scripts/rollup/bundles.js +++ b/scripts/rollup/bundles.js @@ -819,42 +819,6 @@ const bundles = [ }), }, - /******* React Native *******/ - { - bundleTypes: __EXPERIMENTAL__ - ? [] - : [RN_FB_DEV, RN_FB_PROD, RN_FB_PROFILING], - moduleType: RENDERER, - entry: 'react-native-renderer', - global: 'ReactNativeRenderer', - externals: ['react-native', 'ReactNativeInternalFeatureFlags'], - minifyWithProdErrorCodes: false, - wrapWithModuleBoundaries: true, - babel: opts => - Object.assign({}, opts, { - plugins: opts.plugins.concat([ - [require.resolve('@babel/plugin-transform-classes'), {loose: true}], - ]), - }), - }, - { - bundleTypes: [RN_OSS_DEV, RN_OSS_PROD, RN_OSS_PROFILING], - moduleType: RENDERER, - entry: 'react-native-renderer', - global: 'ReactNativeRenderer', - // ReactNativeInternalFeatureFlags temporary until we land enableRemoveConsolePatches. - // Needs to be done before the next RN OSS release. - externals: ['react-native', 'ReactNativeInternalFeatureFlags'], - minifyWithProdErrorCodes: false, - wrapWithModuleBoundaries: true, - babel: opts => - Object.assign({}, opts, { - plugins: opts.plugins.concat([ - [require.resolve('@babel/plugin-transform-classes'), {loose: true}], - ]), - }), - }, - /******* React Native Fabric *******/ { bundleTypes: __EXPERIMENTAL__ diff --git a/scripts/rollup/shims/react-native/ReactNative.js b/scripts/rollup/shims/react-native/ReactNative.js index 82c062bb85..4e7ab19ae6 100644 --- a/scripts/rollup/shims/react-native/ReactNative.js +++ b/scripts/rollup/shims/react-native/ReactNative.js @@ -14,6 +14,7 @@ import type {ReactNativeType} from './ReactNativeTypes'; let ReactNative: ReactNativeType; +// TODO: Delete the legacy renderer. Only ReactFabric is used now. if (__DEV__) { ReactNative = require('../implementations/ReactNativeRenderer-dev'); } else {