Skip to content

Narrow root wildcard entry point - #57276

Closed
huntie wants to merge 2 commits into
react:mainfrom
huntie:export-D109018823
Closed

Narrow root wildcard entry point#57276
huntie wants to merge 2 commits into
react:mainfrom
huntie:export-D109018823

Conversation

@huntie

@huntiehuntie commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary:
Simplify "exports" mapping on the react-native package by replacing the "./*" wildcard export with explicit listed subpaths (invert from blocklist to allowlist).

These changes are non-breaking — the net accessible exports subpaths before/after are equivalent.

Changelog: [Internal]

Differential Revision: D109018823

huntie added 2 commits June 18, 2026 06:35
Summary:
This appears to be a legacy, dangling, Flow-only entry point which we can remove.
Changelog: [Internal]
Differential Revision: D109018822
Summary:
Simplify `"exports"` mapping on the `react-native` package by replacing the `"./*"` wildcard export with explicit listed subpaths.
These changes are **non-breaking** — the net accessible exports subpaths before/after are equivalent.
Changelog: [Internal]
Differential Revision: D109018823
@meta-clameta-claBot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 18, 2026
@meta-codesync

Copy link
Copy Markdown

@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109018823.

huntie added a commit to huntie/react-native that referenced this pull request Jun 18, 2026
Summary:
Simplify `"exports"` mapping on the `react-native` package by replacing the `"./*"` wildcard export with explicit listed subpaths (invert from blocklist to allowlist).
These changes are **non-breaking** — the net accessible exports subpaths before/after are equivalent.
Changelog: [Internal]
Differential Revision: D109018823
huntie added a commit to huntie/react-native that referenced this pull request Jun 18, 2026
Summary:
Simplify `"exports"` mapping on the `react-native` package by replacing the `"./*"` wildcard export with explicit listed subpaths (invert from blocklist to allowlist).
These changes are **non-breaking** — the net accessible exports subpaths before/after are equivalent.
Changelog: [Internal]
Differential Revision: D109018823
@meta-codesyncmeta-codesyncBot added the Merged This PR has been merged. label Jun 19, 2026
@meta-codesync

Copy link
Copy Markdown

This pull request has been merged in cd0d93a.

@huntie
huntie deleted the export-D109018823 branch June 19, 2026 14:36
meta-codesyncBot pushed a commit that referenced this pull request Jun 29, 2026
Summary:
Pull Request resolved: #57362
The `"./types/*.d.ts"` entry was an overly defensive addition during our non-breaking `"exports"` field addition back in 0.80.
In reality, this subpath has no real consumers: the legacy types entry point (`.`) resolves its own declaration files through relative references, and the supported deep-import surface is `react-native/Libraries/*`, not `react-native/types/*`.
Type resolution of the main entry point and of `react-native/Libraries/*` deep imports is unaffected, and there is no runtime impact (these are declaration files).
Follows the exports-map cleanup in #57276.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D110044754
fbshipit-source-id: 0ddea81417e765503de01c8c43800f4114c81eb3
meta-codesyncBot pushed a commit that referenced this pull request Jul 28, 2026
Summary:
Pull Request resolved: #57718
**Context**
Replaces #57709, which identified a real bug in 0.87 from the combination of:
- #57276
- #57652
```
$ npx react-native spm add
error Cannot find module '.../node_modules/react-native/scripts/setup-apple-spm'
$ npx react-native codegen
error Cannot find module '.../node_modules/react-native/scripts/codegen/generate-artifacts-executor'
```
**This diff**
- Fix — and exclusively switch to — extensionless imports rather than requiring `.js`.
- Update in-repo consumers.
The previous single mapping is now an extension-aware mapping:
- `./scripts/*` now appends `.js`, so `react-native/scripts/foo` resolves to `foo.js`.
- `.sh` and `.rb` stay reachable via explicit `./scripts/*.sh` and `./scripts/*.rb` passthrough patterns.
**Impact**
- Explicit `react-native/scripts/*.js` specifiers no longer resolve, so JavaScript paths must be imported without an extension.
- Files under `scripts/` with extensions other than `.js`, `.sh`, or `.rb` are no longer exposed through `./scripts/*`.
- These have no open source consumers.
Changelog:
[General][Fixed] - (RC4 only, drop for main changelog): `react-native/scripts/*` imports once again expand `.js` extensions
[General][Breaking] - Extensionless `react-native/scripts/*` imports are now **mandated**; explicit `.js` import specifiers are rejected.
Reviewed By: rubennorte
Differential Revision: D113898792
fbshipit-source-id: d72f60be2c08ab97871e336645856c9029e74ae2
fabriziocucci pushed a commit that referenced this pull request Aug 3, 2026
Summary:
Pull Request resolved: #57718
**Context**
Replaces #57709, which identified a real bug in 0.87 from the combination of:
- #57276
- #57652
```
$ npx react-native spm add
error Cannot find module '.../node_modules/react-native/scripts/setup-apple-spm'
$ npx react-native codegen
error Cannot find module '.../node_modules/react-native/scripts/codegen/generate-artifacts-executor'
```
**This diff**
- Fix — and exclusively switch to — extensionless imports rather than requiring `.js`.
- Update in-repo consumers.
The previous single mapping is now an extension-aware mapping:
- `./scripts/*` now appends `.js`, so `react-native/scripts/foo` resolves to `foo.js`.
- `.sh` and `.rb` stay reachable via explicit `./scripts/*.sh` and `./scripts/*.rb` passthrough patterns.
**Impact**
- Explicit `react-native/scripts/*.js` specifiers no longer resolve, so JavaScript paths must be imported without an extension.
- Files under `scripts/` with extensions other than `.js`, `.sh`, or `.rb` are no longer exposed through `./scripts/*`.
- These have no open source consumers.
Changelog:
[General][Fixed] - (RC4 only, drop for main changelog): `react-native/scripts/*` imports once again expand `.js` extensions
[General][Breaking] - Extensionless `react-native/scripts/*` imports are now **mandated**; explicit `.js` import specifiers are rejected.
Reviewed By: rubennorte
Differential Revision: D113898792
fbshipit-source-id: d72f60be2c08ab97871e336645856c9029e74ae2
(cherry picked from commit 97727ba)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.MergedThis PR has been merged.meta-exportedp: FacebookPartner: FacebookPartner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@huntie