Fix experimental-modules flag required version#11
Merged
JordanMartinez merged 1 commit intoes-modules+purity-annotationsfrom Feb 11, 2022
Merged
Conversation
Improve error message
JordanMartinez
approved these changes
Feb 11, 2022
5 tasks
sigma-andex
added a commit
that referenced
this pull request
Feb 28, 2022
* Add ES imports/exports to CoreImp AST * Print ES imports/exports * Codegen ES imports for PureScript modules * Codegen ES imports for foreign modules * Codegen ES exports * Extract both CJS and ES exports from foreign modules * Remove the redundant "use strict;" pragma from modules header ES modules are already parsed in strict mode. * Don’t emit empty statements for empty exports lists * Bundle ES modules * Load ES modules with `esm` in the Node.js REPL and tests * Escape primes in modules accessors * Forbid unescaped primes in foreign modules exports * Run tests against patched dependencies * Rewrite ES modules in the browser REPL client * Revert "Load ES modules with `esm` in the Node.js REPL and tests" This reverts commit 7f0c07e. * Allow Node.js to load .js files in the output directory as ES modules Node.js loads JavaScript files with a .js extension as CommonJS modules unless they're within a directory with a `"type": "module"` package.json, in which case it loads them as ES modules. * Import CommonJS foreign modules through an ES module wrapper * Don't let tests nor the REPL compile into a node_modules directory Node.js ignores the package.json file of the output directory otherwise and loads .js files as CommonJS modules. * Bundle re-exports * Load bundles as CommonJS modules in tests * Update Node.js version on CI * Disallow CommonJS exports named `default` Node.js allows ES modules to import CommonJS modules by providing the module.exports object as their default export and named exports for statically discoverable properties of the module.exports object. This has an unpleasant consequence for foreign imports: CommonJS exports named `default` are only available as the default property of their default export so a `default :: String` identifier imported from a CommonJS foreign module would actually have type `{ default :: String }`! * Disallow CommonJS exports and imports in ES foreign modules The require function and the exports object are not available in ES modules on Node.js. * Deprecate CommonJS foreign modules * Convert CommonJS foreign modules in tests to ES modules * Don't optimize away dependencies of named ES exports of declarations * fixup! Import CommonJS foreign modules through an ES module wrapper * fixup! Don't optimize away dependencies of named ES exports of declarations * Revert "Disallow CommonJS exports named `default`" This reverts commit 4976eee. * Add tests for foreign CommonJS exports named default * Extend support to Node.js v12.0.0 with --experimental-modules * Filter out Node.js experimental ES modules loader warning * Update bundler error messages * Fix HLint warnings * Add purity annotations to function applications and constructor instantations * Surround purity annotations in parens * Mention es modules in version * Add purity annotations to top-level applications only. * Follow top-level literals as well * Annotate all top-level-reachable applications. * Traverse under lhs functions and operators * Use # for annotation. * Add comments, remove potentially aggressive cases. * Simplify to uniform top-level IIFEs. * Fix tests * Add myself to contributors * Fix experimental-modules flag required version (#11) Improve error message * Add i-am-the-slime to contributors * Fix pr comments (#12) * Rename node.js to Node.js * Remove unused Unsafe.hs * Add resolutions to fix dep conflicts * Add changelog.d entry for es modules (#14) * Update prefix to match script's expected one * Drop unneeded whitespace * Update src/Language/PureScript/Errors.hs Co-authored-by: Nathan Faubion <natefaubion@users.noreply.github.com> * Fix broken tests after spelling correction commit * Remove temporary entries from changelog * Refactor Pure -> Comment in CoreImp * Refactor CoreImp modules * Be less liberal with IIFEs Co-authored-by: Cyril Sobierajewicz <sobierajewicz.cyril@gmail.com> Co-authored-by: Mark Eibes <mark.eibes@gmail.com> Co-authored-by: Nathan Faubion <nathan@awakesecurity.com> Co-authored-by: Thomas Honeyman <hello@thomashoneyman.com> Co-authored-by: Jordan Martinez <jordanalex.martinez@protonmail.com> Co-authored-by: Nathan Faubion <natefaubion@users.noreply.github.com> Co-authored-by: Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>
This file contains hidden or 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
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.
This fixes the required node version for the --experimental-modules flag.
According to the node.js release notes the flag requirement was removed in 13.
It was introduced in 8.5.0
I tested locally
