tooling icon indicating copy to clipboard operation
tooling copied to clipboard

url.relative

Open guybedford opened this issue 6 years ago • 3 comments

Would this fall under the considerations of this group?

See https://github.com/nodejs/node/issues/616#issuecomment-438221181.

guybedford avatar Nov 13 '18 10:11 guybedford

relateurl. URL-compatible version is in the repo and has been in the works for a while ~~at 99% completion. Should be finishing it in a few weeks~~. It's "done" now and will be released soon.

stevenvachon avatar Nov 13 '18 11:11 stevenvachon

As discussed at the meeting - it might be nice to start by seeing if progress can be made on the WhatWG side of things here.

So perhaps we can come up with something we think might work for Node and propose it to WhatWG in an issue there?

I will start with a complete and utter strawman:

URL.relative(fromURL: URL | string, toURL: URL | string) -> string

Returns the relative url with fragment string of toURL from fromURL such that new URL(result, fromURL) would be the reverse operation.

//cc @nex3 who brought this one up in the first place!

If that sounds sensible... let's see what WhatWG think, as it seems like it wouldn't be "unuseful" in browsers.

guybedford avatar Dec 04 '18 20:12 guybedford

I've created a WhatWG proposal issue at https://github.com/whatwg/url/issues/421.

guybedford avatar Dec 07 '18 14:12 guybedford