mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Restore .js fallback for legacy deep imports of untyped modules
Relocating the hand-written declarations under types_DEPRECATED/ (#57513) changed where the react-native-legacy-deep-imports export condition points for ./Libraries/*. It used to resolve to ./Libraries/*.d.ts, beside the real .js, so TypeScript's extension substitution still found modules with no hand-written declaration. It now resolves into types_DEPRECATED/, which contains no .js files, so those specifiers stop resolving. Reported against 0.88.0-rc.0 with react-native/Libraries/Core/InitializeCore. Add the old location as a second entry so the condition falls back to it. Modules that do have a declaration keep resolving to types_DEPRECATED/ because that entry is still first. This is applied to 0.88-stable only. 0.88 is a non-breaking release, so the regression must not ship in it. main intentionally keeps the current behaviour pending a deliberate decision on retiring deep imports.
This commit is contained in:
1 parent
74760de04c
commit
579212e15c
1 file changed
+4
-1
@@ -34,7 +34,10 @@
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./Libraries/*": {
|
||||
"react-native-legacy-deep-imports": "./types_DEPRECATED/Libraries/*.d.ts",
|
||||
"react-native-legacy-deep-imports": [
|
||||
"./types_DEPRECATED/Libraries/*.d.ts",
|
||||
"./Libraries/*.d.ts"
|
||||
],
|
||||
"types": null,
|
||||
"default": "./Libraries/*.js"
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user