Skip to content

Commit

Permalink
[RN] Use microtasks when using bridgeless mode in React Native Fabric…
Browse files Browse the repository at this point in the history
… renderer (OSS version)
  • Loading branch information
rubennorte committed Mar 8, 2024
1 parent 338dddc commit 52e7313
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,12 @@ module.exports = {
nativeFabricUIManager: 'readonly',
},
},
{
files: ['packages/shared/forks/**/*.js'],
globals: {
RN$Bridgeless: 'readonly',
},
},
{
files: ['packages/react-server-dom-webpack/**/*.js'],
globals: {
Expand Down
5 changes: 4 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ export const enableAsyncActions = false;

export const alwaysThrottleRetries = false;

export const useMicrotasksForSchedulingInFabric = false;
const isBridgeless: boolean =
typeof RN$Bridgeless !== 'undefined' && !!RN$Bridgeless;

export const useMicrotasksForSchedulingInFabric = isBridgeless;
export const passChildrenWhenCloningPersistedNodes = false;
export const enableUseDeferredValueInitialArg = __EXPERIMENTAL__;
export const disableClientCache = true;
Expand Down
2 changes: 2 additions & 0 deletions scripts/flow/react-native-host-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface'
declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore' {
}

declare const RN$Bridgeless: boolean;

// This is needed for a short term solution.
// See https://github.com/facebook/react/pull/15490 for more info
declare var nativeFabricUIManager: {
Expand Down
2 changes: 2 additions & 0 deletions scripts/rollup/validate/eslintrc.rn.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ module.exports = {
// Fabric. See https://github.com/facebook/react/pull/15490
// for more information
nativeFabricUIManager: 'readonly',
// RN Bridgeless mode flag
RN$Bridgeless: 'readonly',
// Trusted Types
trustedTypes: 'readonly',
// RN supports this
Expand Down

0 comments on commit 52e7313

Please sign in to comment.