Es Modules in the runtime? #2666
arthuro555
started this conversation in
Enhancement ideas (and their technical discussions)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Should we consider a way to use es modules in the runtime? They have some advantages:
And, if we go as far as to convert the whole Runtime to es modules, we could gain tree shaking, which could allow to remove dead code making the games less bloated and therefore faster, especially when using a few features of a lot of extensions. Though, this would mean a full rewrite of the code generator and adding something like esbuild to the GDevelop build pipeline (that should be pretty easy to do and not impact too much the performance though).
We can also try to add support for writing an extension with es modules, by only building
index.mjs
if one such file is present in the extension root directory and building it in esbuild with the optionbundle: true
, though that wouldn't let us profit from the really interesting points like tree shaking or resolving PIXI typing issues, it would allow using and updating npm packages more easily.Beta Was this translation helpful? Give feedback.
All reactions