Skip to content

Remove non-bridgeless code paths from ReactDelegate / ReactActivityDelegate / ReactActivity / ReactFragment#57000

Open
mdvacca wants to merge 2 commits into
facebook:mainfrom
mdvacca:export-D106719840
Open

Remove non-bridgeless code paths from ReactDelegate / ReactActivityDelegate / ReactActivity / ReactFragment#57000
mdvacca wants to merge 2 commits into
facebook:mainfrom
mdvacca:export-D106719840

Conversation

@mdvacca
Copy link
Copy Markdown
Contributor

@mdvacca mdvacca commented May 29, 2026

Summary:
Third in a stack that collapses Android-side branches on ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture() under the standing assumption that on Android the flag is always true. The underlying generated ReactNativeFeatureFlags.enableBridgelessArchitecture() is untouched.

This is the cascade cleanup: with every lifecycle method in ReactDelegate always taking the ReactHost path, the fields, constructors, and helper methods that exist only to support the ReactNativeHost/ReactInstanceManager (bridge) path are now dead.

Removed from ReactDelegate:

  • The deprecated 4-arg (Activity, ReactNativeHost?, String?, Bundle?) constructor
  • The deprecated 5-arg (Activity, ReactNativeHost?, String?, Bundle?, Boolean) constructor
  • getReactInstanceManager() (was reading through the removed ReactNativeHost)
  • createRootView() (only the legacy loadApp branch called it)
  • isFabricEnabled (only createRootView read it)
  • internalReactRootView field and the corresponding reactRootView setter (the property is now a val returning reactSurface?.view)
  • The private reactNativeHost field

Every public lifecycle method (onHostResume, onUserLeaveHint, onHostPause, onHostDestroy, onBackPressed, onNewIntent, onActivityResult, onWindowFocusChanged, onConfigurationChanged, onKeyDown, onKeyLongPress, reload, loadApp, unloadApp, currentReactContext) collapses to the ReactHost-only path.

Removed from ReactActivityDelegate:

  • getReactNativeHost() and getReactInstanceManager() (both deprecated, fed the dead ReactDelegate machinery)
  • setReactRootView(ReactRootView) (matched the removed ReactDelegate.reactRootView setter)
  • The non-bridgeless branch in onCreate (the anonymous-subclass override of createRootView goes with it)
  • The non-bridgeless branch in onRequestPermissionsResult

Removed from ReactActivity:

  • getReactNativeHost() and getReactInstanceManager() (matched the delegate removals)

Removed from ReactFragment:

  • The reactNativeHost property
  • The non-bridgeless branch in onCreate (the ARG_FABRIC_ENABLED argument is now ignored; the constant + Builder API remain for backward compatibility)

ReactAndroid.api regenerated to reflect the 12 removed public/protected methods. arc f auto-removed the now-unused ReactNativeNewArchitectureFeatureFlags imports.

Subsequent diff in the stack will handle the wrapper method + lint detector.

Changelog:
[Android][Breaking] - Remove deprecated ReactDelegate(Activity, ReactNativeHost, String, Bundle) and ReactDelegate(Activity, ReactNativeHost, String, Bundle, boolean) constructors. Use the ReactHost constructor instead.
[Android][Breaking] - Remove ReactDelegate.getReactInstanceManager(), ReactDelegate.createRootView(), ReactDelegate.isFabricEnabled, and the ReactDelegate.reactRootView setter.
[Android][Breaking] - Remove ReactActivityDelegate.getReactNativeHost(), ReactActivityDelegate.getReactInstanceManager(), and ReactActivityDelegate.setReactRootView(ReactRootView). Use getReactHost() and setReactSurface(ReactSurface) instead.
[Android][Breaking] - Remove ReactActivity.getReactNativeHost() and ReactActivity.getReactInstanceManager(). Use getReactHost() instead.
[Android][Breaking] - Remove ReactFragment.reactNativeHost property. Use reactHost instead.

Reviewed By: christophpurrer

Differential Revision: D106719840

mdvacca added 2 commits May 29, 2026 09:55
…le call sites (facebook#56999)

Summary:

Second in a stack that collapses Android-side branches on `ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture()` under the standing assumption that on Android the flag is always `true`. The underlying generated `ReactNativeFeatureFlags.enableBridgelessArchitecture()` is untouched.

Scope of this commit — ReactAndroid simple call sites:

- `DevSupportManagerBase` — drop the flag from the AND chain that gates `PerfMonitorOverlayManager` creation.
- `HeadlessJsTaskService.reactContext` getter and `createReactContextAndScheduleTask` — keep the `reactHost` branches; drop the `reactInstanceManager` fallbacks.
- `ViewManager.getNativeProps` — drop the flag from the AND with `UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE`.
- `ReactImageView` — delete the `warnImageSource` helper and its two call sites. The helper existed only to emit a debug warning that was already gated off in bridgeless mode.
- `ReactEditText.onConfigurationChanged` — drop the flag from the AND with `enableFontScaleChangesUpdatingLayout`.
- `ReactHostImpl.getOrCreateStartTask` — drop the always-true debug assertion.
- `DefaultNewArchitectureEntryPoint.loadWithFeatureFlags` — set `privateBridgelessEnabled = true` directly (was reading from the provider).
- `ReactPackageTurboModuleManagerDelegate.shouldEnableLegacyModuleInterop` — drop the flag from the AND with `useTurboModuleInterop`.

No public API surfaces change. `arc f` auto-removed the now-unused `ReactNativeNewArchitectureFeatureFlags` imports in the affected files.

Subsequent diffs in the stack will handle: `ReactDelegate` + deprecated constructors + `reactNativeHost` field; wrapper method + lint detector.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D106719839
…yDelegate` / `ReactActivity` / `ReactFragment`

Summary:
Third in a stack that collapses Android-side branches on `ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture()` under the standing assumption that on Android the flag is always `true`. The underlying generated `ReactNativeFeatureFlags.enableBridgelessArchitecture()` is untouched.

This is the cascade cleanup: with every lifecycle method in `ReactDelegate` always taking the `ReactHost` path, the fields, constructors, and helper methods that exist only to support the `ReactNativeHost`/`ReactInstanceManager` (bridge) path are now dead.

Removed from `ReactDelegate`:
- The deprecated 4-arg `(Activity, ReactNativeHost?, String?, Bundle?)` constructor
- The deprecated 5-arg `(Activity, ReactNativeHost?, String?, Bundle?, Boolean)` constructor
- `getReactInstanceManager()` (was reading through the removed `ReactNativeHost`)
- `createRootView()` (only the legacy `loadApp` branch called it)
- `isFabricEnabled` (only `createRootView` read it)
- `internalReactRootView` field and the corresponding `reactRootView` setter (the property is now a `val` returning `reactSurface?.view`)
- The private `reactNativeHost` field

Every public lifecycle method (`onHostResume`, `onUserLeaveHint`, `onHostPause`, `onHostDestroy`, `onBackPressed`, `onNewIntent`, `onActivityResult`, `onWindowFocusChanged`, `onConfigurationChanged`, `onKeyDown`, `onKeyLongPress`, `reload`, `loadApp`, `unloadApp`, `currentReactContext`) collapses to the `ReactHost`-only path.

Removed from `ReactActivityDelegate`:
- `getReactNativeHost()` and `getReactInstanceManager()` (both deprecated, fed the dead `ReactDelegate` machinery)
- `setReactRootView(ReactRootView)` (matched the removed `ReactDelegate.reactRootView` setter)
- The non-bridgeless branch in `onCreate` (the anonymous-subclass override of `createRootView` goes with it)
- The non-bridgeless branch in `onRequestPermissionsResult`

Removed from `ReactActivity`:
- `getReactNativeHost()` and `getReactInstanceManager()` (matched the delegate removals)

Removed from `ReactFragment`:
- The `reactNativeHost` property
- The non-bridgeless branch in `onCreate` (the `ARG_FABRIC_ENABLED` argument is now ignored; the constant + Builder API remain for backward compatibility)

`ReactAndroid.api` regenerated to reflect the 12 removed public/protected methods. `arc f` auto-removed the now-unused `ReactNativeNewArchitectureFeatureFlags` imports.

Subsequent diff in the stack will handle the wrapper method + lint detector.

Changelog:
[Android][Breaking] - Remove deprecated `ReactDelegate(Activity, ReactNativeHost, String, Bundle)` and `ReactDelegate(Activity, ReactNativeHost, String, Bundle, boolean)` constructors. Use the `ReactHost` constructor instead.
[Android][Breaking] - Remove `ReactDelegate.getReactInstanceManager()`, `ReactDelegate.createRootView()`, `ReactDelegate.isFabricEnabled`, and the `ReactDelegate.reactRootView` setter.
[Android][Breaking] - Remove `ReactActivityDelegate.getReactNativeHost()`, `ReactActivityDelegate.getReactInstanceManager()`, and `ReactActivityDelegate.setReactRootView(ReactRootView)`. Use `getReactHost()` and `setReactSurface(ReactSurface)` instead.
[Android][Breaking] - Remove `ReactActivity.getReactNativeHost()` and `ReactActivity.getReactInstanceManager()`. Use `getReactHost()` instead.
[Android][Breaking] - Remove `ReactFragment.reactNativeHost` property. Use `reactHost` instead.

Reviewed By: christophpurrer

Differential Revision: D106719840
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 29, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 29, 2026

@mdvacca has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106719840.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant