Skip to content

Commit a64f1fc

Browse files
committed
[RN] Use microtasks when using bridgeless mode in React Native Fabric renderer (OSS version)
1 parent 01ab35a commit a64f1fc

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,5 +533,7 @@ module.exports = {
533533
AsyncLocalStorage: 'readonly',
534534
async_hooks: 'readonly',
535535
globalThis: 'readonly',
536+
537+
RN$Bridgeless: 'readonly',
536538
},
537539
};

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ export const enableAsyncActions = false;
8282

8383
export const alwaysThrottleRetries = false;
8484

85-
export const useMicrotasksForSchedulingInFabric = false;
85+
const isBridgeless: boolean =
86+
typeof RN$Bridgeless !== 'undefined' && !!RN$Bridgeless;
87+
88+
export const useMicrotasksForSchedulingInFabric = isBridgeless;
8689
export const passChildrenWhenCloningPersistedNodes = false;
8790
export const enableUseDeferredValueInitialArg = __EXPERIMENTAL__;
8891
export const disableClientCache = true;

scripts/flow/xplat.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
* @flow
88
*/
99

10+
// eslint-disable-next-line no-unused-vars
11+
declare const RN$Bridgeless: boolean;
12+
1013
declare module 'ReactNativeInternalFeatureFlags' {
1114
declare export var alwaysThrottleRetries: boolean;
1215
declare export var enableComponentStackLocations: boolean;

scripts/rollup/validate/eslintrc.rn.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ module.exports = {
4242
// Fabric. See https://github.com/facebook/react/pull/15490
4343
// for more information
4444
nativeFabricUIManager: 'readonly',
45+
// RN Bridgeless mode flag
46+
RN$Bridgeless: 'readonly',
4547
// Trusted Types
4648
trustedTypes: 'readonly',
4749
// RN supports this

0 commit comments

Comments
 (0)