-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
module: import unload module strategy #5895
Comments
To what purpose? |
To reduce memory use. @bnoordhuis |
I don't think that would make a significant difference. V8 is going to keep the script source in memory anyway. |
Maybe V8 can provide API to remove script source. And unload a module and reload is useful for hot patch. |
V8 uses the script source whenever it optimizes or deoptimizes a function. It's also needed for However, if you want to reload modules, you can do that by manipulating |
I've always been under the impression that |
Does |
@coreyleelarson If you transpile your modules with Babel, babel converts |
@SEAPUNK It must be something else I'm doing wrong, then. |
-1 on this, given that the discussion seems to have dropped off, closing. Can reopen if necessary. |
Let's re-open. This issue is quite old, however with ES6 modules now, one may desire to |
@naturalethic you can go check if an issue on https://github.com/nodejs/modules doesn't already include this and then open one there. |
I need this to test a file that has an IIFE on the top level |
A module always loaded in cache. If we only use once, I recommend add strategy to unload the module.
Like the linux kernel do.
The text was updated successfully, but these errors were encountered: