-
Notifications
You must be signed in to change notification settings - Fork 221
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
build: 'module' type for root package #4789
Merged
Merged
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
turadg
changed the title
4788 remove esm module loader
build: 'module' type for root package
Mar 10, 2022
kriskowal
reviewed
Mar 10, 2022
@@ -5,8 +5,7 @@ | |||
"parsers": { | |||
"js": "mjs" | |||
}, | |||
"main": "src/index.js", | |||
"module": "src/index.js", | |||
"main": "src/index.cjs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "parsers"
above can also be removed (anywhere you encounter them going forward). They were necessary for Endo to briefly (and badly) straddle compatibility with both RESM and NESM.
kriskowal
approved these changes
Mar 10, 2022
dtribble
pushed a commit
that referenced
this pull request
Mar 13, 2022
* chore: remove dead ava config from cosmos package * chore: module config that works for Ava * chore: cjs for files that have require() * fix ui-components test * fix lint * fixup! chore: cjs for files that have require() * remove 'parsers' field
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
enough progress on #4788 to unblock #4722
Description
Uses Node.js's
type
field to make the root package be loaded as ES modules (ESM) instead of CommonJS (CJS).For modules that need to be CJS, change the extension to
.cjs
.Security Considerations
--
Documentation Considerations
There is something about how to transition packages to ESM which I think still applies: https://github.com/Agoric/agoric-sdk/blob/45f9ada36e859a42cff529eaf77fad9a464678ed/COVERAGE.md#nodejs-esm-support
Testing Considerations
Simplifies Ava config.