Skip to content

fix: explicit defaults for all ReactNativeFeatureFlags (#24)#25

Merged
srsholmes merged 1 commit into
mainfrom
fix/issue-24-feature-flags
May 1, 2026
Merged

fix: explicit defaults for all ReactNativeFeatureFlags (#24)#25
srsholmes merged 1 commit into
mainfrom
fix/issue-24-feature-flags

Conversation

@srsholmes

Copy link
Copy Markdown
Owner

Closes #24.

Summary

  • The Proxy-only mock left every flag except isLayoutAnimationEnabled absent as an own-property, so named imports, Object.keys, and object spreads could miss enableNativeCSSParsing and the other ~100 flags.
  • Enumerate every flag from RN 0.83 with its real default value (booleans, the numeric preparedTextCacheSize/viewCullingOutsetRatio/virtualViewHysteresisRatio/virtualViewPrerenderRatio, the string virtualViewActivityBehavior, and override).
  • Keep the existing Proxy fallback so flags added in future RN releases still degrade to () => false without a setup.ts edit.

Test plan

  • pnpm test:run — 809/809 passing across 63 files
  • pnpm typecheck — clean
  • pnpm lint — no new findings (5 pre-existing warnings in apps/example-app/__parity-tests__/test-utils.ts)
  • pnpm build — succeeds
  • FeatureFlags.spec.tsx extended to cover non-boolean defaults, Object.keys / spread enumeration, and the original enableNativeCSSParsing regression.

🤖 Generated with Claude Code

The Proxy-only mock left every flag except isLayoutAnimationEnabled
absent as own-properties, so named imports / Object.keys / spreads
could miss enableNativeCSSParsing and other flags. Enumerate every
flag from RN 0.83 with its real default and keep the Proxy fallback
for future flags.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@srsholmes srsholmes merged commit 86a933e into main May 1, 2026
2 checks passed
srsholmes added a commit that referenced this pull request May 1, 2026
PR #25 was merged without a changeset, so the fix would not appear in any
release. Adding a retroactive changeset so it ships in the same patch
release as the cache race-condition fix in this PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insufficient mock for ReactNativeFeatureFlags

1 participant