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
{{ message }}
This repository was archived by the owner on Sep 2, 2023. It is now read-only.
Right now loaders cannot directly share data from their implementation, the global preload code, or the modules that they generate. We need to add a communications channel such as a MessagePort between all of these locations (e.g. nodejs/node#31229 (comment) ).
Without these communications channels a few features are not feasible:
safely saving primordials in loader code to be used in generated modules. e.g. Saving WebAssembly.instantiateStreaming() in the global preload in order to use it inside of a module source text.
passing events requiring new load operations from application code to the loader. e.g. for hot reloading/mocking (e.g. testdouble )
having modules directly share references between each-other. e.g. having a generated module share some under underlying state with another friendly module.
I think adding a parameter to the global preload arguments is simple enough, but I do not have a clear idea on how we want to setup a channel between modules and the others. One idea is to allow putting it on import.meta if the module loader declares it somehow. Overall, it seems we need to implement this feature regardless of other designs.