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

url: extend url.format to support WHATWG URL #10857

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
10 participants
@jasnell
Member

jasnell commented Jan 17, 2017

Removes the non-standard options on WHATWG URL toString
and extends the existing url.format() API to support
customizable serialization of the WHATWG URL object.

This does not yet include the documentation updates
because the documentation for the new WHATWG URL object
has not yet landed.

Example:

const url = require('url');
const URL = url.URL;
const myURL = new URL('http://example.org/?a=b#c');
const str = url.format(myURL, {fragment: false, search: false});
console.log(str);
  // Prints: http://example.org/
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
Affected core subsystem(s)

url, whatwg-url

/cc @watilde @nodejs/url

Show outdated Hide outdated lib/internal/url.js
@@ -263,6 +256,48 @@ class URL {
ret += '}';
return ret;
}
[kFormat](options) {

This comment has been minimized.

@joyeecheung

joyeecheung Jan 17, 2017

Member

Symbols added this way are enumerable(can be verified via Object.getOwnPropertyDescriptor(url, kFormat)), I believe test-whatwg-url-properties doesn't catch this because for-in only iterates over string keys, but since Reflect.enumerate is withdrawn in ES2016 I can't think of a way to make that test more complete...anyways I think we should useObject.defineProperty here to make it non-enumerable, or just move this function out and use .call to call it properly?

@joyeecheung

joyeecheung Jan 17, 2017

Member

Symbols added this way are enumerable(can be verified via Object.getOwnPropertyDescriptor(url, kFormat)), I believe test-whatwg-url-properties doesn't catch this because for-in only iterates over string keys, but since Reflect.enumerate is withdrawn in ES2016 I can't think of a way to make that test more complete...anyways I think we should useObject.defineProperty here to make it non-enumerable, or just move this function out and use .call to call it properly?

This comment has been minimized.

@jasnell

jasnell Jan 17, 2017

Member

Using defineProperty is fine.

@jasnell

jasnell Jan 17, 2017

Member

Using defineProperty is fine.

This comment has been minimized.

@domenic

domenic Jan 17, 2017

Member

Putting the symbols here at all (enumerable or not) creates an observable difference from the spec via Object.getOwnPropertySymbols. But I guess there are several of those already (special/cannotBeABase) so IMO it's probably not worth changing...

@domenic

domenic Jan 17, 2017

Member

Putting the symbols here at all (enumerable or not) creates an observable difference from the spec via Object.getOwnPropertySymbols. But I guess there are several of those already (special/cannotBeABase) so IMO it's probably not worth changing...

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Jan 17, 2017

Contributor

How much of a performance impact does this have on non-whatwg url usage?

Contributor

mscdex commented Jan 17, 2017

How much of a performance impact does this have on non-whatwg url usage?

@watilde

This comment has been minimized.

Show comment
Hide comment
@watilde

watilde Jan 17, 2017

Member

It may be another topic, but from the viewpoint of making the URL object behave the same as the standard, is URL.inspect() OK even when it can be called? I think it could be replaced with util.inspect when it needs.

Here is an example:

const res = url.inspect(null, {
showHidden: showHidden
});

Member

watilde commented Jan 17, 2017

It may be another topic, but from the viewpoint of making the URL object behave the same as the standard, is URL.inspect() OK even when it can be called? I think it could be replaced with util.inspect when it needs.

Here is an example:

const res = url.inspect(null, {
showHidden: showHidden
});

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Jan 17, 2017

Member

@mscdex ... the performance hit incurred by the addition of the new instanceof URL check is, unfortunately, non-trivial. I'll play around with it to see how I can reduce the cost.

Member

jasnell commented Jan 17, 2017

@mscdex ... the performance hit incurred by the addition of the new instanceof URL check is, unfortunately, non-trivial. I'll play around with it to see how I can reduce the cost.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Jan 17, 2017

Member

@watilde ... we now have the option of using a symbol for the inspect function. It would make sense to switch to using that instead of the inspect() function itself.

Member

jasnell commented Jan 17, 2017

@watilde ... we now have the option of using a symbol for the inspect function. It would make sense to switch to using that instead of the inspect() function itself.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Jan 17, 2017

Member

@mscdex @joyeecheung ... updated. modified the changes in url.format a bit to reduce the cost of the additional check.

Member

jasnell commented Jan 17, 2017

@mscdex @joyeecheung ... updated. modified the changes in url.format a bit to reduce the cost of the additional check.

ret += this.host;
}
ret += options.unicode ?
domainToUnicode(this.host) : this.host;

This comment has been minimized.

@addaleax

addaleax Jan 18, 2017

Member

Is the unicode option name from the spec, from compatibility with the old url, or is it up for debate? I don’t think it’s conveying the semantics very well (like, I have to look at the tests in this PR to see which behaviour maps to which value). How does something like decodeIDNA: true/false sound to you?

@addaleax

addaleax Jan 18, 2017

Member

Is the unicode option name from the spec, from compatibility with the old url, or is it up for debate? I don’t think it’s conveying the semantics very well (like, I have to look at the tests in this PR to see which behaviour maps to which value). How does something like decodeIDNA: true/false sound to you?

This comment has been minimized.

@joyeecheung

joyeecheung Jan 18, 2017

Member

(Strange, my response ended up both in my own review and here, but when I deleted that one in my review this one disappeared too)..

I think options is neither in the spec nor in the old url.format. For me the meaning of unicode is pretty straightforword(maybe it's just me though). The two serialization alternatives are named Domain to ASCII and Domain to Unicode in the spec.

@joyeecheung

joyeecheung Jan 18, 2017

Member

(Strange, my response ended up both in my own review and here, but when I deleted that one in my review this one disappeared too)..

I think options is neither in the spec nor in the old url.format. For me the meaning of unicode is pretty straightforword(maybe it's just me though). The two serialization alternatives are named Domain to ASCII and Domain to Unicode in the spec.

This comment has been minimized.

@jasnell

jasnell Jan 18, 2017

Member

The unicode flag is consistent with the URL standard, yes (see: https://url.spec.whatwg.org/#host-parsing). To be fair, however, that is on parse side and this is on the serialization, but there is precedent at least.

@jasnell

jasnell Jan 18, 2017

Member

The unicode flag is consistent with the URL standard, yes (see: https://url.spec.whatwg.org/#host-parsing). To be fair, however, that is on parse side and this is on the serialization, but there is precedent at least.

This comment has been minimized.

@addaleax

addaleax Jan 18, 2017

Member

The unicode flag is consistent with the URL standard, yes (see: https://url.spec.whatwg.org/#host-parsing). To be fair, however, that is on parse side and this is on the serialization, but there is precedent at least.

Eh, if it’s in the standard, even just on the parse side, it’s probably best to leave it like that. Thanks for pointing it out.

For me the meaning of unicode is pretty straightforword(maybe it's just me though).

Well, if it’s working and people know what the option describes, that’s probably just fine then. (At least in my head, unicode: true sounds like it could both mean enabling a) decoding of the hostname from punycode to Unicode or b) encoding of the hostname from Unicode to punycode)

@addaleax

addaleax Jan 18, 2017

Member

The unicode flag is consistent with the URL standard, yes (see: https://url.spec.whatwg.org/#host-parsing). To be fair, however, that is on parse side and this is on the serialization, but there is precedent at least.

Eh, if it’s in the standard, even just on the parse side, it’s probably best to leave it like that. Thanks for pointing it out.

For me the meaning of unicode is pretty straightforword(maybe it's just me though).

Well, if it’s working and people know what the option describes, that’s probably just fine then. (At least in my head, unicode: true sounds like it could both mean enabling a) decoding of the hostname from punycode to Unicode or b) encoding of the hostname from Unicode to punycode)

This comment has been minimized.

@jasnell

jasnell Jan 18, 2017

Member

I will make sure that the relevant documentation appropriately covers the option and makes its function clear

@jasnell

jasnell Jan 18, 2017

Member

I will make sure that the relevant documentation appropriately covers the option and makes its function clear

Show outdated Hide outdated lib/internal/url.js
if (typeof options !== 'object')
throw new TypeError('options must be an object');
options.fragment = options.fragment !== undefined ?
Boolean(options.fragment) : true;

This comment has been minimized.

@joyeecheung

joyeecheung Jan 18, 2017

Member

Why use Boolean() instead of !! here?

@joyeecheung

joyeecheung Jan 18, 2017

Member

Why use Boolean() instead of !! here?

This comment has been minimized.

@jasnell

jasnell Jan 18, 2017

Member

Personal preference with regards to code clarity

@jasnell

jasnell Jan 18, 2017

Member

Personal preference with regards to code clarity

Show outdated Hide outdated lib/internal/url.js
@@ -286,38 +283,43 @@ Object.defineProperties(URL.prototype, {
ret += '//';
const has_username = typeof ctx.username === 'string';
const has_password = typeof ctx.password === 'string' &&
ctx.password !== '';
if (has_username || has_password) {
ctx.password !== '';

This comment has been minimized.

@joyeecheung

joyeecheung Jan 18, 2017

Member

nit: extra whitespace here

@joyeecheung

joyeecheung Jan 18, 2017

Member

nit: extra whitespace here

This comment has been minimized.

@TimothyGu

TimothyGu Jan 24, 2017

Member

This still hasn't been fixed.

@TimothyGu

TimothyGu Jan 24, 2017

Member

This still hasn't been fixed.

href: {
enumerable: true,
configurable: true,
get() {
return this.toString();
return this[kFormat]({});

This comment has been minimized.

@joyeecheung

joyeecheung Jan 18, 2017

Member

I think keep it as this.toString() is closer to how the spec defines href as the stringifier.

@joyeecheung

joyeecheung Jan 18, 2017

Member

I think keep it as this.toString() is closer to how the spec defines href as the stringifier.

This comment has been minimized.

@jasnell

jasnell Jan 18, 2017

Member

The result is the same. Using this[kFormat]({}) here avoids an unnecessary property access.

@jasnell

jasnell Jan 18, 2017

Member

The result is the same. Using this[kFormat]({}) here avoids an unnecessary property access.

@TimothyGu TimothyGu referenced this pull request Jan 20, 2017

Closed

url: use symbol properties correctly in URL class #10906

3 of 3 tasks complete
configurable: true,
[kFormat]: {
enumerable: false,
configurable: false,

This comment has been minimized.

@TimothyGu

TimothyGu Jan 20, 2017

Member

These two lines are not needed as they are the default. However, the trend in Web APIs seems to be make symbol properties configurable and writable, so I'd recommend sticking to that

@TimothyGu

TimothyGu Jan 20, 2017

Member

These two lines are not needed as they are the default. However, the trend in Web APIs seems to be make symbol properties configurable and writable, so I'd recommend sticking to that

This comment has been minimized.

@jasnell

jasnell Jan 20, 2017

Member

Yes, I know they are the default. I prefer to be explicit. Also, because this is an internal only method, I prefer to keep these values

@jasnell

jasnell Jan 20, 2017

Member

Yes, I know they are the default. I prefer to be explicit. Also, because this is an internal only method, I prefer to keep these values

@joyeecheung

This comment has been minimized.

Show comment
Hide comment
@joyeecheung

joyeecheung Jan 20, 2017

Member

LGTM except it needs rebase.

Member

joyeecheung commented Jan 20, 2017

LGTM except it needs rebase.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Jan 23, 2017

Member

@mscdex ... any further thoughts on this?

Member

jasnell commented Jan 23, 2017

@mscdex ... any further thoughts on this?

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Jan 23, 2017

Contributor

@jasnell Performance-wise the lib/url.js changes LGTM.

Contributor

mscdex commented Jan 23, 2017

@jasnell Performance-wise the lib/url.js changes LGTM.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Jan 24, 2017

Member

Awesome, thank you

Member

jasnell commented Jan 24, 2017

Awesome, thank you

Show outdated Hide outdated lib/internal/url.js
@@ -286,38 +283,43 @@ Object.defineProperties(URL.prototype, {
ret += '//';
const has_username = typeof ctx.username === 'string';
const has_password = typeof ctx.password === 'string' &&
ctx.password !== '';
if (has_username || has_password) {
ctx.password !== '';

This comment has been minimized.

@TimothyGu

TimothyGu Jan 24, 2017

Member

This still hasn't been fixed.

@TimothyGu

TimothyGu Jan 24, 2017

Member

This still hasn't been fixed.

Show outdated Hide outdated lib/internal/url.js
options.search = options.search !== undefined ?
Boolean(options.search) : true;
options.auth = options.auth !== undefined ?
Boolean(options.auth) : true;

This comment has been minimized.

@TimothyGu

TimothyGu Jan 24, 2017

Member

Can Object.assign be used?

options = Object.assign({
  fragment: true,
  unicode: false,
  search: true,
  auth: true
}, options);

seems to be cleaner, and also prevents mutating the user options object.

@TimothyGu

TimothyGu Jan 24, 2017

Member

Can Object.assign be used?

options = Object.assign({
  fragment: true,
  unicode: false,
  search: true,
  auth: true
}, options);

seems to be cleaner, and also prevents mutating the user options object.

This comment has been minimized.

@jasnell

jasnell Jan 24, 2017

Member

Not particularly a fan of Object.assign() due to some performance concerns that still exist there but this change should be fine

@jasnell

jasnell Jan 24, 2017

Member

Not particularly a fan of Object.assign() due to some performance concerns that still exist there but this change should be fine

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell
Member

jasnell commented Jan 24, 2017

@TimothyGu updated

@TimothyGu

This comment has been minimized.

Show comment
Hide comment
@TimothyGu

TimothyGu Jan 24, 2017

Member

@jasnell do you have plans to add documentation and tests?

Member

TimothyGu commented Jan 24, 2017

@jasnell do you have plans to add documentation and tests?

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Jan 24, 2017

Member

This already includes tests.
Documentation will be added separately.

Member

jasnell commented Jan 24, 2017

This already includes tests.
Documentation will be added separately.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Jan 24, 2017

Member

CI failures are unrelated

Member

jasnell commented Jan 24, 2017

CI failures are unrelated

@TimothyGu TimothyGu moved this from Landed in Spec to Existing spec in WHATWG URL implementation Jan 29, 2017

@TimothyGu

@jasnell, just noticed a few more nits. Otherwise I don't think there is anything that can prevent this from being applied.

Show outdated Hide outdated doc/api/url.md
For example:
```js
```js

This comment has been minimized.

@TimothyGu

TimothyGu Jan 29, 2017

Member

Duplicated line.

@TimothyGu

TimothyGu Jan 29, 2017

Member

Duplicated line.

Show outdated Hide outdated tools/doc/type-parser.js
@@ -37,7 +37,8 @@ const typeMap = {
'http.Server': 'http.html#http_class_http_server',
'http.ServerResponse': 'http.html#http_class_http_serverresponse',
'Iterator': jsDocPrefix +
'Reference/Iteration_protocols#The_iterator_protocol'
'Reference/Iteration_protocols#The_iterator_protocol',
'URL': 'url.html#url_the_whatwg_url_api'

This comment has been minimized.

@TimothyGu

TimothyGu Jan 29, 2017

Member

How about #url_class_url which links directly to the class?

@TimothyGu

TimothyGu Jan 29, 2017

Member

How about #url_class_url which links directly to the class?

This comment has been minimized.

@jasnell

jasnell Jan 30, 2017

Member

Would rather point to the entire section, especially given the nice big "Experimental" notice that's included.

@jasnell

jasnell Jan 30, 2017

Member

Would rather point to the entire section, especially given the nice big "Experimental" notice that's included.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Jan 30, 2017

Member

Nits fixed and rebased.

Member

jasnell commented Jan 30, 2017

Nits fixed and rebased.

@jasnell

This comment has been minimized.

Show comment
Hide comment

jasnell added some commits Jan 17, 2017

url: extend url.format to support WHATWG URL
Removes the non-standard options on WHATWG URL toString
and extends the existing url.format() API to support
customizable serialization of the WHATWG URL object.

This does not yet include the documentation updates
because the documentation for the new WHATWG URL object
has not yet landed.

Example:

```js
const url = require('url');
const URL = url.URL;
const myURL = new URL('http://example.org/?a=b#c');
const str = url.format(myURL, {fragment: false, search: false});
console.log(str);
  // Prints: http://example.org/
```

jasnell added a commit that referenced this pull request Feb 2, 2017

url: extend url.format to support WHATWG URL
Removes the non-standard options on WHATWG URL toString
and extends the existing url.format() API to support
customizable serialization of the WHATWG URL object.

This does not yet include the documentation updates
because the documentation for the new WHATWG URL object
has not yet landed.

Example:

```js
const url = require('url');
const URL = url.URL;
const myURL = new URL('http://example.org/?a=b#c');
const str = url.format(myURL, {fragment: false, search: false});
console.log(str);
  // Prints: http://example.org/
```

PR-URL: #10857
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>

jasnell added a commit that referenced this pull request Feb 2, 2017

doc: add documentation for url.format(URL[, options]);
PR-URL: #10857
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell
Member

jasnell commented Feb 2, 2017

Landed in c5e9654...0d9ea4f

@jasnell jasnell closed this Feb 2, 2017

@TimothyGu TimothyGu moved this from Existing spec to Done in WHATWG URL implementation Feb 2, 2017

italoacasas added a commit that referenced this pull request Feb 3, 2017

url: extend url.format to support WHATWG URL
Removes the non-standard options on WHATWG URL toString
and extends the existing url.format() API to support
customizable serialization of the WHATWG URL object.

This does not yet include the documentation updates
because the documentation for the new WHATWG URL object
has not yet landed.

Example:

```js
const url = require('url');
const URL = url.URL;
const myURL = new URL('http://example.org/?a=b#c');
const str = url.format(myURL, {fragment: false, search: false});
console.log(str);
  // Prints: http://example.org/
```

PR-URL: #10857
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>

italoacasas added a commit that referenced this pull request Feb 3, 2017

doc: add documentation for url.format(URL[, options]);
PR-URL: #10857
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>

italoacasas added a commit to italoacasas/node that referenced this pull request Feb 14, 2017

url: extend url.format to support WHATWG URL
Removes the non-standard options on WHATWG URL toString
and extends the existing url.format() API to support
customizable serialization of the WHATWG URL object.

This does not yet include the documentation updates
because the documentation for the new WHATWG URL object
has not yet landed.

Example:

```js
const url = require('url');
const URL = url.URL;
const myURL = new URL('http://example.org/?a=b#c');
const str = url.format(myURL, {fragment: false, search: false});
console.log(str);
  // Prints: http://example.org/
```

PR-URL: nodejs#10857
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>

italoacasas added a commit that referenced this pull request Feb 16, 2017

2017-02-21, Version 7.6.0 (Current)
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [#11029](#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [#11094](#11094)
    * add node-inspect 1.10.2 (Jan Krems) [#10187](#10187)
* lib: build `node inspect` into `node` (Anna Henningsen) [#10187](#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](#9469)
* inspector: add --inspect-brk (Josh Gavant) [#11149](#11149)
* fs: allow WHATWG URL and file: URLs as paths (James M Snell) [#10739](#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [#10857](#10857)

PR-URL: #11185

TimothyGu added a commit to TimothyGu/node that referenced this pull request Feb 18, 2017

@TimothyGu TimothyGu referenced this pull request Feb 18, 2017

Closed

(v7.x backport) URL-related changes #11457

4 of 4 tasks complete

italoacasas added a commit to italoacasas/node that referenced this pull request Feb 20, 2017

addaleax added a commit that referenced this pull request Feb 21, 2017

2017-02-21, Version 7.6.0 (Current)
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [#11029](#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [#11094](#11094)
    * add node-inspect 1.10.4 (Jan Krems) [#10187](#10187)
* lib: build `node inspect` into `node` (Anna Henningsen) [#10187](#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](#9469)
* inspector: add --inspect-brk (Josh Gavant) [#11149](#11149)
* fs: allow WHATWG URL objects as paths (James M Snell) [#10739](#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [#10857](#10857)

PR-URL: #11185

italoacasas added a commit to italoacasas/node that referenced this pull request Feb 21, 2017

2017-02-21, Version 7.6.0 (Current)
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [#11029](nodejs#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [#11094](nodejs#11094)
    * add node-inspect 1.10.4 (Jan Krems) [#10187](nodejs#10187)
    * upgrade zlib to 1.2.11 (Sam Roberts) [#10980](nodejs#10980)
* lib: build `node inspect` into `node` (Anna Henningsen) [#10187](nodejs#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](nodejs#9469)
* inspector: add --inspect-brk (Josh Gavant) [#11149](nodejs#11149)
* fs: allow WHATWG URL objects as paths (James M Snell) [#10739](nodejs#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](nodejs#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [#10857](nodejs#10857)

PR-URL: nodejs#11185

italoacasas added a commit that referenced this pull request Feb 22, 2017

italoacasas added a commit to italoacasas/node that referenced this pull request Feb 22, 2017

2017-02-21, Version 7.6.0 (Current)
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [#11029](nodejs#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [#11094](nodejs#11094)
    * add node-inspect 1.10.4 (Jan Krems) [#10187](nodejs#10187)
    * upgrade zlib to 1.2.11 (Sam Roberts) [#10980](nodejs#10980)
* lib: build `node inspect` into `node` (Anna Henningsen) [#10187](nodejs#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](nodejs#9469)
* inspector: add --inspect-brk (Josh Gavant) [#11149](nodejs#11149)
* fs: allow WHATWG URL objects as paths (James M Snell) [#10739](nodejs#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](nodejs#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [#10857](nodejs#10857)

PR-URL: nodejs#11185

KryDos added a commit to KryDos/node that referenced this pull request Feb 25, 2017

url: extend url.format to support WHATWG URL
Removes the non-standard options on WHATWG URL toString
and extends the existing url.format() API to support
customizable serialization of the WHATWG URL object.

This does not yet include the documentation updates
because the documentation for the new WHATWG URL object
has not yet landed.

Example:

```js
const url = require('url');
const URL = url.URL;
const myURL = new URL('http://example.org/?a=b#c');
const str = url.format(myURL, {fragment: false, search: false});
console.log(str);
  // Prints: http://example.org/
```

PR-URL: nodejs#10857
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>

KryDos added a commit to KryDos/node that referenced this pull request Feb 25, 2017

doc: add documentation for url.format(URL[, options]);
PR-URL: nodejs#10857
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>

imyller added a commit to imyller/meta-nodejs that referenced this pull request Mar 2, 2017

2017-02-21, Version 7.6.0 (Current)
    Notable changes:

    * deps:
        * update V8 to 5.5 (Michaël Zasso) [#11029](nodejs/node#11029)
        * upgrade libuv to 1.11.0 (cjihrig) [#11094](nodejs/node#11094)
        * add node-inspect 1.10.4 (Jan Krems) [#10187](nodejs/node#10187)
        * upgrade zlib to 1.2.11 (Sam Roberts) [#10980](nodejs/node#10980)
    * lib: build `node inspect` into `node` (Anna Henningsen) [#10187](nodejs/node#10187)
    * crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](nodejs/node#9469)
    * inspector: add --inspect-brk (Josh Gavant) [#11149](nodejs/node#11149)
    * fs: allow WHATWG URL objects as paths (James M Snell) [#10739](nodejs/node#10739)
    * src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](nodejs/node#11129)
    * url: extend url.format to support WHATWG URL (James M Snell) [#10857](nodejs/node#10857)

    PR-URL: nodejs/node#11185

Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment