Skip to content

Commit 1e86be4

Browse files
committed
Clarify exact path specifier handling in Metro exports RFC
1 parent 36a3ce8 commit 1e86be4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proposals/0534-metro-package-exports-support.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ import BazComponent from './BazComponent.mjs';
223223

224224
- **Breaking**: Under `"exports"`, Metro will not resolve platform-specific extensions for listed package entry points.
225225
- When resolving any import specifier:
226-
- If the package defines `"exports"` and the exact specifier is matched, the package-defined path will be used.
227-
- If there is no match in `"exports"`, Metro will look for files at the imported subpath, trying all extension variants (existing resolution logic).
226+
- If the package defines `"exports"` and the import specifier (after expanding `sourceExts`) is matched, the package-defined path mapping will be used with no further transformation.
227+
- If there is no match in `"exports"`, Metro will look for files which match the import specifier, trying all extension variants (existing resolution logic).
228228
- With this decision, we will have narrowed support for platform-specific extensions in packages. We will communicate to React Native package authors that alternative patterns should be used.
229229
- We have no near-term plans to drop platform-specific extensions for packages not using `"exports"`, or in app code.
230230
- We will not take a strong stance on using extensionless or extensioned imports. The former may provide more flexibility for React Native package authors to change extensions in future without impacting consuming apps.

0 commit comments

Comments
 (0)