You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move .js/.node precedence fix into isNodeApiModule, dedupe plist checks
- Replace the Babel-transform-time require.resolve() guard with a check
inside isNodeApiModule itself, so the fix lives in the shared utility
(also used by findNodeAddonForBindings) instead of duplicating Node's
module resolution algorithm via a second, independent code path that
could diverge from what Metro actually resolves at runtime.
- Verify the Info.plist contents with a zod schema instead of ad hoc
"in" checks on an untyped object, matching how the rest of the repo
validates untrusted structured data.
- Reuse the exported escapeBundleIdentifier instead of re-deriving the
bundle-identifier escaping regex inline in the verify script, so the
two can't silently drift apart.
Closes#424
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q1k6UQJPPaqKEKmnsRUatt
Copy file name to clipboardExpand all lines: .changeset/calm-bears-resolve.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,4 @@
2
2
"react-native-node-api": patch
3
3
---
4
4
5
-
Preserve Node.js module resolution precedence when a JavaScript file and native addon share a basename.
5
+
Preserve Node.js module resolution precedence when a JavaScript file and native addon share a basename: `require('./foo')` no longer gets rewritten to load a Node-API addon when a same-named `foo.js`/`.cjs`/`.mjs`/`.json` file exists alongside it, since that source file is what `require()` actually resolves to. An explicit `require('./foo.node')` is unaffected.
0 commit comments