Skip to content

Fix ownerStackLimit feature gating for tests #32726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,3 @@ export const enableUseEffectCRUDOverload = __VARIANT__;
export const enableFastAddPropertiesInDiffing = __VARIANT__;
export const enableLazyPublicInstanceInFabric = __VARIANT__;
export const renameElementSymbol = __VARIANT__;
export const ownerStackLimit: number = __VARIANT__
? // Some value that doesn't impact existing tests
500
: 1e4;
2 changes: 1 addition & 1 deletion packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const {
enableFastAddPropertiesInDiffing,
enableLazyPublicInstanceInFabric,
renameElementSymbol,
ownerStackLimit,
} = dynamicFlags;

// The rest of the flags are static for better dead code elimination.
Expand Down Expand Up @@ -85,6 +84,7 @@ export const enableViewTransition = false;
export const enableSwipeTransition = false;
export const enableScrollEndPolyfill = true;
export const enableFragmentRefs = false;
export const ownerStackLimit = 1e4;

// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
5 changes: 0 additions & 5 deletions packages/shared/forks/ReactFeatureFlags.www-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ export const enableComponentPerformanceTrack = __VARIANT__;
export const enableScrollEndPolyfill = __VARIANT__;
export const enableFragmentRefs = __VARIANT__;

export const ownerStackLimit: number = __VARIANT__
? // Some value that doesn't impact existing tests
500
: 1e4;

// TODO: These flags are hard-coded to the default values used in open source.
// Update the tests so that they pass in either mode, then set these
// to __VARIANT__.
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const {
enableComponentPerformanceTrack,
enableScrollEndPolyfill,
enableFragmentRefs,
ownerStackLimit,
} = dynamicFeatureFlags;

// On WWW, __EXPERIMENTAL__ is used for a new modern build.
Expand Down Expand Up @@ -115,5 +114,7 @@ export const enableLazyPublicInstanceInFabric = false;

export const enableSwipeTransition = false;

export const ownerStackLimit = 1e4;

// Flow magic to verify the exports of this file match the original version.
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
3 changes: 3 additions & 0 deletions scripts/jest/setupTests.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jest.mock('shared/ReactFeatureFlags', () => {
// we remove the flag.
actual.disableClientCache = __VARIANT__;

// Some value that doesn't impact existing tests
actual.ownerStackLimit = __VARIANT__ ? 500 : 1e4;

return actual;
});

Expand Down
3 changes: 3 additions & 0 deletions scripts/jest/setupTests.xplat.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jest.mock('shared/ReactFeatureFlags', () => {
actual.enableScopeAPI = true;
actual.enableTaint = false;

// Some value that doesn't impact existing tests
actual.ownerStackLimit = __VARIANT__ ? 500 : 1e4;

return actual;
});

Expand Down
Loading