Skip to content
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

WHATWG URL support #33

Open
stevenvachon opened this issue Mar 10, 2017 · 9 comments
Open

WHATWG URL support #33

stevenvachon opened this issue Mar 10, 2017 · 9 comments

Comments

@stevenvachon
Copy link

stevenvachon commented Mar 10, 2017

was added as an experimental feature in Node 7.0, which will become official in 8.x

I'm working on these to help: hasurl, isurl, universal-url

@felixfbecker
Copy link

https://github.com/jsdom/whatwg-url seems to be the most active

@stevenvachon
Copy link
Author

That's what universal-url uses, and also provides universal-url-lite for file size control.

@CMCDragonkai
Copy link

CMCDragonkai commented Sep 13, 2017

Making the url name on npm use the latest node style URL or whatwg-url would make it much easier to do polyfills, since you can always just write import { URL } from 'url';, and if it is node that will use the builtin version, while if it is in non-node environment, that will use the polyfill. I was hoping to be able to do this, but this current url package does not expose the URL constructor in accordance to whatwg url and the browser's window.URL.

@stevenvachon Thanks for pointing out universal-url project to me, it looks like I can make do with this for now.

@gwiron
Copy link

gwiron commented Sep 14, 2017 via email

@sheepsteak
Copy link

Is it worth depending on url-polyfill and re-exporting URL and URLSearchParams?

It seems to be a small polyfill although it doesn't claim to have 100% support of the API.

@stevenvachon
Copy link
Author

stevenvachon commented Nov 28, 2018

http in Node.js v11 uses URL under the hood by default.

@ljharb
Copy link
Collaborator

ljharb commented Jan 27, 2021

Does node's url module support this? If so, great! A PR would be appreciated. If not, we can't add this feature, and this should be closed, in favor of a feature request on node itself.

@ljharb
Copy link
Collaborator

ljharb commented Jan 27, 2021

Looks like the URL property was added sometime in node 6 (between v6.6, where it's absent, and v6.17, where it's present) so we'll add it as we catch up to that featureset.

@stevenvachon
Copy link
Author

I remember it being added in v7, then back-ported to v6. I'm not sure if v6 has globalThis.URL or only has require('node').URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants