Uh oh!
There was an error while loading. Please reload this page.
module: add createRequire method - #27405
Conversation
nodejs-github-bot
commented
Apr 25, 2019
a83b861 to
8c6a784CompareUh oh!
There was an error while loading. Please reload this page.
mscdex
commented
Apr 25, 2019
Is there a reason this can't be a part of |
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
Apr 26, 2019
MylesBorins
commented
Apr 26, 2019
Updated code based on feedback from @devsnek. Have also added documentation to @mscdex I don't think this makes sense to add to |
nodejs-github-bot
commented
Apr 26, 2019
MylesBorins
commented
Apr 26, 2019
CI is actually green the fail above is a lie. If there are no objections to this PR I plan to land it as is on Monday |
Fishrock123
left a comment
There was a problem hiding this comment.
This seems fine to me... (but I am not convinced that it is an acceptable replacement of import.meta.require...)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MylesBorins
commented
Apr 30, 2019
Changed a few things here:
PTAL |
nodejs-github-bot
commented
Apr 30, 2019
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
MylesBorins
commented
May 1, 2019
One more stab at it Differences:
I believe this has scoped the use of this API enough that it guards against most footguns PTAL |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
BridgeAR
left a comment
There was a problem hiding this comment.
If we really deprecate the other API, it'll need an entry in doc/api/deprecations.md.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
benjamingr
commented
May 2, 2019
changes still lgtm |
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
commented
May 3, 2019
nodejs-github-bot
commented
May 3, 2019
MylesBorins
commented
May 3, 2019
latest CI was green! landed in 411063c |
This is an abstraction on top of creatRequireFromPath that can accept both paths, URL Strings, and URL Objects. PR-URL: #27405 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
This is an abstraction on top of creatRequireFromPath that can accept both paths, URL Strings, and URL Objects. PR-URL: #27405 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
Notable changes: * tls: * Added an `enableTrace()` method to `TLSSocket` and an `enableTrace` option to `tls.createServer()`. When enabled, TSL packet trace information is written to `stderr`. This can be used to debug TLS connection problems. #27497 * cli: * Added a `--trace-tls` command-line flag that enables tracing of TLS connections without the need to modify existing application code. #27497 * Added a `--cpu-prof-interval` command-line flag. It can be used to specify the sampling interval for the CPU profiles generated by `--cpu-prof`. #27535 * module: * Added the `createRequire()` method. It allows to create a require function a file URL object, a file URL string or an absolute path string. The existing `createRequireFromPath()` method is now deprecated #27405. * Throw on `require('./path.mjs')`. This is technically a breaking change that should have landed with Node.js 12.0.0. It is necessary to have this to keep the possibility for a future minor version to load ES Modules with the require function. #27417 * meta: * Added Christian Clauss (https://github.com/cclauss) to collaborators. #27554 PR-URL: #27578
Notable changes: * deps: * Updated llhttp to 1.1.3. This fixes a bug that made Node.js' HTTP parser refuse any request URL that contained the "|" (vertical bar) character. #27595 * tls: * Added an `enableTrace()` method to `TLSSocket` and an `enableTrace` option to `tls.createServer()`. When enabled, TSL packet trace information is written to `stderr`. This can be used to debug TLS connection problems. #27497#27376 * cli: * Added a `--trace-tls` command-line flag that enables tracing of TLS connections without the need to modify existing application code. #27497 * Added a `--cpu-prof-interval` command-line flag. It can be used to specify the sampling interval for the CPU profiles generated by `--cpu-prof`. #27535 * module: * Added the `createRequire()` method. It allows to create a require function from a file URL object, a file URL string or an absolute path string. The existing `createRequireFromPath()` method is now deprecated #27405. * Throw on `require('./path.mjs')`. This is technically a breaking change that should have landed with Node.js 12.0.0. It is necessary to have this to keep the possibility for a future minor version to load ES Modules with the require function. #27417 * repl: * The REPL now supports multi-line statements using `BigInt` literals as well as public and private class fields and methods. #27400 * The REPL now supports tab autocompletion of file paths with `fs` methods. #26648 * meta: * Added Christian Clauss (https://github.com/cclauss) to collaborators. #27554 PR-URL: #27578
Notable changes: * deps: * Updated llhttp to 1.1.3. This fixes a bug that made Node.js' HTTP parser refuse any request URL that contained the "|" (vertical bar) character. #27595 * tls: * Added an `enableTrace()` method to `TLSSocket` and an `enableTrace` option to `tls.createServer()`. When enabled, TSL packet trace information is written to `stderr`. This can be used to debug TLS connection problems. #27497#27376 * cli: * Added a `--trace-tls` command-line flag that enables tracing of TLS connections without the need to modify existing application code. #27497 * Added a `--cpu-prof-interval` command-line flag. It can be used to specify the sampling interval for the CPU profiles generated by `--cpu-prof`. #27535 * module: * Added the `createRequire()` method. It allows to create a require function from a file URL object, a file URL string or an absolute path string. The existing `createRequireFromPath()` method is now deprecated #27405. * Throw on `require('./path.mjs')`. This is technically a breaking change that should have landed with Node.js 12.0.0. It is necessary to have this to keep the possibility for a future minor version to load ES Modules with the require function. #27417 * repl: * The REPL now supports multi-line statements using `BigInt` literals as well as public and private class fields and methods. #27400 * The REPL now supports tab autocompletion of file paths with `fs` methods. #26648 * meta: * Added Christian Clauss (https://github.com/cclauss) to collaborators. #27554 PR-URL: #27578
This is an abstraction on top of creatRequireFromPath that can accept both paths, URL Strings, and URL Objects. PR-URL: nodejs/node#27405 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
This is an abstraction on top of creatRequireFromPath that can accept
both paths, URL Strings, and URL Objects.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes