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

cli: rename --loader to --experimental-loader #29752

Closed

Conversation

reasonablytall
Copy link
Contributor

@reasonablytall reasonablytall commented Sep 28, 2019

Renames the --loader cli argument to --experimental-loader. This is
to clearly indicate the esm loader feature as experimental even after
esm is no longer experimental.

Also minorly alters the --experimental-loader docs to say that the
passed loader can be an esm module.

An alternative to this PR is to leave things unchanged and continue to use --experimental-modules to allow the use of --loader, even after ECMAScript modules are unflagged. This would reduce the number of different argument schemes a hypothetical script that wraps node would need to try, as discussed here: nodejs/modules#351 (comment)

Refs: nodejs/modules#351 (comment)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@addaleax
Copy link
Member

@addaleax addaleax commented Sep 28, 2019

Is the intention to go back to using --loader once ESM is no longer experimental? If so – and maybe also if not – I’d recommend providing --loader as an (for-now-)undocumented alias via AddAlias().

@guybedford
Copy link
Contributor

@guybedford guybedford commented Sep 28, 2019

@addaleax the intention is to unflag modules while leaving loader as experimental for the time being, unflagging only after the development work to bring loaders to stable. Whether this could happen for 12 or only in 13 is another question too, and one we were hoping to get some feedback from on the releases group side.

@addaleax
Copy link
Member

@addaleax addaleax commented Sep 28, 2019

@guybedford Okay, then replace “once ESM is no longer experimental” with “once ESM loaders are no longer experimental” :)

@reasonablytall
Copy link
Contributor Author

@reasonablytall reasonablytall commented Sep 28, 2019

Using --experimental-loader prints an experimental warning message, so having --loader as an undocumented alias seems reasonable to me. I'll make the change.

The check is failing because I use cli as a subsystem. I'll change that to src since node_options.cc is the most affected.

@addaleax
Copy link
Member

@addaleax addaleax commented Sep 28, 2019

The check is failing because I use cli as a subsystem. I'll change that to src since node_options.cc is the most affected.

I would ignore that, tbh. cli or esm are both better choices than src, imo.

Renames the `--loader` cli argument to `--experimental-loader`.  This is
to clearly indicate the esm loader feature as experimental even after
esm is no longer experimental.

Also minorly alters the `--experimental-loader` docs to say that the
passed loader can be an esm module.

Refs: nodejs/modules#351 (comment)
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Sep 28, 2019

@addaleax addaleax added the cli label Sep 28, 2019
lpinca
lpinca approved these changes Sep 28, 2019
Copy link
Contributor

@cjihrig cjihrig left a comment

I think doc/node.1 needs to be updated as well.

@reasonablytall reasonablytall requested a review from cjihrig Sep 30, 2019
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Oct 1, 2019

@Trott
Copy link
Member

@Trott Trott commented Oct 1, 2019

Landed in 15fb02a

@Trott Trott closed this Oct 1, 2019
Trott added a commit that referenced this issue Oct 1, 2019
Renames the `--loader` cli argument to `--experimental-loader`.  This is
to clearly indicate the esm loader feature as experimental even after
esm is no longer experimental.

Also minorly alters the `--experimental-loader` docs to say that the
passed loader can be an esm module.

Refs: nodejs/modules#351 (comment)

PR-URL: #29752
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
targos added a commit that referenced this issue Oct 1, 2019
Renames the `--loader` cli argument to `--experimental-loader`.  This is
to clearly indicate the esm loader feature as experimental even after
esm is no longer experimental.

Also minorly alters the `--experimental-loader` docs to say that the
passed loader can be an esm module.

Refs: nodejs/modules#351 (comment)

PR-URL: #29752
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

9 participants