-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove 'import' from default Package Exports conditions (facebook/react-native#36584) #955
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
labels
Mar 23, 2023
This pull request was exported from Phabricator. Differential Revision: D44303559 |
huntie
changed the title
Remove 'import' from default Package Exports conditions (#36584)
Remove 'import' from default Package Exports conditions (facebook/react-native#36584)
Mar 23, 2023
This pull request was exported from Phabricator. Differential Revision: D44303559 |
huntie
added a commit
to huntie/metro
that referenced
this pull request
Mar 23, 2023
Summary: Pull Request resolved: facebook#955 X-link: facebook/react-native#36584 Changelog: [General][Changed] - Default condition set for experimental Package Exports is now `['require', 'react-native']` The [Exports RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0534-metro-package-exports-support.md) had assumed that supporting the `"import"` condition was a syntax-only difference, given we are not in a Node.js environment — and so was worthwhile to support for maximal ecosystem compatibility. {F915841105} This assumption is similar to [`--moduleResolution bundler` in TypeScript 5.0](microsoft/TypeScript#51669): > bundlers and runtimes that include a range of Node-like resolution features and ESM syntax, but do not enforce the strict resolution rules that accompany ES modules in Node or in the browser > -- microsoft/TypeScript#51669 (comment) However, robhogan has rightly pointed out that **we should not do this!** - ESM (once transpiled) is **not** simply a stricter subset of in-scope features supported by CJS. For example, it supports top-level async, which would be breaking at runtime. - We recently made the same change for our Jest environment: - facebook/react-native@681d7f8 As such, we are erring on the side of correctness and supporting only `['require', 'react-native']` in our defaults. At runtime, all code run by React Native is anticipated to be CommonJS. `"exports"` will instead allow React Native to correctly select the CommonJS versions of modules from all npm packages. Metro changelog: [Experimental] Package Exports `unstable_conditionNames` now defaults to `['require']` Differential Revision: D44303559 fbshipit-source-id: fd32e5664679fa6d8fe8c6dca8c3d4b43d867589
huntie
force-pushed
the
export-D44303559
branch
from
March 23, 2023 11:30
9def50f
to
858d9d5
Compare
Summary: Pull Request resolved: facebook#955 X-link: facebook/react-native#36584 Changelog: [General][Changed] - Default condition set for experimental Package Exports is now `['require', 'react-native']` The [Exports RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0534-metro-package-exports-support.md) had assumed that supporting the `"import"` condition was a syntax-only difference, given we are not in a Node.js environment — and so was worthwhile to support for maximal ecosystem compatibility. {F915841105} This assumption is similar to [`--moduleResolution bundler` in TypeScript 5.0](microsoft/TypeScript#51669): > bundlers and runtimes that include a range of Node-like resolution features and ESM syntax, but do not enforce the strict resolution rules that accompany ES modules in Node or in the browser > -- microsoft/TypeScript#51669 (comment) However, robhogan has rightly pointed out that **we should not do this!** - ESM (once transpiled) is **not** simply a stricter subset of in-scope features supported by CJS. For example, it supports top-level async, which would be breaking at runtime. - We recently made the same change for our Jest environment: - facebook/react-native@681d7f8 As such, we are erring on the side of correctness and supporting only `['require', 'react-native']` in our defaults. At runtime, all code run by React Native is anticipated to be CommonJS. `"exports"` will instead allow React Native to correctly select the CommonJS versions of modules from all npm packages. Metro changelog: [Experimental] Package Exports `unstable_conditionNames` now defaults to `['require']` Reviewed By: robhogan Differential Revision: D44303559 fbshipit-source-id: 0d7395ad0a44019ef4b2cad0b43d78dcecc5ecd0
huntie
force-pushed
the
export-D44303559
branch
from
March 23, 2023 12:02
858d9d5
to
d558e4a
Compare
This pull request was exported from Phabricator. Differential Revision: D44303559 |
This pull request has been merged in 0b2e7a7. |
facebook-github-bot
pushed a commit
to facebook/react-native
that referenced
this pull request
Mar 23, 2023
Summary: X-link: facebook/metro#955 Pull Request resolved: #36584 Changelog: [General][Changed] - Default condition set for experimental Package Exports is now `['require', 'react-native']` The [Exports RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0534-metro-package-exports-support.md) had assumed that supporting the `"import"` condition was a syntax-only difference, given we are not in a Node.js environment — and so was worthwhile to support for maximal ecosystem compatibility. {F915841105} This assumption is similar to [`--moduleResolution bundler` in TypeScript 5.0](microsoft/TypeScript#51669): > bundlers and runtimes that include a range of Node-like resolution features and ESM syntax, but do not enforce the strict resolution rules that accompany ES modules in Node or in the browser > -- microsoft/TypeScript#51669 (comment) However, robhogan has rightly pointed out that **we should not do this!** - ESM (once transpiled) is **not** simply a stricter subset of in-scope features supported by CJS. For example, it supports top-level async, which would be breaking at runtime. - We recently made the same change for our Jest environment: - 681d7f8 As such, we are erring on the side of correctness and supporting only `['require', 'react-native']` in our defaults. At runtime, all code run by React Native is anticipated to be CommonJS. `"exports"` will instead allow React Native to correctly select the CommonJS versions of modules from all npm packages. Metro changelog: [Experimental] Package Exports `unstable_conditionNames` now defaults to `['require']` Reviewed By: robhogan Differential Revision: D44303559 fbshipit-source-id: 0077e547e7775e53d1e4e9c3a9d01347f4fb7d4a
cipolleschi
pushed a commit
to facebook/react-native
that referenced
this pull request
Mar 31, 2023
Summary: X-link: facebook/metro#955 Pull Request resolved: #36584 Changelog: [General][Changed] - Default condition set for experimental Package Exports is now `['require', 'react-native']` The [Exports RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0534-metro-package-exports-support.md) had assumed that supporting the `"import"` condition was a syntax-only difference, given we are not in a Node.js environment — and so was worthwhile to support for maximal ecosystem compatibility. {F915841105} This assumption is similar to [`--moduleResolution bundler` in TypeScript 5.0](microsoft/TypeScript#51669): > bundlers and runtimes that include a range of Node-like resolution features and ESM syntax, but do not enforce the strict resolution rules that accompany ES modules in Node or in the browser > -- microsoft/TypeScript#51669 (comment) However, robhogan has rightly pointed out that **we should not do this!** - ESM (once transpiled) is **not** simply a stricter subset of in-scope features supported by CJS. For example, it supports top-level async, which would be breaking at runtime. - We recently made the same change for our Jest environment: - 681d7f8 As such, we are erring on the side of correctness and supporting only `['require', 'react-native']` in our defaults. At runtime, all code run by React Native is anticipated to be CommonJS. `"exports"` will instead allow React Native to correctly select the CommonJS versions of modules from all npm packages. Metro changelog: [Experimental] Package Exports `unstable_conditionNames` now defaults to `['require']` Reviewed By: robhogan Differential Revision: D44303559 fbshipit-source-id: 0077e547e7775e53d1e4e9c3a9d01347f4fb7d4a
jeongshin
pushed a commit
to jeongshin/react-native
that referenced
this pull request
May 7, 2023
Summary: X-link: facebook/metro#955 Pull Request resolved: facebook#36584 Changelog: [General][Changed] - Default condition set for experimental Package Exports is now `['require', 'react-native']` The [Exports RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0534-metro-package-exports-support.md) had assumed that supporting the `"import"` condition was a syntax-only difference, given we are not in a Node.js environment — and so was worthwhile to support for maximal ecosystem compatibility. {F915841105} This assumption is similar to [`--moduleResolution bundler` in TypeScript 5.0](microsoft/TypeScript#51669): > bundlers and runtimes that include a range of Node-like resolution features and ESM syntax, but do not enforce the strict resolution rules that accompany ES modules in Node or in the browser > -- microsoft/TypeScript#51669 (comment) However, robhogan has rightly pointed out that **we should not do this!** - ESM (once transpiled) is **not** simply a stricter subset of in-scope features supported by CJS. For example, it supports top-level async, which would be breaking at runtime. - We recently made the same change for our Jest environment: - facebook@681d7f8 As such, we are erring on the side of correctness and supporting only `['require', 'react-native']` in our defaults. At runtime, all code run by React Native is anticipated to be CommonJS. `"exports"` will instead allow React Native to correctly select the CommonJS versions of modules from all npm packages. Metro changelog: [Experimental] Package Exports `unstable_conditionNames` now defaults to `['require']` Reviewed By: robhogan Differential Revision: D44303559 fbshipit-source-id: 0077e547e7775e53d1e4e9c3a9d01347f4fb7d4a
OlimpiaZurek
pushed a commit
to OlimpiaZurek/react-native
that referenced
this pull request
May 22, 2023
Summary: X-link: facebook/metro#955 Pull Request resolved: facebook#36584 Changelog: [General][Changed] - Default condition set for experimental Package Exports is now `['require', 'react-native']` The [Exports RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0534-metro-package-exports-support.md) had assumed that supporting the `"import"` condition was a syntax-only difference, given we are not in a Node.js environment — and so was worthwhile to support for maximal ecosystem compatibility. {F915841105} This assumption is similar to [`--moduleResolution bundler` in TypeScript 5.0](microsoft/TypeScript#51669): > bundlers and runtimes that include a range of Node-like resolution features and ESM syntax, but do not enforce the strict resolution rules that accompany ES modules in Node or in the browser > -- microsoft/TypeScript#51669 (comment) However, robhogan has rightly pointed out that **we should not do this!** - ESM (once transpiled) is **not** simply a stricter subset of in-scope features supported by CJS. For example, it supports top-level async, which would be breaking at runtime. - We recently made the same change for our Jest environment: - facebook@681d7f8 As such, we are erring on the side of correctness and supporting only `['require', 'react-native']` in our defaults. At runtime, all code run by React Native is anticipated to be CommonJS. `"exports"` will instead allow React Native to correctly select the CommonJS versions of modules from all npm packages. Metro changelog: [Experimental] Package Exports `unstable_conditionNames` now defaults to `['require']` Reviewed By: robhogan Differential Revision: D44303559 fbshipit-source-id: 0077e547e7775e53d1e4e9c3a9d01347f4fb7d4a
fuxingloh
referenced
this pull request
in levaintech/keychain
Jun 20, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [metro](https://github.com/facebook/metro) | [`0.76.0` -> `0.76.6`](https://renovatebot.com/diffs/npm/metro/0.76.0/0.76.6) | [![age](https://badges.renovateapi.com/packages/npm/metro/0.76.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/metro/0.76.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/metro/0.76.6/compatibility-slim/0.76.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/metro/0.76.6/confidence-slim/0.76.0)](https://docs.renovatebot.com/merge-confidence/) | | [metro-resolver](https://github.com/facebook/metro) | [`0.76.0` -> `0.76.6`](https://renovatebot.com/diffs/npm/metro-resolver/0.76.0/0.76.6) | [![age](https://badges.renovateapi.com/packages/npm/metro-resolver/0.76.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/metro-resolver/0.76.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/metro-resolver/0.76.6/compatibility-slim/0.76.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/metro-resolver/0.76.6/confidence-slim/0.76.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>facebook/metro</summary> ### [`v0.76.6`](https://github.com/facebook/metro/releases/tag/v0.76.6) [Compare Source](https://github.com/facebook/metro/compare/v0.76.5...v0.76.6) - **\[Types]** Update config and `Server` types to use broader types from `connect` package (facebook/metro@d20d7c8 by [@​huntie](https://github.com/huntie)) - **\[Types]** Fix TypeScript name for `createConnectMiddleware` export (facebook/metro@06682f8 by [@​huntie](https://github.com/huntie)) - **\[Deprecation]** Deprecate `server.enhanceMiddleware` option (facebook/metro@22e85fd by [@​huntie](https://github.com/huntie)) > NOTE: Experimental features are not covered by semver and can change at any time. - **\[Experimental]** Add `unstable_extraMiddleware` option to `runServer` API (facebook/metro@d0d5543 by [@​huntie](https://github.com/huntie)) **Full Changelog**: facebook/metro@v0.76.5...v0.76.6 ### [`v0.76.5`](https://github.com/facebook/metro/releases/tag/v0.76.5) [Compare Source](https://github.com/facebook/metro/compare/v0.76.4...v0.76.5) - **\[Feature]** Support URLs for both bundling and symbolication requests using `//&` instead of `?` as a query string delimiter (facebook/metro@bd357c8 by [@​robhogan](https://github.com/robhogan)) - **\[Fix]** Fix crash on a module added+modified+removed between updates (facebook/metro@5d7305e by [@​robhogan](https://github.com/robhogan)) - **\[Fix]** Fix missed modification on module removed+modified+added between updates (facebook/metro@5d7305e by [@​robhogan](https://github.com/robhogan)) - **\[Fix]** Emit source URLs in a format that will not be stripped by JavaScriptCore (facebook/metro@bce6b27ef8ac7c41e0a3e990eb71747cc0e6f606by [@​robhogan](https://github.com/robhogan)) - **\[Performance]** Prune unmodified modules from delta updates before sending them to the client (facebook/metro@e24c6ae by [@​robhogan](https://github.com/robhogan)) > NOTE: Experimental features are not covered by semver and can change at any time. - **\[Experimental]** Fix `babel/runtime` issue when using Package Exports (facebook/metro@905d773 by [@​huntie](https://github.com/huntie)) **Full Changelog**: facebook/metro@v0.76.4...v0.76.5 ### [`v0.76.4`](https://github.com/facebook/metro/releases/tag/v0.76.4) [Compare Source](https://github.com/facebook/metro/compare/v0.76.3...v0.76.4) - **\[Feature]**: Support the [`x_google_ignoreList`](https://developer.chrome.com/articles/x-google-ignore-list/) source map extension. ([https://github.com/facebook/metro/pull/973](https://github.com/facebook/metro/pull/973), [`82bd64a`](https://github.com/facebook/metro/commit/82bd64a9720174a9e2a02fb73bbef292153e20f1) by [@​motiz88](https://github.com/motiz88)) - **\[Feature]**: Support bundling KTX files as image assets. ([https://github.com/facebook/metro/pull/975](https://github.com/facebook/metro/pull/975) by [@​rshest](https://github.com/rshest)) - **\[Fix]**: Fix crash on a module added+modified+removed between updates. ([`5d7305e`](https://github.com/facebook/metro/commit/5d7305e2f3a9f5f4aebc889a452afb03b1db12a7) by [@​robhogan](https://github.com/robhogan)) - **\[Fix]**: Fix missed modification on module removed+modified+added between updates. ([`5d7305e`](https://github.com/facebook/metro/commit/5d7305e2f3a9f5f4aebc889a452afb03b1db12a7) by [@​robhogan](https://github.com/robhogan)) **Full Changelog**: facebook/metro@v0.76.3...v0.76.4 ### [`v0.76.3`](https://github.com/facebook/metro/releases/tag/v0.76.3) [Compare Source](https://github.com/facebook/metro/compare/v0.76.2...v0.76.3) - **\[Feature]**: Support custom `__loadBundleAsync` implementations in the default `asyncRequire` function. See the [lazy bundling RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0605-lazy-bundling.md) for more details. (facebook/metro@ac3adce, facebook/metro@f07ce5c by [@​motiz88](https://github.com/motiz88)) - **\[Feature]**: Support `lazy` parameter in bundle requests. See the [lazy bundling RFC](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0605-lazy-bundling.md) for more details. (facebook/metro@4ef14f9 by [@​motiz88](https://github.com/motiz88)) - **\[Feature]**: Preserve comments in unminified builds, while continuing to strip all comments from minified builds. ([https://github.com/facebook/metro/pull/967](https://github.com/facebook/metro/pull/967) by [@​tido64](https://github.com/tido64)) - **\[Deprecated]**: The `transformer.asyncRequireModulePath` config option is deprecated. Use [`__loadBundleAsync`](https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0605-lazy-bundling.md#\__loadbundleasync-in-metro) instead.(facebook/metro@c7b684f by [@​motiz88](https://github.com/motiz88)) > NOTE: Experimental features are not covered by semver and can change at any time. - **\[Experimental]** Package Exports unstable_conditionNames now defaults to \['require', 'import'] (facebook/metro@e70ceef by [@​huntie](https://github.com/huntie)) - **\[Experimental]** Removed `server.experimentalImportBundleSupport` config option. (facebook/metro@4ef14f9 by [@​motiz88](https://github.com/motiz88)) **Full Changelog**: facebook/metro@v0.76.2...v0.76.3 ### [`v0.76.2`](https://github.com/facebook/metro/releases/tag/v0.76.2) [Compare Source](https://github.com/facebook/metro/compare/v0.76.1...v0.76.2) - **\[Feature]**: Added customizeStack hook to Metro's `/symbolicate` endpoint to allow custom frame skipping logic on a stack level. (facebook/metro@ce266dd by [@​GijsWeterings](https://github.com/GijsWeterings)) - **\[Feature]**: Re-export `metro-core`'s `Terminal` from `metro`. (facebook/metro@86e3f93 by [@​robhogan](https://github.com/robhogan)) - **\[Feature]**: Re-export `metro-config`'s `resolveConfig` from `metro`. (facebook/metro@cc16664 by [@​robhogan](https://github.com/robhogan)) - **\[Types]**: Remove dependency on `@types/babel__code-frame`. (facebook/metro@41cdc03 by [@​robhogan](https://github.com/robhogan)) - **\[Types]**: Remove dependency on `@types/ws`. (facebook/metro@7deb525 by [@​robhogan](https://github.com/robhogan)) - **\[Types]**: Fix TypeScript types entry point for metro-source-map. (facebook/metro@3238bbc by [@​huntie](https://github.com/huntie)) - **\[Deprecated]**: Deprecate `ResolutionContext.getPackageForModule`. (facebook/metro@2d0a01c by [@​huntie](https://github.com/huntie)) > NOTE: Experimental features are not covered by semver and can change at any time. - **\[Experimental]**: Pass full path and query params to `asyncRequire` for lazy bundles. (facebook/metro@61a30b7 by [@​motiz88](https://github.com/motiz88)) - **\[Experimental]**: Fix bug where Package Exports warnings may have been logged for nested `node_modules` path candidates. (facebook/metro@29c77bf by [@​huntie](https://github.com/huntie)) - **\[Experimental]**: Fix `package.json` discovery against root package specifiers for Package Exports. (facebook/metro@b995303 by [@​huntie](https://github.com/huntie), fixes [https://github.com/facebook/metro/issues/965](https://github.com/facebook/metro/issues/965) reported by [@​shamilovtim](https://github.com/shamilovtim)) **Full Changelog**: facebook/metro@v0.76.1...v0.76.2 ### [`v0.76.1`](https://github.com/facebook/metro/releases/tag/v0.76.1) [Compare Source](https://github.com/facebook/metro/compare/v0.76.0...v0.76.1) - **\[Feature]**: Support custom transformer/resolver options in `metro build` and `runBuild` API. (facebook/metro@fcfecc9 by [@​motiz88](https://github.com/motiz88)) - **\[Feature]**: `metro get-dependencies --entryFile <entryFile>` can now be called as `metro get-dependencies <entryFile>`. (facebook/metro@6fdce04 by [@​huntie](https://github.com/huntie)) - **\[Feature]**: Add `Content-Type` and `Content-Length` headers for assets to Metro server. ([https://github.com/facebook/metro/pull/953](https://github.com/facebook/metro/pull/953) by [@​aleqsio](https://github.com/aleqsio), [https://github.com/facebook/metro/pull/961](https://github.com/facebook/metro/pull/961) by [@​byCedric](https://github.com/byCedric)) - **\[Feature]**: Expose `mergeConfig` util from `metro` package. (facebook/metro@aa8ec90 by [@​huntie](https://github.com/huntie)) - **\[Fix]**: `metro-file-map`: consistently abort crawl when `end()` is called. (facebook/metro@51877a8 by [@​motiz88](https://github.com/motiz88)) - **\[Fix]**: `metro-config`: Don't mutate argument to `loadConfig`. (facebook/metro@38ec62d by [@​motiz88](https://github.com/motiz88)) - **\[Fix]**: Babel transformers: Provide correct absolute source path to plugins when Metro is not run from the project root. (facebook/metro@de19bbd by [@​robhogan](https://github.com/robhogan)) - **\[Fix]**: [`resolver.assetExts`](https://facebook.github.io/metro/docs/configuration/#assetexts) will now match asset files for extension values that include a dot (`.`). (facebook/metro@6d65a32 by [@​huntie](https://github.com/huntie)) - **\[Fix]**: Don't register an [`unhandledRejection`](https://nodejs.org/api/process.html#event-unhandledrejection) listener, fix spammy EventEmitter leak warning. (facebook/metro@833f2ff by [@​motiz88](https://github.com/motiz88)) - **\[Types]**: Add bundled TypeScript definitions (partial) for all packages previously on DefinitelyTyped. (facebook/metro@c022c36, facebook/metro@07732e7, facebook/metro@9ee5280 by [@​huntie](https://github.com/huntie), with [@​afoxman](https://github.com/afoxman) and [@​tido64](https://github.com/tido64)) - **\[Types]**: Expose `MetroConfig` type in `metro` package. (facebook/metro@d2f3664 by [@​huntie](https://github.com/huntie)) > NOTE: Experimental features are not covered by semver and can change at any time. - **\[Experimental]**: Reorder `asyncRequire`'s parameters and make module name optional. (facebook/metro@4e5261c by [@​motiz88](https://github.com/motiz88)) - **\[Experimental]**: Remove experimental `metro-hermes-compiler` package. (facebook/metro@833f2ff by [@​motiz88](https://github.com/motiz88)) - **\[Experimental]**: Package Exports [`unstable_conditionNames`](https://facebook.github.io/metro/docs/configuration/#unstable_conditionnames-experimental) now defaults to `['require']`. ([https://github.com/facebook/metro/pull/955](https://github.com/facebook/metro/pull/955) by [@​huntie](https://github.com/huntie)) - **\[Experimental]**: Add compatibility with legacy Node.js "exports" array formats. (facebook/metro@f321cff, facebook/metro@1e47cb5 by [@​huntie](https://github.com/huntie)) **Full Changelog**: facebook/metro@v0.76.0...v0.76.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/levaintech/keychain). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
X-link: facebook/react-native#36584
The Exports RFC had assumed that supporting the
"import"
condition was a syntax-only difference, given we are not in a Node.js environment — and so was worthwhile to support for maximal ecosystem compatibility.This assumption is similar to
--moduleResolution bundler
in TypeScript 5.0:However, robhogan has rightly pointed out that we should not do this!
As such, we are erring on the side of correctness and supporting only
['require', 'react-native']
in our defaults. At runtime, all code run by React Native is anticipated to be CommonJS."exports"
will instead allow React Native to correctly select the CommonJS versions of modules from all npm packages.'import'
based on how the module isimport
ed/require()
d. For now this is not in scope.Changelog:
[General][Changed] - Default condition set for experimental Package Exports is now
['require', 'react-native']
Metro changelog: [Experimental] Package Exports
unstable_conditionNames
now defaults to['require']
Differential Revision: D44303559