Remove non-bridgeless code paths from ReactDelegate / ReactActivityDelegate / ReactActivity / ReactFragment#57000
Open
mdvacca wants to merge 2 commits into
Open
Remove non-bridgeless code paths from ReactDelegate / ReactActivityDelegate / ReactActivity / ReactFragment#57000mdvacca wants to merge 2 commits into
ReactDelegate / ReactActivityDelegate / ReactActivity / ReactFragment#57000mdvacca wants to merge 2 commits into
Conversation
…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
|
@mdvacca has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106719840. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Third in a stack that collapses Android-side branches on
ReactNativeNewArchitectureFeatureFlags.enableBridgelessArchitecture()under the standing assumption that on Android the flag is alwaystrue. The underlying generatedReactNativeFeatureFlags.enableBridgelessArchitecture()is untouched.This is the cascade cleanup: with every lifecycle method in
ReactDelegatealways taking theReactHostpath, the fields, constructors, and helper methods that exist only to support theReactNativeHost/ReactInstanceManager(bridge) path are now dead.Removed from
ReactDelegate:(Activity, ReactNativeHost?, String?, Bundle?)constructor(Activity, ReactNativeHost?, String?, Bundle?, Boolean)constructorgetReactInstanceManager()(was reading through the removedReactNativeHost)createRootView()(only the legacyloadAppbranch called it)isFabricEnabled(onlycreateRootViewread it)internalReactRootViewfield and the correspondingreactRootViewsetter (the property is now avalreturningreactSurface?.view)reactNativeHostfieldEvery public lifecycle method (
onHostResume,onUserLeaveHint,onHostPause,onHostDestroy,onBackPressed,onNewIntent,onActivityResult,onWindowFocusChanged,onConfigurationChanged,onKeyDown,onKeyLongPress,reload,loadApp,unloadApp,currentReactContext) collapses to theReactHost-only path.Removed from
ReactActivityDelegate:getReactNativeHost()andgetReactInstanceManager()(both deprecated, fed the deadReactDelegatemachinery)setReactRootView(ReactRootView)(matched the removedReactDelegate.reactRootViewsetter)onCreate(the anonymous-subclass override ofcreateRootViewgoes with it)onRequestPermissionsResultRemoved from
ReactActivity:getReactNativeHost()andgetReactInstanceManager()(matched the delegate removals)Removed from
ReactFragment:reactNativeHostpropertyonCreate(theARG_FABRIC_ENABLEDargument is now ignored; the constant + Builder API remain for backward compatibility)ReactAndroid.apiregenerated to reflect the 12 removed public/protected methods.arc fauto-removed the now-unusedReactNativeNewArchitectureFeatureFlagsimports.Subsequent diff in the stack will handle the wrapper method + lint detector.
Changelog:
[Android][Breaking] - Remove deprecated
ReactDelegate(Activity, ReactNativeHost, String, Bundle)andReactDelegate(Activity, ReactNativeHost, String, Bundle, boolean)constructors. Use theReactHostconstructor instead.[Android][Breaking] - Remove
ReactDelegate.getReactInstanceManager(),ReactDelegate.createRootView(),ReactDelegate.isFabricEnabled, and theReactDelegate.reactRootViewsetter.[Android][Breaking] - Remove
ReactActivityDelegate.getReactNativeHost(),ReactActivityDelegate.getReactInstanceManager(), andReactActivityDelegate.setReactRootView(ReactRootView). UsegetReactHost()andsetReactSurface(ReactSurface)instead.[Android][Breaking] - Remove
ReactActivity.getReactNativeHost()andReactActivity.getReactInstanceManager(). UsegetReactHost()instead.[Android][Breaking] - Remove
ReactFragment.reactNativeHostproperty. UsereactHostinstead.Reviewed By: christophpurrer
Differential Revision: D106719840