GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — url: expose pathToFileURL and fileURLToPath by guybedford · Pull Request #22506 · nodejs/node

Conversation

@guybedford

@guybedford guybedford commented Aug 24, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

As discussed in #22502 this exposes and documents url.pathToFileURL and url.fileURLToPath in order to assist with cross platform support and encoding consistency.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss, hanrea, and JLHwung reacted with thumbs up emoji
All reactions
  • 👍 3 reactions
@guybedford
url: expose pathToFileUrl and fileUrlToPath
4d95ca1
@nodejs-github-bot

nodejs-github-bot commented Aug 24, 2018

Copy link
Copy Markdown
Collaborator

@guybedford build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/662/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added the lib / src Issues and PRs involving general changes in the lib/ or src/ directories. label Aug 24, 2018
bmeck
bmeck reviewed Aug 24, 2018
View reviewed changes
Comment thread doc/api/url.md Outdated
```js
// BAD:
// - fails in Windows
// - doesn't handle loading paths using extended non-latin characters

@bmeck bmeck Aug 24, 2018

Copy link
Copy Markdown
Member

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.

not just that, also things like " " which are percent encoded

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@guybedford guybedford Aug 24, 2018

Copy link
Copy Markdown
Contributor Author

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.

This isn't meant to be comprehensive, but we can certainly pad out the examples.

I expect this will also change over time, so I don't think we want to keep the docs exactly in sync with the code here either.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bmeck bmeck Aug 24, 2018

Copy link
Copy Markdown
Member

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.

agree, but examples seem more prudent than statements like this which could be taken as the only exceptions thereby leading people only on unix and in latin charsets to feel this API is not needed

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bmeck
bmeck reviewed Aug 24, 2018
View reviewed changes
Comment thread lib/internal/url.js Outdated
}

function toPathIfFileUrl(fileUrlOrPath) {
if (fileUrlOrPath == null || !fileUrlOrPath[searchParams] ||

@bmeck bmeck Aug 24, 2018

Copy link
Copy Markdown
Member

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.

why not instanceof URL?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@guybedford guybedford Aug 24, 2018

Copy link
Copy Markdown
Contributor Author

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.

This was what was already in place here, so I didn't want to alter it for fear of compatibility changes. We could certainly try instanceof.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bmeck bmeck Aug 24, 2018

Copy link
Copy Markdown
Member

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.

i'm curious why it wasn't using instanceof, would prefer to use that if we expose it to users

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jasnell jasnell Aug 24, 2018

Copy link
Copy Markdown
Member

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.

Largely because of performance. Checking for the existence of the internal symbol is significantly faster than using instanceof

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bmeck bmeck Aug 24, 2018

Copy link
Copy Markdown
Member

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.

@jasnell I'm increasingly uncomfortable with stuff like this that is making things more loose and forgeable than needed. Do we have data on why this is faster, I was under the impression that newer V8s were optimizing out simple instanceof checks.

CC: @bmeurer

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
addaleax
addaleax reviewed Aug 24, 2018
View reviewed changes
Comment thread doc/api/url.md Outdated
## File URL Utility Functions

When working with `file:///` URLs in Node.js (eg when working with ES modules
which are keyed in the registry by File URL), the utility functions

@addaleax addaleax Aug 24, 2018

Copy link
Copy Markdown
Member

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.

I’d s/registry/module registry/ for clarity

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bmeck bmeck Aug 24, 2018

Copy link
Copy Markdown
Member

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.

module map, not registry

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/url.md Outdated
```js
// BAD:
// - fails in Windows
// - doesn't handle loading paths using extended non-latin characters

@addaleax addaleax Aug 24, 2018

Copy link
Copy Markdown
Member

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.

non-ASCII?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bmeck

bmeck commented Aug 24, 2018

Copy link
Copy Markdown
Member

would like to see more examples added to docs to emphasize why this is a good API to use. I left some at #22502 (comment)

including the fileURL in each example would help, be sure to uppercase the URL per https://url.spec.whatwg.org/#url-apis-elsewhere

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

This comment has been minimized.

Sign in to view
@guybedford
Url -> URL, pad out examples
0d9c808
@guybedford

guybedford commented Aug 24, 2018

Copy link
Copy Markdown
Contributor Author

@bmeck thanks I've padded out the examples and renamed Url to URL.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@guybedford guybedford changed the title url: expose pathToFileUrl and fileUrlToPath url: expose pathToFileURL and fileURLToPath Aug 24, 2018
guybedford added 2 commits August 24, 2018 19:09
@guybedford
update windows examples
0b784b4
@guybedford
correction
6479897
@guybedford
guybedford force-pushed the url-utils branch from daba4e5 to 6479897 Compare August 24, 2018 17:12
@guybedford
registry -> module map
09bc85a
@guybedford

guybedford commented Aug 24, 2018

Copy link
Copy Markdown
Contributor Author

@vsemozhetbyt those other methods are provided under "legacy API", whereas these ones aren't part of the legacy API, but utilities that go alongside the WhatWG API.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

This comment has been minimized.

Sign in to view
@guybedford
document utils in same section
c073384
@guybedford

guybedford commented Aug 24, 2018

Copy link
Copy Markdown
Contributor Author

@vsemozhetbyt ah I missed that, sure I've combined it into the same section.

vsemozhetbyt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@guybedford

guybedford commented Aug 24, 2018

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax added semver-minor PRs that contain new features and should be released in the next minor version. whatwg-url Issues and PRs related to the WHATWG URL implementation. and removed lib / src Issues and PRs involving general changes in the lib/ or src/ directories. labels Aug 24, 2018
vsemozhetbyt
vsemozhetbyt reviewed Aug 24, 2018
View reviewed changes

@vsemozhetbyt vsemozhetbyt left a comment

Copy link
Copy Markdown
Contributor

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.

Just some doc nits.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/url.md Outdated
For example, the following errors can occur when converting from paths to URLs:

```js
// throws for missing schema (posix)

@vsemozhetbyt vsemozhetbyt Aug 24, 2018

Copy link
Copy Markdown
Contributor

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.

posix -> POSIX here and below?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TimothyGu reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread doc/api/url.md Outdated
new URL('./foo#1', 'file:///');

// 'file:///nas/foo.txt' instead of the correct 'file:///foo.txt' (posix)
new URL(`file://${'//nas/foo.txt'}`);

@vsemozhetbyt vsemozhetbyt Aug 24, 2018

Copy link
Copy Markdown
Contributor

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.

In this and the next example, template strings with string interpolation seem confusingly redundant. Maybe interpolate previously defined variables?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@guybedford guybedford Aug 25, 2018

Copy link
Copy Markdown
Contributor Author

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.

I quite like having these be scannable as single-line cases, initially I wrote new URL('file://' + '//nas/foo.txt') to indicate the separation, but the linter wouldn't allow that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vsemozhetbyt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread doc/api/url.md Outdated
new URL(`file://${'//nas/foo.txt'}`);

// 'file:///some/path%' instead of the correct 'file:///some/path%25' (posix)
new URL(`sfile:${'/some/path%.js'}`);

@vsemozhetbyt vsemozhetbyt Aug 24, 2018

Copy link
Copy Markdown
Contributor

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.

sfile: -> file://

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@guybedford guybedford Aug 25, 2018

Copy link
Copy Markdown
Contributor Author

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.

Thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/url.md Outdated
new URL(`sfile:${'/some/path%.js'}`);
```

where using `pathToFileURL` we can get the correct results above.

@vsemozhetbyt vsemozhetbyt Aug 24, 2018

Copy link
Copy Markdown
Contributor

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.

`pathToFileURL` -> `url.pathToFileURL()`

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/url.md Outdated

where using `pathToFileURL` we can get the correct results above.

### url.fileURLToPath(url)

@vsemozhetbyt vsemozhetbyt Aug 24, 2018

Copy link
Copy Markdown
Contributor

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.

This section needs to go before ### url.format(URL[, options]) ABC-wise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@guybedford guybedford Aug 25, 2018

Copy link
Copy Markdown
Contributor Author

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.

Sure, a shame we can't keep these together though.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vsemozhetbyt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread doc/api/url.md Outdated

### url.fileURLToPath(url)

* `url` {URL} | {string} The file URL string or URL object to convert to a path.

@vsemozhetbyt vsemozhetbyt Aug 24, 2018

Copy link
Copy Markdown
Contributor

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.

{URL} | {string} -> {URL | string}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/url.md Outdated
new URL('file:///hello world.txt').pathname;
```

where using `fileURLToPath` we can get the correct results above.

@vsemozhetbyt vsemozhetbyt Aug 24, 2018

Copy link
Copy Markdown
Contributor

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.

`fileURLToPath` -> `url.fileURLToPath()`

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jdalton
jdalton reviewed Aug 24, 2018
View reviewed changes
Comment thread lib/internal/url.js
function toPathIfFileURL(fileURLOrPath) {
if (fileURLOrPath == null || !fileURLOrPath[searchParams] ||
!fileURLOrPath[searchParams][searchParams])
return fileURLOrPath;

@jdalton jdalton Aug 24, 2018

Copy link
Copy Markdown
Member

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.

What's the fileURLOrPath[searchParams][searchParams] check about?
The fileURLOrPath[searchParams] checks currently allow paths to duck-type as URLs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@guybedford guybedford Aug 25, 2018

Copy link
Copy Markdown
Contributor Author

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.

This is discussed at #22506 (review).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jdalton jdalton Aug 26, 2018

Copy link
Copy Markdown
Member

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.

Specifically asking about the double searchParams check of
fileURLOrPath[searchParams][searchParams].

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@guybedford guybedford Aug 26, 2018

Copy link
Copy Markdown
Contributor Author

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.

This is exactly what is already implemented. We can switch to an instanceof, but would be good to hear from @jasnell if this would be compatible with the original logic.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@TimothyGu TimothyGu Aug 26, 2018

Copy link
Copy Markdown
Member

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.

I would prefer a brand check (i.e. [searchParams]) as it's already been used everywhere else where we are checking for a URL, for consistency if nothing else. The same logic would probably apply to fileURLToPath() as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jdalton jdalton Aug 26, 2018

Copy link
Copy Markdown
Member

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.

Duck-typing isn't great. That it slipped in elsewhere in the project isn't a reason to continue it. It should really be reworked out when possible.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@guybedford guybedford Aug 26, 2018

Copy link
Copy Markdown
Contributor Author

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.

I managed to trace down the origin of this code, and it was a performance PR made here - #11690.

If we want to change this, we should do it in all of URL and not just this function, and as a separate PR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bmeck bmeck Aug 28, 2018

Copy link
Copy Markdown
Member

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.

a note, we shouldn't call forgable things "branding" generally. "tagging" is generally the term here (like Symbol.toStringTag)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
TimothyGu
TimothyGu reviewed Aug 24, 2018
View reviewed changes

@TimothyGu TimothyGu left a comment

Copy link
Copy Markdown
Member

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.

For this to be exposed to public, I believe we need to be more careful with input validation. For example, I'd rather have URL be the sole input for url.fileURLToPath(), and throw an exception otherwise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@guybedford
readme corrections
d36d1f9
@guybedford

guybedford commented Aug 25, 2018

Copy link
Copy Markdown
Contributor Author

@TimothyGu what concerns do you have about input ambiguity here? Because URL strings are encouraged by the WhatWG spec (despite any performance concerns), I'm very much for functions permitting URL strings or URL objects equally. I think cases to worry about is string parsing where different cases of strings are permitted like with the fs functions, but as we have been doing allowing URL strings or objects equally seems to me a good pattern generally to avoid the performance issues while still allowing "supposed" best practices.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vsemozhetbyt
vsemozhetbyt reviewed Aug 25, 2018
View reviewed changes
Comment thread doc/api/url.md Outdated
new URL('file:///hello world.txt').pathname;
```

where using `url.fileURLToPath` we can get the correct results above.

@vsemozhetbyt vsemozhetbyt Aug 25, 2018

Copy link
Copy Markdown
Contributor

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.

We usually add parentheses to functions/methods as per the style guide, so:
`url.fileURLToPath` -> `url.fileURLToPath()`

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/url.md Outdated
```

where using `fileURLToPath` we can get the correct results above.
where using `url.pathToFileURL` we can get the correct results above.

@vsemozhetbyt vsemozhetbyt Aug 25, 2018

Copy link
Copy Markdown
Contributor

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.

Ditto)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@guybedford
style nits
47d9efa
@targos targos mentioned this pull request Sep 18, 2018
Release proposal: v10.11.0 #22932
Merged
targos added a commit that referenced this pull request Sep 18, 2018
@targos
2018-09-19, Version 10.11.0 (Current)
4958ee3
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 pushed a commit that referenced this pull request Sep 19, 2018
@guybedford @targos
url: provide pathToFileURL and fileURLToPath
e22b0ed
PR-URL: #22506
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
targos added a commit that referenced this pull request Sep 19, 2018
@targos
2018-09-19, Version 10.11.0 (Current)
960717b
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 targos added the dont-land-on-v10.x label Sep 20, 2018
@targos

targos commented Sep 20, 2018

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos targos mentioned this pull request Sep 20, 2018
fs: implement recursive (mkdirp) functionality #21875
Closed
4 tasks done
@targos targos removed the dont-land-on-v10.x label Sep 25, 2018
targos pushed a commit that referenced this pull request Sep 25, 2018
@guybedford @targos
url: provide pathToFileURL and fileURLToPath
f1b1b73
PR-URL: #22506
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Bradley Farias <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
@guybedford guybedford mentioned this pull request Oct 2, 2018
Discussion: File URLs in Node.js #22502
Closed
@targos targos mentioned this pull request Oct 7, 2018
Release proposal: v10.12.0 #23313
Merged
targos added a commit that referenced this pull request Oct 7, 2018
@targos
2018-10-XX, Version 10.12.0 (Current)
d4636cb
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
@targos
2018-10-10, Version 10.12.0 (Current)
61f9972
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
@targos
2018-10-10, Version 10.12.0 (Current)
4a276cc
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
@targos
2018-10-10, Version 10.12.0 (Current)
cd8ee2d
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
This was referenced Oct 10, 2018
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#225
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#239
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#226
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#240
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#227
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#241
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#242
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#228
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#243
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#229
Closed
jasnell pushed a commit that referenced this pull request Oct 17, 2018
@targos @jasnell
2018-10-10, Version 10.12.0 (Current)
b107d3c
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
@jdalton jdalton mentioned this pull request Dec 31, 2018
fileURLToPath returns forward slashes on Windows #25265
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell left review comments
@addaleax addaleax addaleax left review comments
@mcollina mcollina mcollina approved these changes
@joyeecheung joyeecheung joyeecheung approved these changes
+5 more reviewers
@jdalton jdalton jdalton approved these changes
@bmeck bmeck bmeck approved these changes
@devsnek devsnek devsnek approved these changes
@vsemozhetbyt vsemozhetbyt vsemozhetbyt left review comments
@TimothyGu TimothyGu TimothyGu approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

semver-minor PRs that contain new features and should be released in the next minor version. whatwg-url Issues and PRs related to the WHATWG URL implementation.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

13 participants

@guybedford @nodejs-github-bot @bmeck @vsemozhetbyt @Trott @TimothyGu @jdalton @devsnek @targos @mcollina @jasnell @addaleax @joyeecheung
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.