-
Notifications
You must be signed in to change notification settings - Fork 44
Remove --experimental-vm-modules flag #507
Comments
Can we get clarification on why the desire to use vm instead of loaders? |
Jest needs the VM modules, and is currently shipping code that use the flagged APIs. We use it to sandbox tests. (I have no comment about coffeescript usage of those apis, but in case you asked generally) |
@SimenB what kind of sandboxing are you doing? I'm assuming it is in a different context? And can you explain what the loader APIs lack that you might need that vm.Module provides |
Different contexts, yes. We either create one for a node environment or use the one JSDOM creates to emulate a browser environment. I don't think the loader API allows any custom The currently provided vm APIs works great for our use cases, from my experimentation and testing. |
I personally would prefer if we had APIs that expose more targeted hooks per-context (loader-like). Last time I tried to implement a working non-trivial system using the existing vm APIs, I had to pretty much copy all of |
I'm personally fine requiring people to use an experimental flag in Jest until you're happy with the implementation in Node fwiw, so no rush unflagging on my part. I just chimed in with a use case (backed by shipping code) for the current API 🙂 The implementation in jest is most definitely also experimental, so having that flag saves us from adding our own |
I've said this before, I think that |
@bmeck I had not seen https://nodejs.org/api/esm.html#esm_transpiler_loader |
This proposal is to remove the
--experimental-vm-modules
cli flag.vm.Module
is required for tools that deal with transpilation, e.g. Coffeescript (jashkenas/coffeescript#5018 (comment)) in order to correctly support ESM modules.The text was updated successfully, but these errors were encountered: