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

@alwinb: Just one more question: More concretely, how would you propose a change to the existing APIs in the WHATWG spec?

You have come up with a really nice specification, and your implementation works well, but when it comes down to proposing a direct change (or addition) to the existing shipped `new URL(...)` API from browsers, what do you think would be a succinct way to incorporate relative URLs?

Because I think it is currently expected that an instance of the `URL` class will be absolute, and it’s really unfortunate (and disruptive) to have to break that assumption. As I said, I don’t think it is good to introduce a different class either, as that would likely introduce an unfortunate choice to people wanting to manipulate URLs.

Personally, I feel like it is difficult to come up with a way to introduce this to the API without big issues appearing. It is unfortunate, I feel, but it means we might be stuck with an absolute‐only API in browsers.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/531#issuecomment-1037179220

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/url/issues/531/1037179220@github.com>

Received on Saturday, 12 February 2022 11:57:15 UTC