Switch to ESM only for v10?
See original GitHub issueThe current build setup is complicated (and slow).
Pros:
- Simpler builds
- Faster builds with esbuild
- Tree shaking?
Cons:
- Different import script in browsers
- Loses support for legacy browsers? (@knsv This might be an issue with using module: ES2022 in lazy load also)
- Downstream projects might have to handle small migration. But not sure if anything will be broken as
require
has already been broken due to D3 dependency as @aloisklink mentioned here
Related:
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Getting Started with (and Surviving) Node.js ESM
The Node.js ecosystem is shifting towards ESM. We examine what lies in store for application and library authors, learn some of challenges ...
Read more >What does it take to support Node.js ESM?
I have worked on all The Guild's libraries and graphql-js to support ESM. Here is how you can do it too.
Read more >ECMAScript modules | Node.js v19.3.0 Documentation
An import statement can reference an ES module or a CommonJS module. import statements are permitted only in ES modules, but dynamic import()...
Read more >How to transpile ES modules with webpack and Node.js
ES modules (ESM) are the recommended way for writing code for both ... we can export constants, classes, and even just simple variables....
Read more >Super Simple Start to ESModules in Node.js
js project will sometimes experience breaking changes and that's reasonable, but breaking the module system is just a non-starter. So using ESM ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We should fix those docs asap. I’ll change it now.
In principle we are not running in node but in the browser which is a point for esm. What I find hard about this is to figure out how this will affect the downstreams projects