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

doc: add doc for --loader option #22104

Closed
wants to merge 6 commits into from
Closed

Conversation

SirR4T
Copy link
Contributor

@SirR4T SirR4T commented Aug 3, 2018

Fixes #21230

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added cli Issues and PRs related to the Node.js command line interface. doc Issues and PRs related to the documentations. labels Aug 3, 2018
doc/api/cli.md Outdated
added: v9.0.0
-->

Specify a customer loader, to load [ECMAScript Modules][].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/customer/custom

Also, it should be noted that this is still an experimental feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's been brought up before but given that --loader is still experimental I think it would it be better if it were --experimental-loader in much the same way other experimental stuff is prefixed with --experimental-

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdalton given you have to run node with --experimental-modules anyway to use this - why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @jasnell ! fixed the typo.
Should i mention here, that it needs to be used with --experimental-modules?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benjamingr

given you have to run node with --experimental-modules anyway to use this - why?

I like the consistency of the --experimental- prefix for experimental things. The prefix makes it explicit that the feature/sub-feature is experimental.

doc/api/cli.md Outdated
@@ -687,3 +694,4 @@ greater than `4` (its current default value). For more information, see the
[debugger]: debugger.html
[emit_warning]: process.html#process_process_emitwarning_warning_type_code_ctor
[libuv threadpool documentation]: http://docs.libuv.org/en/latest/threadpool.html
[ECMAScript Modules]: esm.html#loader_hooks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esm.html#esm_loader_hooks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! fixed now.

@vsemozhetbyt
Copy link
Contributor

cc @nodejs/modules-active-members?

@vsemozhetbyt
Copy link
Contributor

It seems doc/node.1 and PrintHelp() in src/node.cc should also be updated?

@vsemozhetbyt vsemozhetbyt added the esm Issues and PRs related to the ECMAScript Modules implementation. label Aug 3, 2018
@SirR4T
Copy link
Contributor Author

SirR4T commented Aug 6, 2018

@vsemozhetbyt Added docs for node.1 and src/node.cc, though I couldn't maintain consistency in the doc strings. Is that fine?

@vsemozhetbyt
Copy link
Contributor

cc @nodejs/documentation for node.1 and src/node.cc changes.

@vsemozhetbyt
Copy link
Contributor

Linter issue:

doc/api/cli.md
  1:1  warning  Missing newline character at end of file  final-newline  remark-lint

@SirR4T
Copy link
Contributor Author

SirR4T commented Aug 6, 2018

@vsemozhetbyt thanks, installed markdown linter now. Will ensure i run this, before pushing any more doc updates.

@vsemozhetbyt
Copy link
Contributor

cc @nodejs/build-infra re CI error:

not ok 2295 sequential/test-fs-watch
  ---
  duration_ms: 0.111
  severity: fail
  exitcode: 1
  stack: |-
    internal/fs/watchers.js:170
        throw error;
        ^
    
    Error: ENOSPC: no space left on device, watch '/home/travis/build/nodejs/node/test/.tmp.0/watch.txt'

@vsemozhetbyt

This comment has been minimized.

@vsemozhetbyt

This comment has been minimized.

@vsemozhetbyt
Copy link
Contributor

@nodejs/documentation Can anybody confident enough look into node.1 and node.cc changes so we could have some more LGTM?

@vsemozhetbyt

This comment has been minimized.

@vsemozhetbyt

This comment has been minimized.

@vsemozhetbyt

This comment has been minimized.

@vsemozhetbyt
Copy link
Contributor

Another CI: https://ci.nodejs.org/job/node-test-pull-request/16313/

If CI is green, I will land this PR tomorrow if nobody objects.

Copy link
Contributor

@sagirk sagirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

@vsemozhetbyt
Copy link
Contributor

In last CIs, it seems we have some repetitive fails in parallel/test-cli-node-print-help in node-test-commit-linux-containered that may be relative. Can anybody look into?

One more CI to be sure: https://ci.nodejs.org/job/node-test-pull-request/16332/

@SirR4T
Copy link
Contributor Author

SirR4T commented Aug 10, 2018

@vsemozhetbyt sorry, this maybe completely off topic, but why are --experimental-modules, --experimental-vm-modules, and --preserve-symlinks predicated on having i18n support?

@vsemozhetbyt
Copy link
Contributor

Sorry, this also puzzled me and I thought that it was because I just did not know C++ :)

@SirR4T
Copy link
Contributor Author

SirR4T commented Aug 16, 2018

@jdalton : updated the doc for --loader option. Sounds good? Open to other wordings / text as well, to put the "experimental" point across.

@jdalton
Copy link
Member

jdalton commented Aug 16, 2018

@SirR4T It's better. But --loader is also experimental. So maybe something like

Specify the file of the custom [experimental ECMAScript module][] loader.

@SirR4T
Copy link
Contributor Author

SirR4T commented Aug 16, 2018

thanks, @jdalton , fixed.

doc/api/cli.md Outdated
@@ -687,3 +694,4 @@ greater than `4` (its current default value). For more information, see the
[debugger]: debugger.html
[emit_warning]: process.html#process_process_emitwarning_warning_type_code_ctor
[libuv threadpool documentation]: http://docs.libuv.org/en/latest/threadpool.html
[experimental ECMAScript Module]: esm.html#esm_loader_hooks
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt Aug 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: reference list is sorted in ASCII order, so this item needs to be placed before the [libuv threadpool documentation].

Copy link
Contributor Author

@SirR4T SirR4T Aug 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will fix that. Any way we could add this as a rule to make lint?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be helpful to have it as a rule as we are already a bit messy in some docs in these sections,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would updating remark-preset-lint-node to also include remark-lint-alphabetize-lists work? I expect this would cause build failures, if remark-preset-lint-node was updated before fixes for that landed in master. How would the transition be handled?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that remark-lint-alphabetize-lists can fix this case as reference lists are not common markdown lists. Maybe @rubys can tell if there is a ready easy solution for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark calls those lines definitions. Looking at the source to remark-lint-alphabetize-lists
, if list where changed to definition on line 18, the code would do what you want.

@vsemozhetbyt vsemozhetbyt removed the blocked PRs that are blocked by other issues or PRs. label Aug 16, 2018
@vsemozhetbyt
Copy link
Contributor

#22271 is merged, so let's unblock and run CI:
https://ci.nodejs.org/job/node-test-pull-request/16490/

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Aug 16, 2018

@vsemozhetbyt
Copy link
Contributor

Landed in 9d6619e
Thank you!

vsemozhetbyt pushed a commit that referenced this pull request Aug 18, 2018
PR-URL: #22104
Fixes: #21230
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
targos pushed a commit that referenced this pull request Aug 19, 2018
PR-URL: #22104
Fixes: #21230
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
@SirR4T SirR4T deleted the addCliDocForLoader branch August 22, 2018 05:31
targos pushed a commit that referenced this pull request Sep 3, 2018
PR-URL: #22104
Fixes: #21230
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
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. doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

doc: missing cli options
9 participants