You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working on #263 we discovered that ModuleMap::clear_module_map is quite questionable way to interact with the runtime when snapshot is provided. Its purpose is to remove all modules from the module map but the ones passed as an argument. We use this method after we deserialize a snapshot, to remove all ext: modules and leave node: modules intact.
In #263 we need a way to load ext: modules during runtime, so as a temporary hack we added a few ext: modules to exclusions, but that's not a great solution. I think we need to rearchitect how module loading/resolution works, by always leaving all modules coming from the snapshot in the module map, but only allow importing ext: modules from other ext: modules (ie. user code should still not be able to load any of the ext: modules directly).
The text was updated successfully, but these errors were encountered:
…369)
A new "ModuleMap::resolve" function was added that is now used in
favor of directly calling "loader.resolve". This method performs
additional checks that prohibit resolution of "ext:" modules from
modules that are not "ext:" or "node:" modules.
This will allow us to sunset "RuntimeOptions::preserve_snapshotted_modules"
and will greatly help with lazy loading ES modules for internal runtime code.
A bit different approach than suggested in the issue, but closes#363.
Working on #263 we discovered that
ModuleMap::clear_module_map
is quite questionable way to interact with the runtime when snapshot is provided. Its purpose is to remove all modules from the module map but the ones passed as an argument. We use this method after we deserialize a snapshot, to remove allext:
modules and leavenode:
modules intact.In #263 we need a way to load
ext:
modules during runtime, so as a temporary hack we added a fewext:
modules to exclusions, but that's not a great solution. I think we need to rearchitect how module loading/resolution works, by always leaving all modules coming from the snapshot in the module map, but only allow importingext:
modules from otherext:
modules (ie. user code should still not be able to load any of theext:
modules directly).The text was updated successfully, but these errors were encountered: