Replies: 4 comments 9 replies
-
Does snapshotting even work with ESM in V8? |
Beta Was this translation helpful? Give feedback.
-
The first question I ask myself is: would there be any advantage for us from having core modules written in ESM? |
Beta Was this translation helpful? Give feedback.
-
Note that technically, with #37587 (specifically this commit), part of core will effectively be ESM. |
Beta Was this translation helpful? Give feedback.
-
The core libs are always going to be loaded with a special loader, right? So to be precise it's going to be a special version of ESM just like it's now a special version of CommonJS, and I think most of the obstacles can be solved with some special internal logic that won't affect the userland ;) |
Beta Was this translation helpful? Give feedback.
-
A simple question with a not so simple answer: Right now all of Node.js core lib is implemented as CommonJS. It's not loaded using the same mechanisms however, we pre-compile most (if not all of it), and statically link it into the Node.js binary... so here is the key question: Is there a reasonable path forward to migrating Node.js' internal lib to ESM, either incrementally or all at once? What would be the challenges for doing so?
Beta Was this translation helpful? Give feedback.
All reactions