Re: [whatwg/url] Support relative URLs (#531)

I think that `new URL()` will need to remain absolute for backwards compatibility since too many API accepting URL today depend on it.

Perhaps we need a `new RelativeURL()` to solve this use case with a similar API (has searchParams but not hostname for example).

Although I'm not sure [relative](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_URL#examples_of_relative_urls) is even the right term here because you might say `/page` is relative but you could also say these are relative too: `./page`, `../page`, or even `page`.

So I think what we want is something in between `new URL()` and `new URLSearchParams()`, perhaps `new URLPathAndHash()`.

https://nodejs.org/api/url.html#url_url_strings_and_url_objects

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/531#issuecomment-836753269

Received on Monday, 10 May 2021 14:29:28 UTC