-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include CJS / AMD module exports under MINIMAL_RUNTIME #23282
base: main
Are you sure you want to change the base?
Conversation
I would guess this was to save code size. Do we have a setting to know when these exports are needed? If so we could enable it only then. AIUI the general idea of minimal runtime is to add such extra code on an opt-in basis, so users don't get things they aren't actively using. |
The problem is that without this then in #23261 closure compile will see the whole factory function as dead and delete it. So having an option not to include this will break However, I'm also noticing that closure isn't working very well in other ways when |
In that case, perhaps adding this in minimal runtime only when closure is enabled makes sense? But otoh the code size regressions measured here are with closure IIRC, so that wouldn't directly help.
Interesting point. Maybe there is some correlation there. But I think that would be a pretty big change. As background you say that #23261 makes these changes necessary, but I don't quite see the need for that PR - it looks like an internal cleanup, mostly? Is the |
Its not just the I'll see if I can find a way to avoid this. |
I don't see why `-sMINIMAL_RUNTIME` users would not want the same exporting of the module. The EXPORT_ES6 behaviour was already matching. This change is necessary are part of emscripten-core#23261 which feeds the modularized code through closure and our acorn optimizations. Without this closer things the entire module factory is seen as unused and is deleted.
1b2c0ad
to
03b9a0d
Compare
I don't see why
-sMINIMAL_RUNTIME
users would not want the same exporting of the module. The EXPORT_ES6 behaviour was already matching. This change is necessary are part of #23261 which feeds the modularized code through closure and our acorn optimizations. Without this closer things the entire module factory is seen as unused and is deleted.