Skip to content

fix: enable JavaScript fallback on Windows - #10117

Open
hsjoberg wants to merge 1 commit into
software-mansion:mainfrom
hsjoberg:fix-windows-js
Open

fix: enable JavaScript fallback on Windows#10117
hsjoberg wants to merge 1 commit into
software-mansion:mainfrom
hsjoberg:fix-windows-js

Conversation

@hsjoberg

@hsjoberg hsjoberg commented Aug 2, 2026

Copy link
Copy Markdown

Note

This pull request was authored by AI on behalf of @hsjoberg.

Summary

Hey. Reanimated previously routed React Native Windows through the JavaScript implementation introduced in #4917.

The fallback regressed after #8371 moved Worklets' native implementation to .native.ts files. Metro considers Windows a native platform and therefore selects .native before the unsuffixed JavaScript implementation. Before that change, IS_WINDOWS was included in SHOULD_BE_USE_WEB, causing Windows to select JSWorklets. Metro now selects NativeWorklets.native.ts, which expects a native Worklets module that React Native Windows does not provide.

#9893 later introduced the same platform split inside Reanimated.


Restoring the PlatformChecker.ts approach as was previously used in #4917 and #4669 seems inadequate for the current codebase structure, because Metro resolves the .native module before that runtime check can execute.
This PR therefore extends wrapWithReanimatedMetroConfig so that internal relative imports from Reanimated and Worklets do not prefer .native files on Windows.

Windows-specific .windows files are still considered, followed by the unsuffixed JavaScript fallback. Resolution outside these two packages is unchanged, and existing custom Metro resolvers are preserved.

Test plan

  • Added focused tests covering Reanimated and Worklets imports on Windows.
  • Verified non-Windows, package, and external imports retain normal resolution.
  • Verified delegation to both custom and default Metro resolvers.
  • Bundled and ran blixt-wallet with React Native Windows 0.85.3 (new arch).
  • Confirmed no Reanimated or Worklets .native modules are selected.
  • Confirmed the JavaScript fallback works at runtime.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b993c44c-9172-4640-b2c2-9f33998698d3

📥 Commits

Reviewing files that changed from the base of the PR and between 993c65e and 5cdbf38.

📒 Files selected for processing (3)
  • docs/docs-reanimated/docs/debugging/accurate-call-stacks.mdx
  • packages/react-native-reanimated/__tests__/metroConfig.test.js
  • packages/react-native-reanimated/metro-config/index.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/react-native-reanimated/metro-config/index.js
  • docs/docs-reanimated/docs/debugging/accurate-call-stacks.mdx
  • packages/react-native-reanimated/tests/metroConfig.test.js

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Metro configuration now selects JavaScript Reanimated and Worklets implementations for matching React Native Windows imports. Tests cover resolver behavior, context preservation, pass-through cases, and default-resolver delegation. Documentation describes the fallback and its lack of native animations and a native Worklets runtime.

Merge Risk: ⚪ Minimal · up to 5cdbf

This PR adjusts Windows module resolution to use the JavaScript fallback for Reanimated and Worklets while preserving normal behavior elsewhere; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes enabling the JavaScript fallback on Windows.
Description check ✅ Passed The description accurately explains the Windows fallback, Metro resolution changes, tests, and runtime verification.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Keep Windows platform resolution while disabling Metro's native preference for
internal Reanimated and Worklets imports. This avoids selecting unsupported
native implementations and preserves custom resolver delegation.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant