-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basic node compatibity mode #12295
Comments
Hey, Is there currently any work being done on this, or has someone else already picked up this issue and could give me some pointers on where I could help? Simply resolving packages from the local |
Compatibility mode should be enabled per-import, so that users aren't forced to "poison" entire process for a single Node-only dependency. CJS and extensionless imports are on the way out: https://blog.sindresorhus.com/hello-modules-d1010b4e777b. https://deno.land/std/node/import_map.json would simplify writing or generating ESM that works on both runtimes. |
That sounds nice, but is not really feasible to apply different resolution schemes per import.
I don't believe that's true. It will take years before CJS are abandoned by community and few more to be removed from Node (if ever). |
Do we only use "module" property? I believe "module" property is a non-standard property used by some bundlers like rollup, webpack, etc, and most npm packages don't provide it. Another question: Do we provide global |
Could the flag name be changed from |
|
Thinking about:
I'm leaning towards bundling Curious to hear other ideas. |
optionally passing the std version (with a recent default that could be overridden), would at least enable node/std to update independently of deno. e.g. update: #12508 makes this an env variable |
Does it need to be one version behind? Why not release |
Why not simply pin a |
That's the current release workflow, additionally an update to
Because it would have to be one version behind as mentioned above. |
I think we should keep |
I'm not a fan of that, we'd need to branch our "runtime setup" code to achieve that. @kitsonk do you have an opinion? |
It is a very bad idea. The number of security advisories that are related to |
It hasn't been dropped from the spec, it was moved out of annex B and made normative optional: tc39/ecma262#2125 |
I checked |
Apologies... I just remember the debate, forgot it was moved to Annex B. I got confused on the effort to remove everything from Annex B, but that it was a compromise to move this to Annex B. Either way, it shouldn't be there and shouldn't be used. |
How about adding another flag that can only be used in compat mode, like |
Can we change the |
That's an interesting idea. I think we should let compat mode settle down a bit first. We're still actively working on it. Ideally compat mode would not require any changes on the cdns. |
Basic compat mode is working. Closing this issue and moving to #12577 |
Make the following work:
node_modules/
folder (actually walk to root from cwd looking for them), open$bare_specifier/package.json
, load file corresponding to"module"
entry feat(compat): Node CJS and ESM resolvers #12424The text was updated successfully, but these errors were encountered: