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

Yeah I think the term "relative URL" is not really helpful, and we should instead call it a "relative reference". As per this standard, URLs are always absolute - and you can resolve a relative reference against one to end up with a new URL (also absolute).

A relative reference (like `../../foo`) can be thought of as something like "x's brother's best-friend's sister's husband". You need to substitute in a specific person for "x" in to order to resolve it in to another specific person. Or you could think of it like a set of directions - "take the next right". In order to know which street that refers to, you need a starting position.

And the idea behind having a separate type for these things is that tools designed to work with references to specific people/addresses are not necessarily the best tools for working with those kinds of abstract, relative references. Trying to write a single API which somehow magically works with both is likely to be bug-prone, and the result would be difficult to use.

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

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

Received on Saturday, 8 February 2025 18:52:03 UTC