GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — url: expose the WHATWG URL API globally by targos · Pull Request #18281 · nodejs/node Conversation
|
|
I'm -0 on this, but I think that it's a leat preferable to schedule this for a major release. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I agree. I forgot to put the semver-major label. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'd rather not add more globals, but I won't block this if people think it's the right thing to do. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Makes complete sense to me. Very much in favour. 👍
(Even though with this being semver-major, my vote doesn't make much of a difference.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think we might want a lint rule like the one we have for Buffer which verifies that internal modules don’t rely on the global and instead do explicitly require url?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@addaleax we don't need a special rule. ESLint already considers uses of global URL an error. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm +0 on this. The implementation is ok, but I would not add more globals, but I'm not objecting either as it's very common on web platform. If we are doing this, I would prefer if we started using it everywhere, even internally (https://github.com/nodejs/node/blob/master/lib/_http_client.js#L26), and gently phase away the old url parser. If we think this is the way to go, there is very little incentive for the community to adopt it if we do not use it internally. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🎉
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I personally don't have a problem with exposing them as globals. Next up: TextEncoder?
I'll get my coat.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
we should be able to also set this, shouldn't we?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
we should be able to go ahead and set this, no?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
thanks. updated
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Very happy to see this come back around. It wasn't quite as popular an idea the first time I suggested it :-)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
-0 for reasons described in nodejs/node-eps#28 (comment) (my and others comments). I don't think that things changed much since that discussion. I won't block this though if this is what others want. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Does this impact startup performance, and if so, could it be required on use possibly?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No, as this module is already being imported on startup:
node/lib/internal/bootstrap_node.js
Lines 80 to 82 in a3555d0
| // Ensure setURLConstructor() is called before the native | |
| // URL::ToObject() method is used. | |
| NativeModule.require('internal/url'); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Install URL and URLSearchParams on the global object, like they can be found in browser environments. PR-URL: nodejs#18281 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
|
New CI: https://ci.nodejs.org/job/node-test-pull-request/12797/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm not sure what's going on with AIX but it does not seem related. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Trying again on AIX. Given all the problems that have erupted on CI in the last month or two, I'm kinda -1 on landing something if we can't get CI to build/run on a platform. But I'm optimistic this is fixed now, so hopefully no problems... CI for AIX: https://ci.nodejs.org/job/node-test-commit-aix/12189/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@Trott thanks for restarting AIX. I fixed up one of the machines yesterday. There were a bunch of stale processes. I see the run you launched is green :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 3124146 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Install URL and URLSearchParams on the global object, like they can be found in browser environments. PR-URL: #18281 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
|
I'm a nobody here, but I hope to see APIs shared across platform in the global scope so I don't have to mess with the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm just wondering, would it be worth backporting this to 8.x? Would help a lot to be able to treat this as a baseline support. I can put together the port if it sounds like it could be possible. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@guybedford I'd rather not since there might be code out there checking |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@TimothyGu I've never ever seen a pattern like that for environment detection - usually it is based on Window or Document. Every case I've seen doing Users wanting to use the URL global in Node won't be able to until Node 8 EOL, which is over a year away, so it's a shame not to be able to really use this awesome feature in published packages that want to support Node 8 +. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm generically -1 in adding new globals in semver-minors. Code running without |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
If you feel strongly about it, can you please open a new issue for that discussion? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Install URL and URLSearchParams on the global object, like they can be found in browser environments. PR-URL: nodejs#18281 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
try { new URL("http://google.com") } catch (e) { // we are on Node 10! // so we can use XYZ. } also if (!global.URL) { // assume something that's not true anymore } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Install URL and URLSearchParams on the global object, like they can be found in browser environments. PR-URL: nodejs#18281 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: James M Snell <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.