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

module: add createRequireFunction method #19360

Closed
wants to merge 0 commits into
base: master
from

Conversation

@devsnek
Member

devsnek commented Mar 14, 2018

useful method for all sorts of stuff such as relative require from project root or whatever else you can come up with

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
@devsnek

This comment has been minimized.

Show comment
Hide comment
Show outdated Hide outdated doc/api/modules.md Outdated
Show outdated Hide outdated doc/api/modules.md Outdated
Show outdated Hide outdated doc/api/modules.md Outdated
Show outdated Hide outdated lib/module.js Outdated
Show outdated Hide outdated test/parallel/test-module-make-require.js Outdated
Show outdated Hide outdated doc/api/modules.md Outdated
Show outdated Hide outdated doc/api/modules.md Outdated
Show outdated Hide outdated doc/api/modules.md Outdated
Show outdated Hide outdated doc/api/modules.md Outdated
Show outdated Hide outdated lib/module.js Outdated
Show outdated Hide outdated doc/api/modules.md Outdated
@vkurchatkin

This comment has been minimized.

Show comment
Hide comment
@vkurchatkin

vkurchatkin Mar 15, 2018

Member

What is the use-case for this?

Member

vkurchatkin commented Mar 15, 2018

What is the use-case for this?

@devsnek

This comment has been minimized.

Show comment
Hide comment
@devsnek

devsnek Mar 15, 2018

Member

@vkurchatkin mostly just what the example has, but i've found myself creating require functions twice now for things not related to this (mostly very reflective/hacky stuff) and so i thought it might be useful to just make a utility function

Member

devsnek commented Mar 15, 2018

@vkurchatkin mostly just what the example has, but i've found myself creating require functions twice now for things not related to this (mostly very reflective/hacky stuff) and so i thought it might be useful to just make a utility function

@devsnek

This comment has been minimized.

Show comment
Hide comment
@devsnek

devsnek Mar 17, 2018

Member

this could use a few more approvals

Member

devsnek commented Mar 17, 2018

this could use a few more approvals

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Mar 18, 2018

Member

The bar for new APIs should be higher than 'might be useful,' IMO. The price of design mistakes is high.

Member

bnoordhuis commented Mar 18, 2018

The bar for new APIs should be higher than 'might be useful,' IMO. The price of design mistakes is high.

@devsnek

This comment has been minimized.

Show comment
Hide comment
@devsnek

devsnek Mar 21, 2018

Member

@bnoordhuis this is designed to alleviate some issues with cjs and esm interop, it's definitely something that will be useful and used, not just a random feature. if you're worried about design mistakes I encourage that you to review this in depth :)

Member

devsnek commented Mar 21, 2018

@bnoordhuis this is designed to alleviate some issues with cjs and esm interop, it's definitely something that will be useful and used, not just a random feature. if you're worried about design mistakes I encourage that you to review this in depth :)

@jdalton

This comment has been minimized.

Show comment
Hide comment
@jdalton

jdalton Mar 21, 2018

Member

this is designed to alleviate some issues with cjs and esm interop

Still seems more inconvenient than needed.
I'm lukewarm on the API as is, but dig exposing makeRequireFunction in some way.

Member

jdalton commented Mar 21, 2018

this is designed to alleviate some issues with cjs and esm interop

Still seems more inconvenient than needed.
I'm lukewarm on the API as is, but dig exposing makeRequireFunction in some way.

@devsnek devsnek closed this Apr 22, 2018

@devsnek devsnek deleted the devsnek:feature/module-makerequire branch Apr 22, 2018

@devsnek devsnek restored the devsnek:feature/module-makerequire branch Jun 14, 2018

@devsnek devsnek reopened this Jun 14, 2018

@bmeck

This comment has been minimized.

Show comment
Hide comment
@bmeck

bmeck Jun 14, 2018

Member

CC: @nodejs/modules

I'd like to reopen this for discussion in light of some conversation going on in the modules WG nodejs/modules#130 (comment) and the comments leading up to it.

In particular, if exposing this is better than shipping import.meta.require. It does enable what appears to be better ergonomics than telling people to import a require() function and also is a means of keeping us from inevitably encouraging using CJS APIs into out initial ESM implementation.

It does have the ability for us to create new require() functions for other uses outside of the import.meta.require discussion and I'd like to see if any of those are problematic.

I'd note that you can create something akin to makeRequireFunction ~with :

function makeRequire(filepath) {
  const Module = require('module');
  const m = new Module(filepath, null);
  m._compile('module.exports=require', filepath);
  return m.exports;
}
I don't think using `m._compile` is problematic in my example and would refrain from that discussion. I took a look at how much `m._compile` corresponds to in the wild usage and I see it used in a variety of places and don't think that it could easily be changed from current the CJS implementation : https://github.com/search?q=_compile+language%3Ajavascript&type=Code , there are false positives but plenty that look to be usage of it from Node's core.

In particular, this is an API ergonomics question I think.

Member

bmeck commented Jun 14, 2018

CC: @nodejs/modules

I'd like to reopen this for discussion in light of some conversation going on in the modules WG nodejs/modules#130 (comment) and the comments leading up to it.

In particular, if exposing this is better than shipping import.meta.require. It does enable what appears to be better ergonomics than telling people to import a require() function and also is a means of keeping us from inevitably encouraging using CJS APIs into out initial ESM implementation.

It does have the ability for us to create new require() functions for other uses outside of the import.meta.require discussion and I'd like to see if any of those are problematic.

I'd note that you can create something akin to makeRequireFunction ~with :

function makeRequire(filepath) {
  const Module = require('module');
  const m = new Module(filepath, null);
  m._compile('module.exports=require', filepath);
  return m.exports;
}
I don't think using `m._compile` is problematic in my example and would refrain from that discussion. I took a look at how much `m._compile` corresponds to in the wild usage and I see it used in a variety of places and don't think that it could easily be changed from current the CJS implementation : https://github.com/search?q=_compile+language%3Ajavascript&type=Code , there are false positives but plenty that look to be usage of it from Node's core.

In particular, this is an API ergonomics question I think.

@benjamingr

+1 good idea I needed this before and had to use hacks.

@jkrems

jkrems approved these changes Jun 15, 2018

I have needed this at various times (mostly for "require relative to project directory"). I'm not sure this is a replacement for import.meta.require but I think it's a worthwhile feature even from a pure CJS perspective.

@devsnek devsnek changed the title from module: add makeRequire method to module: add creataeRequireFunction method Jun 15, 2018

@devsnek devsnek changed the title from module: add creataeRequireFunction method to module: add createRequireFunction method Jun 15, 2018

Show outdated Hide outdated doc/api/modules.md Outdated
@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Jun 15, 2018

Member

makeRequireFunction() exists because it was the least effort to get what I wanted. Is this PR exposing it because it's a good fit for a particular use case, or simply because it's there?

(I like to think my code is perfect and eternal in its platonic splendor so I won't mind if it's the first option, but the question needs to be asked.)

Member

bnoordhuis commented Jun 15, 2018

makeRequireFunction() exists because it was the least effort to get what I wanted. Is this PR exposing it because it's a good fit for a particular use case, or simply because it's there?

(I like to think my code is perfect and eternal in its platonic splendor so I won't mind if it's the first option, but the question needs to be asked.)

@bmeck

This comment has been minimized.

Show comment
Hide comment
@bmeck

bmeck Jun 15, 2018

Member

@bnoordhuis I think we have a few use cases showing up:

  1. @jkrems mentions making a require relative to a directory for a project
  2. I mention that exposing this may reduce the desire to expose import.meta.require, which I feel is something we would not be able to remove and might become a burden over time as I explain in the comment on the issue thread when I was reopening this.
  3. @benjamingr has stated they needed it before but hasn't stated exactly for what purpose (would be good to record that).

I personally would prefer to expose this than make import.meta give a way permanently tied to CJS as a recommended way of doing things for what I see as a temporary problem/situation. If asking directly for use cases, I would state to ease the ergonomics of getting access to a require function rather than using hacks is the overall use case. The easier access would also help minimize what we put as permanent APIs into ESM and help people relying on require() to seek alternatives that will work with module graphs that contain ESM / async initialized modules.

Member

bmeck commented Jun 15, 2018

@bnoordhuis I think we have a few use cases showing up:

  1. @jkrems mentions making a require relative to a directory for a project
  2. I mention that exposing this may reduce the desire to expose import.meta.require, which I feel is something we would not be able to remove and might become a burden over time as I explain in the comment on the issue thread when I was reopening this.
  3. @benjamingr has stated they needed it before but hasn't stated exactly for what purpose (would be good to record that).

I personally would prefer to expose this than make import.meta give a way permanently tied to CJS as a recommended way of doing things for what I see as a temporary problem/situation. If asking directly for use cases, I would state to ease the ergonomics of getting access to a require function rather than using hacks is the overall use case. The easier access would also help minimize what we put as permanent APIs into ESM and help people relying on require() to seek alternatives that will work with module graphs that contain ESM / async initialized modules.

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Jun 15, 2018

Member

That sounds reasonable enough but I guess what I'm asking is: is makeRequireFunction() the best possible API to do that, or would (for example) a require hook work better?

I'm trying to get a feel for if a better mechanism than what's in this PR is possible. This PR is simple but it's also fairly inflexible.

Member

bnoordhuis commented Jun 15, 2018

That sounds reasonable enough but I guess what I'm asking is: is makeRequireFunction() the best possible API to do that, or would (for example) a require hook work better?

I'm trying to get a feel for if a better mechanism than what's in this PR is possible. This PR is simple but it's also fairly inflexible.

@bmeck

This comment has been minimized.

Show comment
Hide comment
@bmeck

bmeck Jun 15, 2018

Member

@bnoordhuis the creation of new functions is a bit different in nature, this allows people to create custom functions. In particular for the ESM import.meta.require case the claim I make is that enabling the creation of new require() functions eases the ergonomics vs importing a require() from CJS. An optional argument like require(path, base) would not ease that use case. Also, in order to allow require to be passed around with a specific base you would have to rebind both require and require.resolve to always pass in that argument. I don't see this as an advantage. If there were a clear case where a single require() function may want to change the base it is resolving relative to, a hook might make more sense. As the use cases above don't seem to mesh with having multiple bases for a single require I don't think an option would be as well suited for this.

Member

bmeck commented Jun 15, 2018

@bnoordhuis the creation of new functions is a bit different in nature, this allows people to create custom functions. In particular for the ESM import.meta.require case the claim I make is that enabling the creation of new require() functions eases the ergonomics vs importing a require() from CJS. An optional argument like require(path, base) would not ease that use case. Also, in order to allow require to be passed around with a specific base you would have to rebind both require and require.resolve to always pass in that argument. I don't see this as an advantage. If there were a clear case where a single require() function may want to change the base it is resolving relative to, a hook might make more sense. As the use cases above don't seem to mesh with having multiple bases for a single require I don't think an option would be as well suited for this.

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Jun 16, 2018

Member

An optional argument like require(path, base) would not ease that use case.

I agree, that's just a different kind of inflexible. I'm thinking more along the lines of (for example) making require's decision making pluggable by means of callbacks.

With this PR I'm sure someone is going to open an issue saying "it's great you added X but now I also want to do Y" and we'll all be "uh, yeah, maybe we should've thought of that."

As well, it's ultimately a convenience thing. There's no reason it can't be done as a npm package.

Member

bnoordhuis commented Jun 16, 2018

An optional argument like require(path, base) would not ease that use case.

I agree, that's just a different kind of inflexible. I'm thinking more along the lines of (for example) making require's decision making pluggable by means of callbacks.

With this PR I'm sure someone is going to open an issue saying "it's great you added X but now I also want to do Y" and we'll all be "uh, yeah, maybe we should've thought of that."

As well, it's ultimately a convenience thing. There's no reason it can't be done as a npm package.

targos added a commit that referenced this pull request Sep 18, 2018

2018-09-19, Version 10.11.0 (Current)
Notable changes:

* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to `true`, non-existing parent folders will be
    automatically created.
    #21875
  * Fixed fsPromises.readdir `withFileTypes`.
    #22832
* http2
  * Added `http2stream.endAfterHeaders` property.
    #22843
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom `require` function that will resolve
    modules relative to the `filename` path.
    #19360
* url
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between `file:` URLs and
    absolute paths.
    #22506
* util
  * Added `util.types.isBoxedPrimitive(value)`.
    #22620
* Windows
  * The Windows msi installer now provides an option to automatically
    install the tools required to build native modules.
    #22645
* Added new collaborators:
  * boneskull (https://github.com/boneskull) - Christopher Hiller
* The Technical Steering Committee has new members:
  * apapirovski (https://github.com/apapirovski) - Anatoli Papirovski
  * gabrielschulhof (https://github.com/gabrielschulhof) - Gabriel Schulhof

targos added a commit that referenced this pull request Sep 18, 2018

2018-09-19, Version 10.11.0 (Current)
Notable changes:

* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to `true`, non-existing parent folders will be
    automatically created.
    #21875
  * Fixed fsPromises.readdir `withFileTypes`.
    #22832
* http2
  * Added `http2stream.endAfterHeaders` property.
    #22843
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom `require` function that will resolve
    modules relative to the `filename` path.
    #19360
* url
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between `file:` URLs and
    absolute paths.
    #22506
* util
  * Added `util.types.isBoxedPrimitive(value)`.
    #22620
* Windows
  * The Windows msi installer now provides an option to automatically
    install the tools required to build native modules.
    #22645
* Added new collaborators:
  * boneskull (https://github.com/boneskull) - Christopher Hiller
* The Technical Steering Committee has new members:
  * apapirovski (https://github.com/apapirovski) - Anatoli Papirovski
  * gabrielschulhof (https://github.com/gabrielschulhof) - Gabriel Schulhof

PR-URL: #22932

targos added a commit that referenced this pull request Sep 19, 2018

2018-09-19, Version 10.11.0 (Current)
Notable changes:

* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to `true`, non-existing parent folders will be
    automatically created.
    #21875
  * Fixed fsPromises.readdir `withFileTypes`.
    #22832
* http2
  * Added `http2stream.endAfterHeaders` property.
    #22843
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom `require` function that will resolve
    modules relative to the `filename` path.
    #19360
* url
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between `file:` URLs and
    absolute paths.
    #22506
* util
  * Added `util.types.isBoxedPrimitive(value)`.
    #22620
* Windows
  * The Windows msi installer now provides an option to automatically
    install the tools required to build native modules.
    #22645
* Added new collaborators:
  * boneskull (https://github.com/boneskull) - Christopher Hiller
* The Technical Steering Committee has new members:
  * apapirovski (https://github.com/apapirovski) - Anatoli Papirovski
  * gabrielschulhof (https://github.com/gabrielschulhof) - Gabriel Schulhof

PR-URL: #22932

targos added a commit that referenced this pull request Sep 19, 2018

module: add createRequireFunction method
PR-URL: #19360
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>

targos added a commit that referenced this pull request Sep 19, 2018

2018-09-19, Version 10.11.0 (Current)
Notable changes:

* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to `true`, non-existing parent folders will be
    automatically created.
    #21875
  * Fixed fsPromises.readdir `withFileTypes`.
    #22832
* http2
  * Added `http2stream.endAfterHeaders` property.
    #22843
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom `require` function that will resolve
    modules relative to the `filename` path.
    #19360
* url
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between `file:` URLs and
    absolute paths.
    #22506
* util
  * Added `util.types.isBoxedPrimitive(value)`.
    #22620
* Added new collaborators:
  * boneskull (https://github.com/boneskull) - Christopher Hiller
* The Technical Steering Committee has new members:
  * apapirovski (https://github.com/apapirovski) - Anatoli Papirovski
  * gabrielschulhof (https://github.com/gabrielschulhof) - Gabriel Schulhof

PR-URL: #22932
@targos

This comment has been minimized.

Show comment
Hide comment
@targos

targos Sep 20, 2018

Member

Depends on #21875. Marking dont-land-on-v10.x for now.

Member

targos commented Sep 20, 2018

Depends on #21875. Marking dont-land-on-v10.x for now.

@targos targos referenced this pull request Sep 20, 2018

Closed

fs: implement recursive (mkdirp) functionality #21875

4 of 4 tasks complete

@targos targos added this to Don't land (for now) in v10.x Sep 23, 2018

@targos targos removed this from Don't land (for now) in v10.x Sep 25, 2018

targos added a commit that referenced this pull request Sep 25, 2018

module: add createRequireFunction method
PR-URL: #19360
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>

targos added a commit that referenced this pull request Oct 7, 2018

2018-10-XX, Version 10.12.0 (Current)
Notable changes:

* assert
  * The diff output is now a tiny bit improved by sorting object
    properties when inspecting the values that are compared with each
    other. #22788
* cli
  * The options parser now normalizes `_` to `-` in all multi-word
    command-line flags, e.g. `--no_warnings` has the same effect as
    `--no-warnings`. #23020
  * Added bash completion for the `node` binary. To generate a bash
    completion script, run `node --completion-bash`. The output can be
    saved to a file which can be sourced to enable completion.
    #20713
* crypto
  * Added support for PEM-level encryption.
    #23151
  * Added an API asymmetric key pair generation. The new methods
    `crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
    used to generate public and private key pairs. The API supports
    RSA, DSA and EC and a variety of key encodings (both PEM and DER).
    #22660
* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to true, non-existing parent folders will be
    automatically created. #21875
* http2
  * Added a `'ping'` event to `Http2Session` that is emitted whenever a
    non-ack `PING` is received.
    #23009
  * Added support for the `ORIGIN` frame.
    #22956
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom require function that will resolve
    modules relative to the filename path.
    #19360
* process
  * Added a `'multipleResolves'` process event that is emitted whenever
    a `Promise` is attempted to be resolved multiple times, e.g. if the
    `resolve` and `reject` functions are both called in a `Promise`
    executor. #22218
* **url**
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between file: URLs and
    absolute paths. #22506
* **util**
  * Added the `sorted` option to `util.inspect()`. If set to `true`,
    all properties of an object and Set and Map entries will be sorted
    in the returned string. If set to a function, it is used as a
    compare function. #22788
  * The `util.instpect.custom` symbol is now defined in the global
    symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
    #20857
* **Windows**
  * The Windows msi installer now provides an option to automatically
    install the tools required to build native modules.
    #22645
* **Added new collaborators**:
  * digitalinfinity - Hitesh Kanwathirtha

@targos targos referenced this pull request Oct 7, 2018

Merged

Release proposal: v10.12.0 #23313

targos added a commit that referenced this pull request Oct 7, 2018

2018-10-XX, Version 10.12.0 (Current)
Notable changes:

* assert
  * The diff output is now a tiny bit improved by sorting object
    properties when inspecting the values that are compared with each
    other. #22788
* cli
  * The options parser now normalizes `_` to `-` in all multi-word
    command-line flags, e.g. `--no_warnings` has the same effect as
    `--no-warnings`. #23020
  * Added bash completion for the `node` binary. To generate a bash
    completion script, run `node --completion-bash`. The output can be
    saved to a file which can be sourced to enable completion.
    #20713
* crypto
  * Added support for PEM-level encryption.
    #23151
  * Added an API asymmetric key pair generation. The new methods
    `crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
    used to generate public and private key pairs. The API supports
    RSA, DSA and EC and a variety of key encodings (both PEM and DER).
    #22660
* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to true, non-existing parent folders will be
    automatically created. #21875
* http2
  * Added a `'ping'` event to `Http2Session` that is emitted whenever a
    non-ack `PING` is received.
    #23009
  * Added support for the `ORIGIN` frame.
    #22956
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom require function that will resolve
    modules relative to the filename path.
    #19360
* process
  * Added a `'multipleResolves'` process event that is emitted whenever
    a `Promise` is attempted to be resolved multiple times, e.g. if the
    `resolve` and `reject` functions are both called in a `Promise`
    executor. #22218
* **url**
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between file: URLs and
    absolute paths. #22506
* **util**
  * Added the `sorted` option to `util.inspect()`. If set to `true`,
    all properties of an object and Set and Map entries will be sorted
    in the returned string. If set to a function, it is used as a
    compare function. #22788
  * The `util.instpect.custom` symbol is now defined in the global
    symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
    #20857
* **Windows**
  * The Windows msi installer now provides an option to automatically
    install the tools required to build native modules.
    #22645
* **Added new collaborators**:
  * digitalinfinity - Hitesh Kanwathirtha

PR-URL: #23313

targos added a commit that referenced this pull request Oct 10, 2018

2018-10-10, Version 10.12.0 (Current)
Notable changes:

* assert
  * The diff output is now a tiny bit improved by sorting object
    properties when inspecting the values that are compared with each
    other. #22788
* cli
  * The options parser now normalizes `_` to `-` in all multi-word
    command-line flags, e.g. `--no_warnings` has the same effect as
    `--no-warnings`. #23020
  * Added bash completion for the `node` binary. To generate a bash
    completion script, run `node --completion-bash`. The output can be
    saved to a file which can be sourced to enable completion.
    #20713
* crypto
  * Added support for PEM-level encryption.
    #23151
  * Added an API asymmetric key pair generation. The new methods
    `crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
    used to generate public and private key pairs. The API supports
    RSA, DSA and EC and a variety of key encodings (both PEM and DER).
    #22660
* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to true, non-existing parent folders will be
    automatically created. #21875
* http2
  * Added a `'ping'` event to `Http2Session` that is emitted whenever a
    non-ack `PING` is received.
    #23009
  * Added support for the `ORIGIN` frame.
    #22956
  * Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect
    protocol support to allow use of WebSockets over HTTP/2.
    #23284
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom require function that will resolve
    modules relative to the filename path.
    #19360
* process
  * Added a `'multipleResolves'` process event that is emitted whenever
    a `Promise` is attempted to be resolved multiple times, e.g. if the
    `resolve` and `reject` functions are both called in a `Promise`
    executor. #22218
* url
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between file: URLs and
    absolute paths. #22506
* util
  * Added the `sorted` option to `util.inspect()`. If set to `true`,
    all properties of an object and Set and Map entries will be sorted
    in the returned string. If set to a function, it is used as a
    compare function. #22788
  * The `util.instpect.custom` symbol is now defined in the global
    symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
    #20857
  * Added support for `BigInt` numbers in `util.format()`.
    #22097
* V8 API
  * A number of V8 C++ APIs have been marked as deprecated since they
    have been removed in the upstream repository. Replacement APIs
    are added where necessary. #23159
* Windows
  * The Windows msi installer now provides an option to automatically
    install the tools required to build native modules.
    #22645
* Workers
  * Debugging support for Workers using the DevTools protocol has been
    implemented. #21364
  * The public `inspector` module is now enabled in Workers.
    #22769
* Added new collaborators:
  * digitalinfinity - Hitesh Kanwathirtha

PR-URL: #23313

targos added a commit that referenced this pull request Oct 10, 2018

2018-10-10, Version 10.12.0 (Current)
Notable changes:

* assert
  * The diff output is now a tiny bit improved by sorting object
    properties when inspecting the values that are compared with each
    other. #22788
* cli
  * The options parser now normalizes `_` to `-` in all multi-word
    command-line flags, e.g. `--no_warnings` has the same effect as
    `--no-warnings`. #23020
  * Added bash completion for the `node` binary. To generate a bash
    completion script, run `node --completion-bash`. The output can be
    saved to a file which can be sourced to enable completion.
    #20713
* crypto
  * Added support for PEM-level encryption.
    #23151
  * Added an API asymmetric key pair generation. The new methods
    `crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
    used to generate public and private key pairs. The API supports
    RSA, DSA and EC and a variety of key encodings (both PEM and DER).
    #22660
* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to true, non-existing parent folders will be
    automatically created. #21875
* http2
  * Added a `'ping'` event to `Http2Session` that is emitted whenever a
    non-ack `PING` is received.
    #23009
  * Added support for the `ORIGIN` frame.
    #22956
  * Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect
    protocol support to allow use of WebSockets over HTTP/2.
    #23284
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom require function that will resolve
    modules relative to the filename path.
    #19360
* process
  * Added a `'multipleResolves'` process event that is emitted whenever
    a `Promise` is attempted to be resolved multiple times, e.g. if the
    `resolve` and `reject` functions are both called in a `Promise`
    executor. #22218
* url
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between file: URLs and
    absolute paths. #22506
* util
  * Added the `sorted` option to `util.inspect()`. If set to `true`,
    all properties of an object and Set and Map entries will be sorted
    in the returned string. If set to a function, it is used as a
    compare function. #22788
  * The `util.instpect.custom` symbol is now defined in the global
    symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
    #20857
  * Added support for `BigInt` numbers in `util.format()`.
    #22097
* V8 API
  * A number of V8 C++ APIs have been marked as deprecated since they
    have been removed in the upstream repository. Replacement APIs
    are added where necessary. #23159
* Windows
  * The Windows msi installer now provides an option to automatically
    install the tools required to build native modules.
    #22645
* Workers
  * Debugging support for Workers using the DevTools protocol has been
    implemented. #21364
  * The public `inspector` module is now enabled in Workers.
    #22769
* Added new collaborators:
  * digitalinfinity - Hitesh Kanwathirtha

PR-URL: #23313

targos added a commit that referenced this pull request Oct 10, 2018

2018-10-10, Version 10.12.0 (Current)
Notable changes:

* assert
  * The diff output is now a tiny bit improved by sorting object
    properties when inspecting the values that are compared with each
    other. #22788
* cli
  * The options parser now normalizes `_` to `-` in all multi-word
    command-line flags, e.g. `--no_warnings` has the same effect as
    `--no-warnings`. #23020
  * Added bash completion for the `node` binary. To generate a bash
    completion script, run `node --completion-bash`. The output can be
    saved to a file which can be sourced to enable completion.
    #20713
* crypto
  * Added support for PEM-level encryption.
    #23151
  * Added an API asymmetric key pair generation. The new methods
    `crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
    used to generate public and private key pairs. The API supports
    RSA, DSA and EC and a variety of key encodings (both PEM and DER).
    #22660
* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to true, non-existing parent folders will be
    automatically created. #21875
* http2
  * Added a `'ping'` event to `Http2Session` that is emitted whenever a
    non-ack `PING` is received.
    #23009
  * Added support for the `ORIGIN` frame.
    #22956
  * Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect
    protocol support to allow use of WebSockets over HTTP/2.
    #23284
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom require function that will resolve
    modules relative to the filename path.
    #19360
* process
  * Added a `'multipleResolves'` process event that is emitted whenever
    a `Promise` is attempted to be resolved multiple times, e.g. if the
    `resolve` and `reject` functions are both called in a `Promise`
    executor. #22218
* url
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between file: URLs and
    absolute paths. #22506
* util
  * Added the `sorted` option to `util.inspect()`. If set to `true`,
    all properties of an object and Set and Map entries will be sorted
    in the returned string. If set to a function, it is used as a
    compare function. #22788
  * The `util.instpect.custom` symbol is now defined in the global
    symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
    #20857
  * Added support for `BigInt` numbers in `util.format()`.
    #22097
* V8 API
  * A number of V8 C++ APIs have been marked as deprecated since they
    have been removed in the upstream repository. Replacement APIs
    are added where necessary. #23159
* Windows
  * The Windows msi installer now provides an option to automatically
    install the tools required to build native modules.
    #22645
* Workers
  * Debugging support for Workers using the DevTools protocol has been
    implemented. #21364
  * The public `inspector` module is now enabled in Workers.
    #22769
* Added new collaborators:
  * digitalinfinity - Hitesh Kanwathirtha

PR-URL: #23313

jasnell added a commit that referenced this pull request Oct 17, 2018

2018-10-10, Version 10.12.0 (Current)
Notable changes:

* assert
  * The diff output is now a tiny bit improved by sorting object
    properties when inspecting the values that are compared with each
    other. #22788
* cli
  * The options parser now normalizes `_` to `-` in all multi-word
    command-line flags, e.g. `--no_warnings` has the same effect as
    `--no-warnings`. #23020
  * Added bash completion for the `node` binary. To generate a bash
    completion script, run `node --completion-bash`. The output can be
    saved to a file which can be sourced to enable completion.
    #20713
* crypto
  * Added support for PEM-level encryption.
    #23151
  * Added an API asymmetric key pair generation. The new methods
    `crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be
    used to generate public and private key pairs. The API supports
    RSA, DSA and EC and a variety of key encodings (both PEM and DER).
    #22660
* fs
  * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If
    this option is set to true, non-existing parent folders will be
    automatically created. #21875
* http2
  * Added a `'ping'` event to `Http2Session` that is emitted whenever a
    non-ack `PING` is received.
    #23009
  * Added support for the `ORIGIN` frame.
    #22956
  * Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect
    protocol support to allow use of WebSockets over HTTP/2.
    #23284
* module
  * Added `module.createRequireFromPath(filename)`. This new method can
    be used to create a custom require function that will resolve
    modules relative to the filename path.
    #19360
* process
  * Added a `'multipleResolves'` process event that is emitted whenever
    a `Promise` is attempted to be resolved multiple times, e.g. if the
    `resolve` and `reject` functions are both called in a `Promise`
    executor. #22218
* url
  * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These
    methods can be used to correctly convert between file: URLs and
    absolute paths. #22506
* util
  * Added the `sorted` option to `util.inspect()`. If set to `true`,
    all properties of an object and Set and Map entries will be sorted
    in the returned string. If set to a function, it is used as a
    compare function. #22788
  * The `util.instpect.custom` symbol is now defined in the global
    symbol registry as `Symbol.for('nodejs.util.inspect.custom')`.
    #20857
  * Added support for `BigInt` numbers in `util.format()`.
    #22097
* V8 API
  * A number of V8 C++ APIs have been marked as deprecated since they
    have been removed in the upstream repository. Replacement APIs
    are added where necessary. #23159
* Windows
  * The Windows msi installer now provides an option to automatically
    install the tools required to build native modules.
    #22645
* Workers
  * Debugging support for Workers using the DevTools protocol has been
    implemented. #21364
  * The public `inspector` module is now enabled in Workers.
    #22769
* Added new collaborators:
  * digitalinfinity - Hitesh Kanwathirtha

PR-URL: #23313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment