Skip to content

Commit

Permalink
Change default for bridgeless-init related feature flags (#47567)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #47567

Changelog: [Android][Changed] Invocations to JS will now invoke their callbacks immediately if the instance is ready. Surface starts will not wait for the main thread to become available to dispatch the work in JS.

Reviewed By: rshest

Differential Revision: D65661888

fbshipit-source-id: c67802bd56fac6bc6c145b96d823274e2b97de69
  • Loading branch information
javache authored and facebook-github-bot committed Nov 13, 2024
1 parent 663b5f9 commit 9fa4845
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<d2d9a8abf3e0be78bbe20c44fce1011d>>
* @generated SignedSource<<608eece71b01769be0df8731774f9b0a>>
*/

/**
Expand All @@ -27,7 +27,7 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean = false

override fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean = false
override fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean = true

override fun disableEventLoopOnBridgeless(): Boolean = false

Expand Down Expand Up @@ -101,7 +101,7 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi

override fun useFabricInterop(): Boolean = false

override fun useImmediateExecutorInAndroidBridgeless(): Boolean = false
override fun useImmediateExecutorInAndroidBridgeless(): Boolean = true

override fun useNativeViewConfigsInBridgelessMode(): Boolean = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<50402601a833b4a74d39733dcbd9ef65>>
* @generated SignedSource<<eb86662c826d52dc1fb97d1bdb95766a>>
*/

/**
Expand Down Expand Up @@ -36,7 +36,7 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
}

bool completeReactInstanceCreationOnBgThreadOnAndroid() override {
return false;
return true;
}

bool disableEventLoopOnBridgeless() override {
Expand Down Expand Up @@ -184,7 +184,7 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
}

bool useImmediateExecutorInAndroidBridgeless() override {
return false;
return true;
}

bool useNativeViewConfigsInBridgelessMode() override {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ const definitions: FeatureFlagDefinitions = {
},
},
completeReactInstanceCreationOnBgThreadOnAndroid: {
defaultValue: false,
defaultValue: true,
metadata: {
dateAdded: '2024-07-22',
description:
'Do not wait for a main-thread dispatch to complete init to start executing work on the JS thread on Android',
purpose: 'experimentation',
purpose: 'release',
},
},
disableEventLoopOnBridgeless: {
Expand Down Expand Up @@ -377,12 +376,11 @@ const definitions: FeatureFlagDefinitions = {
},
},
useImmediateExecutorInAndroidBridgeless: {
defaultValue: false,
defaultValue: true,
metadata: {
dateAdded: '2024-06-06',
description:
'Invoke callbacks immediately on the ReactInstance rather than going through a background thread for synchronization',
purpose: 'experimentation',
purpose: 'release',
},
},
useNativeViewConfigsInBridgelessMode: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<ee28bd585298c2e510a11433b64c76a9>>
* @generated SignedSource<<09b8ae3840a5ad419c4af9f3fcc8deec>>
* @flow strict
*/

Expand Down Expand Up @@ -199,7 +199,7 @@ export const allowRecursiveCommitsWithSynchronousMountOnAndroid: Getter<boolean>
/**
* Do not wait for a main-thread dispatch to complete init to start executing work on the JS thread on Android
*/
export const completeReactInstanceCreationOnBgThreadOnAndroid: Getter<boolean> = createNativeFlagGetter('completeReactInstanceCreationOnBgThreadOnAndroid', false);
export const completeReactInstanceCreationOnBgThreadOnAndroid: Getter<boolean> = createNativeFlagGetter('completeReactInstanceCreationOnBgThreadOnAndroid', true);
/**
* The bridgeless architecture enables the event loop by default. This feature flag allows us to force disabling it in specific instances.
*/
Expand Down Expand Up @@ -347,7 +347,7 @@ export const useFabricInterop: Getter<boolean> = createNativeFlagGetter('useFabr
/**
* Invoke callbacks immediately on the ReactInstance rather than going through a background thread for synchronization
*/
export const useImmediateExecutorInAndroidBridgeless: Getter<boolean> = createNativeFlagGetter('useImmediateExecutorInAndroidBridgeless', false);
export const useImmediateExecutorInAndroidBridgeless: Getter<boolean> = createNativeFlagGetter('useImmediateExecutorInAndroidBridgeless', true);
/**
* When enabled, the native view configs are used in bridgeless mode.
*/
Expand Down

0 comments on commit 9fa4845

Please sign in to comment.