Open
Description
Motivation
Once Node.js 16 becomes LTS, it will become a third LTS version with native ES modules support.
Some maintainers have already started migrating their packages to be pure ES modules.
See the gist for an explanation of what it a pure ESM package.
In practice, it means that we drop support for CommonJS and drop support for older node versions (10.x).
Dependencies
Making @web
packages pure ES modules would enable us to use dependencies that are pure ES modules too:
cli-cursor@4
- fix(deps): update dependency cli-cursor to v4 #1641estree-walker@3
- fix(deps): update dependency estree-walker to v3 #1241is-stream@3
- fix(deps): update dependency is-stream to v3 #1610globby@12
- fix(deps): update dependency globby to v12 #1583log-update@5
- fix(deps): update dependency log-update to v5 #1728node-fetch@3.0.0
- chore: update node-fetch to 3.0.0 stable #1661
There might be other dependencies that get major bumps with dropping support for CommonJS in future.
Proposed solution
- Update
"exports"
field to remove"require"
entrypoints for all affected packages - Add
"type": "module"
topackage.json
to indicate packages are pure ES modules - Maybe also a few other tweaks, see How can I move my CommonJS project to ESM?