question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switch to ESM only for v10?

See original GitHub issue

The 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:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sidharthv96commented, Oct 7, 2022

We should fix those docs asap. I’ll change it now.

0reactions
knsvcommented, Oct 7, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found