03:50
<sirisian>
Jack Works: I am down a rabbit hole. Not sure if you remember: https://github.com/tc39/proposal-compartments/issues/11 Was your intention there to do a babel-like transform on a Javascript file?
03:55
<sirisian>
At a high level do any of these proposals allow one to create an import "preprocessor" that hooks all imports (and their import attributes), modify their source text, and output a module? (And then hook any new imports if applicable in that module recursively). Or is that out of scope for the proposals?
04:12
<kriskowal>
That is certainly within scope for a Module instance constructor with an importHook.
04:27
<sirisian>
Would this work for the "root" realm (not sure the term). Like in a node.js environment where an importHook could process everything? Or would you just create a ShadowRealm (or compartment?) and run the index file in a wrapper?
08:50
<Jack Works>
Jack Works: I am down a rabbit hole. Not sure if you remember: https://github.com/tc39/proposal-compartments/issues/11 Was your intention there to do a babel-like transform on a Javascript file?
Yes. The old API allows us to run a text based hook before evaluation. This allows, for example, run TypeScript file by calling tsc to transform the source.