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.
Loaders can expose and exported constructor that creates an object with functions matching the names the hooks they implement.
This allows Loaders to function even within Realms that have frozen globals.
Globals would not work if Loader has a frozen realm.
This avoids potential overriding by dependencies by 3rd party modules.
This guarantees that 3rd party modules could import the hook if they know the specifier of the loader.
Use policies or similar to restrict this capability.
This does not allow them to use the same instance of loader object as the runtime since an independent call only made by the runtime can be used to obtain a unique object.
Two claims stick out to me in this mix:
This avoids potential overriding by dependencies by 3rd party modules.
This does not allow them to use the same instance of loader object as the runtime since an independent call only made by the runtime can be used to obtain a unique object.
Suppose we have three loaders root_app/loaders/alice.mjs, root_app/loaders/bob.mjs, and node_modules/dep/eve.mjs, each loaded in that order.
What would eve.mjs see here? If eve.mjs is in the same realm as the alice.mjs and bob.mjs loaders, or at least share the same module cache, both of the claims in question are false. And based on my reading, it's unclear whether this is the case or not, and I can't find any language explicitly stating one way or the other.
In the "How do loaders declare what hooks they implement?" part of the loaders design document, it makes several claims regarding loaders imported by third parties:
Two claims stick out to me in this mix:
Suppose we have three loaders
root_app/loaders/alice.mjs,root_app/loaders/bob.mjs, andnode_modules/dep/eve.mjs, each loaded in that order.What would
eve.mjssee here? Ifeve.mjsis in the same realm as thealice.mjsandbob.mjsloaders, or at least share the same module cache, both of the claims in question are false. And based on my reading, it's unclear whether this is the case or not, and I can't find any language explicitly stating one way or the other.