Skip to content

Add changelog.d entry for es modules#14

Merged
JordanMartinez merged 1 commit intoes-modules+purity-annotationsfrom
add-changelog
Feb 20, 2022
Merged

Add changelog.d entry for es modules#14
JordanMartinez merged 1 commit intoes-modules+purity-annotationsfrom
add-changelog

Conversation

@sigma-andex
Copy link

Description of the change

Clearly and concisely describe the purpose of the pull request. If this PR relates to an existing issue or change proposal, please link to it. Include any other background context that would help reviewers understand the motivation for this PR.


Checklist:

  • Added a file to CHANGELOG.d for this PR (see CHANGELOG.d/README.md)
  • Added myself to CONTRIBUTORS.md (if this is my first contribution)
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

@JordanMartinez JordanMartinez merged commit c35d12b into es-modules+purity-annotations Feb 20, 2022
@JordanMartinez JordanMartinez deleted the add-changelog branch February 20, 2022 13:56
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