fix: enable JavaScript fallback on Windows - #10117
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe 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 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)
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. Comment |
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.
19f756c to
5cdbf38
Compare
|
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. |
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.tsfiles. Metro considers Windows a native platform and therefore selects.nativebefore the unsuffixed JavaScript implementation. Before that change,IS_WINDOWSwas included inSHOULD_BE_USE_WEB, causing Windows to selectJSWorklets. Metro now selectsNativeWorklets.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.tsapproach as was previously used in #4917 and #4669 seems inadequate for the current codebase structure, because Metro resolves the.nativemodule before that runtime check can execute.This PR therefore extends
wrapWithReanimatedMetroConfigso that internal relative imports from Reanimated and Worklets do not prefer.nativefiles on Windows.Windows-specific
.windowsfiles 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
.nativemodules are selected.