Skip to content
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

Restore 'import' in default Package Exports conditions #36902

Closed
wants to merge 1 commit into from

Conversation

huntie
Copy link
Member

@huntie huntie commented Apr 13, 2023

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

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

@analysis-bot
Copy link

analysis-bot commented Apr 13, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,616,941 +0
android hermes armeabi-v7a 7,930,102 +0
android hermes x86 9,103,314 +0
android hermes x86_64 8,958,150 +0
android jsc arm64-v8a 9,183,449 +0
android jsc armeabi-v7a 8,374,218 +0
android jsc x86 9,241,405 +0
android jsc x86_64 9,499,935 +0

Base commit: 3b4037e
Branch: main

@facebook-github-bot
Copy link
Contributor

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

huntie added a commit to huntie/react-native that referenced this pull request Apr 14, 2023
Summary:
Pull Request resolved: facebook#36902

Reverts facebook#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: d2004df313c858c70bc41c5e096ae2ab9f627bc1
Summary:
Pull Request resolved: facebook#36902

Reverts facebook#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
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 808b3c9.

facebook-github-bot pushed a commit to facebook/metro that referenced this pull request Apr 14, 2023
Summary:
X-link: facebook/react-native#36902

Reverts facebook/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
jeongshin pushed a commit to jeongshin/react-native that referenced this pull request May 7, 2023
Summary:
Pull Request resolved: facebook#36902

Reverts facebook#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
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
Pull Request resolved: facebook#36902

Reverts facebook#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
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 This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants