tc39 / proposal-shadowrealm

ECMAScript Proposal, specs, and reference implementation for Realms
https://tc39.es/proposal-shadowrealm/
1.44k stars 67 forks source link

concern about a module graph per realm for the web #261

Closed caridy closed 3 years ago

caridy commented 4 years ago

@domenic raised this concern during a conversation today. From what I gathered, the main issue will be to have more than one module graph per window. He think this is problematic due to how intertwine these two concepts are. Also mentioned memory, and allocation of multiple instances of the same module source as another potential issue.

From the proposal perspective, the reason to not reuse the module graph from the incubator realm is mostly because 2 reasons:

Up to this point, reusing module instances from other realms was only possible via the compartments API (another proposal).