webspecs / url

The URL specification
https://specs.webplatform.org/url/webspecs/develop/
Other
21 stars 9 forks source link

Why is Hosts not a separate section? #9

Open annevk opened 9 years ago

annevk commented 9 years ago

There's various concepts throughout the platform that only want to deal with domain names or hosts. They deserve elaboration on their own and likely their own API as well.

Did I miss an explanation as to why we changed from that approach?

rubys commented 9 years ago

After I did the initial merge, there was much duplication. As a concrete example, much of the definition of hosts dealt with parsing, and that was covered by the parsing rules. So I guess another way to look at the question you raise: does it make sense to split the parsing rules and distribute them into multiple sections, or does it make sense to consolidate them? For that matter, should hosts be split out into a separate standard?

My preference is that the parsing rules stay together, though this could be broken out into a separate section. I have a similar preference for a consolidated authoring/writing/conformance instructions. As to host APIs, that could be a new section if/when it is needed, much like URL APIs currently is a separate section.

For reference, here is the relevant sequence of commits:

annevk commented 9 years ago

I don't understand. Host parsing was never duplicated.

annevk commented 9 years ago

The main reason I think hosts deserves to be its own section is because it's something that is used independently from the rest of the URL parser and I don't want specifications to build on any random part of the URL parser, just sanctioned bits. Having hosts separately and having a place to put all definitions around hosts, including certificate stuff eventually about how to match *.html5.org (x.x.html5.org is not a match) seems like a win.

rubys commented 9 years ago

I don't understand. Host parsing was never duplicated.

I was unclear. When I replaced step 8 (and inadvertently step 9... oops) of https://url.spec.whatwg.org/#concept-basic-url-parser, I was left with duplication. When I eliminated the duplication in favor of my new work, I was left with sections that were gutted. When I rearranged, I ended up with what you see. I must say that I like the fact that where I ended up, the specification named "URL" starts out with a definition of that term. I'd like to keep that.

The main reason I think hosts deserves to be its own section is because it's something that is used independently from the rest of the URL parser and I don't want specifications to build on any random part of the URL parser, just sanctioned bits.

The operative question here is what do we sanction, not how do we arrange the text in the specification. If somebody wants to build on this specification and they need hooks or IDL or whatever, we will deal with those requests when they occur.

Having hosts separately and having a place to put all definitions around hosts, including certificate stuff eventually about how to match *.html5.org (x.x.html5.org is not a match) seems like a win.

Perhaps ultimately hosts should be split out to a separate specification. I'd be fine with that should we come to that point. Meanwhile, is there anybody actively working on definitions for certificate stuff and the like? Again, we should deal with those requests when they occur.

annevk commented 9 years ago

It's something I was planning to solve, yes, in baby steps. There's an open bugs on improving the situation around hosts and public suffix too. And I don't really want to make that a distinct specification.