Skip to content

Commit

Permalink
[React Native FB] dynamic feature flag for ref access warning (facebo…
Browse files Browse the repository at this point in the history
  • Loading branch information
kassens authored Oct 14, 2022
1 parent fd31724 commit ea5bc6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
* @flow strict
*/

// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.

// import typeof * as ExportsType from './ReactFeatureFlags.native-fb-dynamic';
// import typeof * as DynamicFlagsType from 'ReactNativeInternalFeatureFlags';
import typeof * as ExportsType from './ReactFeatureFlags.native-fb-dynamic';
import typeof * as DynamicFlagsType from 'ReactNativeInternalFeatureFlags';

// In xplat, these flags are controlled by GKs. Because most GKs have some
// population running in either mode, we should run our tests that way, too,
Expand All @@ -22,5 +20,7 @@
// flag here but it won't be set to `true` in any of our test runs. Need to
// update the test configuration.

// // Flow magic to verify the exports of this file match the original version.
// ((((null: any): ExportsType): FeatureFlagsType): ExportsType);
export const enableUseRefAccessWarning = __VARIANT__;

// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): DynamicFlagsType): ExportsType);
5 changes: 2 additions & 3 deletions packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import typeof * as ExportsType from './ReactFeatureFlags.native-fb';
// NOTE: There are no flags, currently. Uncomment the stuff below if we add one.
// Re-export dynamic flags from the internal module. Intentionally using *
// because this import is compiled to a `require` call.
// import * as dynamicFlags from 'ReactNativeInternalFeatureFlags';
import * as dynamicFlags from 'ReactNativeInternalFeatureFlags';

// We destructure each value before re-exporting to avoid a dynamic look-up on
// the exports object every time a flag is read.
// export const {} = dynamicFlags;
export const {enableUseRefAccessWarning} = dynamicFlags;

// The rest of the flags are static for better dead code elimination.
export const enableDebugTracing = false;
Expand Down Expand Up @@ -67,7 +67,6 @@ export const deferRenderPhaseUpdateToNextBatch = false;

export const enableStrictEffects = __DEV__;
export const createRootStrictEffectsByDefault = false;
export const enableUseRefAccessWarning = false;

export const disableSchedulerTimeoutInWorkLoop = false;
export const enableLazyContextPropagation = false;
Expand Down
1 change: 1 addition & 0 deletions scripts/flow/xplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
*/

declare module 'ReactNativeInternalFeatureFlags' {
declare export var enableUseRefAccessWarning: boolean;
}

0 comments on commit ea5bc6b

Please sign in to comment.