Skip to content
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

type: module should also enable experimental-json-modules #32314

Closed
haraldrudell opened this issue Mar 17, 2020 · 2 comments
Closed

type: module should also enable experimental-json-modules #32314

haraldrudell opened this issue Mar 17, 2020 · 2 comments
Labels
cli Issues and PRs related to the Node.js command line interface. esm Issues and PRs related to the ECMAScript Modules implementation. feature request Issues that request new features to be added to Node.js.

Comments

@haraldrudell
Copy link

When Dennis Ritchie came up with the shebang in 1979, he did not consider Node.js v12.0.0

So on the shebang line #!/usr/bin/env node you cannot provide arguments

If you do a different shebang line, it is no longer portable to macOS or Android

Therefore, adding type:module to package.json should enable every reasonable experimental module feature, in particular experimental-json-modules if it doesn't break us, it will make us stronger

People who do not want this behavior should use an intermediate script or custom command-line like json importers have to do now

node -v && uname -a
v13.11.0
Darwin c87m1.local 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64

@devsnek
Copy link
Member

devsnek commented Mar 17, 2020

This is by design. If json was supposed to be enabled with modules by default we wouldn't have a separate flag for it.

@devsnek devsnek added esm Issues and PRs related to the ECMAScript Modules implementation. question Issues that look for answers. cli Issues and PRs related to the Node.js command line interface. labels Mar 17, 2020
@GeoffreyBooth
Copy link
Member

I'm sorry, but this is by design. There's also a good chance that experimental-json-modules will go away or change dramatically, because of WICG/webcomponents#839. See also nodejs/modules#427.

@GeoffreyBooth GeoffreyBooth added feature request Issues that request new features to be added to Node.js. and removed question Issues that look for answers. labels Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs related to the Node.js command line interface. esm Issues and PRs related to the ECMAScript Modules implementation. feature request Issues that request new features to be added to Node.js.
Projects
None yet
Development

No branches or pull requests

3 participants