Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.4k
doc: clarify options for single customization hooks thread#53006
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -113,7 +113,9 @@ changes: | ||||||||||||||||
| `initialize` hook. | ||||||||||||||||
| Register a module that exports [hooks][] that customize Node.js module | ||||||||||||||||
| resolution and loading behavior. See [Customization hooks][]. | ||||||||||||||||
| resolution and loading behavior. Registering modules that export [hooks][] only | ||||||||||||||||
| has an effect on the main thread. All worker threads inherit the customization | ||||||||||||||||
| hooks chain of the main thread. See [Customization hooks][]. | ||||||||||||||||
Comment on lines
+116
to
+118
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I know that for the main thread, obviously the hooks don’t apply to any modules already imported before the hooks are registered, and then they do apply to modules imported after registration; is it the same for worker threads? So if I have code that creates a new worker thread, then registers hooks, and then code within the worker thread does And what happens when you call | ||||||||||||||||
| ### `module.syncBuiltinESMExports()` | ||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1008,7 +1008,10 @@ changes: | ||
| * `execArgv` {string\[]} List of node CLI options passed to the worker. | ||
| V8 options (such as `--max-old-space-size`) and options that affect the | ||
| process (such as `--title`) are not supported. If set, this is provided | ||
| as [`process.execArgv`][] inside the worker. By default, options are | ||
| as [`process.execArgv`][] inside the worker. `--experimental-loader` | ||
| and `--import` with `module.register()` calls to contribute to the hooks | ||
| ||
| chain do not have an effect on the worker threads. These options affect | ||
| only the configuration of the main thread. By default, options are | ||
| inherited from the parent thread. | ||
| * `stdin` {boolean} If this is set to `true`, then `worker.stdin` | ||
| provides a writable stream whose contents appear as `process.stdin` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“only has an effect on the main thread” sounds like the hooks don’t apply to worker threads. I just wouldn’t add anything here. I think the default assumption is that customization hooks apply everywhere, and thanks to the recent PR, now they do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, removed the change in
cli.mdnow.