Skip to content

Restore 'import' in default Package Exports conditions - #36902

Closed
huntie wants to merge 1 commit into
react:mainfrom
huntie:export-D44962143
Closed

Restore 'import' in default Package Exports conditions#36902
huntie wants to merge 1 commit into
react:mainfrom
huntie:export-D44962143

Conversation

@huntie

Copy link
Copy Markdown
Collaborator

Summary:
Reverts #36584.

Since we've come across example packages (typically targeting Node.js) which only distribute ESM, we believe it's more helpful to return to asserting the "import" condition by default, for maximum compatibility. The above issue and comments outline the pros/cons.

Changelog:
[General][Changed] - Default condition set for experimental Package Exports is now ['require', 'import', 'react-native']

Metro changelog: [Experimental] Package Exports unstable_conditionNames now defaults to ['require', 'import']

Differential Revision: D44962143

@facebook-github-botfacebook-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. p: Facebook Partner: Facebook Partner fb-exported labels Apr 13, 2023
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44962143

@analysis-bot

analysis-bot commented Apr 13, 2023

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a8,616,941+0
androidhermesarmeabi-v7a7,930,102+0
androidhermesx869,103,314+0
androidhermesx86_648,958,150+0
androidjscarm64-v8a9,183,449+0
androidjscarmeabi-v7a8,374,218+0
androidjscx869,241,405+0
androidjscx86_649,499,935+0

Base commit: 3b4037e
Branch: main

@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44962143

Summary:
Pull Request resolved: #36902
Reverts #36584.
Since we've come across example packages (typically targeting Node.js) which only distribute ESM, we believe it's more helpful to return to asserting the `"import"` condition by default, for maximum compatibility. The above issue and comments outline the pros/cons.
Changelog:
[General][Changed] - Default condition set for experimental Package Exports is now ['require', 'import', 'react-native']
Metro changelog: [Experimental] Package Exports unstable_conditionNames now defaults to ['require', 'import']
Reviewed By: robhogan
Differential Revision: D44962143
fbshipit-source-id: f110182f37c07bc3fa5a3e6f936148e44b30a536
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D44962143

@facebook-github-botfacebook-github-bot added the Merged This PR has been merged. label Apr 14, 2023
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request has been merged in 808b3c9.

facebook-github-bot pushed a commit to react/metro that referenced this pull request Apr 14, 2023
Summary:
X-link: react/react-native#36902
Reverts react/react-native#36584.
Since we've come across example packages (typically targeting Node.js) which only distribute ESM, we believe it's more helpful to return to asserting the `"import"` condition by default, for maximum compatibility. The above issue and comments outline the pros/cons.
Changelog:
[General][Changed] - Default condition set for experimental Package Exports is now ['require', 'import', 'react-native']
Metro changelog: [Experimental] Package Exports unstable_conditionNames now defaults to ['require', 'import']
Reviewed By: robhogan
Differential Revision: D44962143
fbshipit-source-id: 004172388916c902469b49cfc920ebe13c62c430
@huntie
huntie deleted the export-D44962143 branch April 19, 2023 10:47
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.fb-exportedMergedThis PR has been merged.p: FacebookPartner: FacebookPartner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@huntie@facebook-github-bot@analysis-bot