Replies: 2 comments 1 reply
-
|
Hi @busches I don't know if @dex4er has read this but I think he can give you some information about it. |
Beta Was this translation helpful? Give feedback.
-
|
It is complicated. We could have ESM modules for main context (not renderer). However, our application mixes the contexts in a lot of components and ie. some React components imports some "node:*" modules ("fs", "crypto", "net", "http", etc.). It is even possible because Electron has some kind of emulator for "require" keyword and it works only for commonjs (not ESM). I think as far as we have a single "require" in the renderer's index.js it won't be possible to migrate to ESM modules. And it is also all-or-nothing decision, so basically it'll be a major rewriting of the project that brings incompatibliity for plugins. At least we should try: staying with CommonJS modules will lock us with old versions of the external libraries forever. Moving forward is the only logical solution. We might do it in some steps:
It will be a long and painfull way to enable ESM in this project. The context: https://www.electronjs.org/docs/latest/tutorial/esm |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What's the plan for being able to use ESM only dependencies? There appear to be a few options, transpiling them again or converting our project to also emit ESM. As more and more dependendencies switch to only ESM support, we'll need a way forward to support them in the project or a plan to move off them.
Beta Was this translation helpful? Give feedback.
All reactions