Skip to content

Fix experimental-modules flag required version#11

Merged
JordanMartinez merged 1 commit intoes-modules+purity-annotationsfrom
es-modules+fix-required-node-versions
Feb 11, 2022
Merged

Fix experimental-modules flag required version#11
JordanMartinez merged 1 commit intoes-modules+purity-annotationsfrom
es-modules+fix-required-node-versions

Conversation

@sigma-andex
Copy link

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
Screenshot 2022-02-11 at 20 46 07

@JordanMartinez JordanMartinez merged commit 3a3abde into es-modules+purity-annotations Feb 11, 2022
@JordanMartinez JordanMartinez deleted the es-modules+fix-required-node-versions branch February 11, 2022 21:10
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants