-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add spec_url values for all features for which we have the data #6765
Comments
What are the open questions to be resolved here? Is it just about which anchor in each spec to use, or are there other things that could be debated? FWIW, I think that what I'm proposing in w3c/webref#63 could help here. With that IDL scraped from specs we can get a mapping for many api.* entries to at least a spec shortname, but how to determine the best specific anchor is still not clear. Often there will be multiple relating to a single IDL member to chose between, one inside the IDL block, and sometimes one for the prose definition of what the IDL member does. |
There are no open questions to be resolved. Specifically, there’s no ambiguity about which anchor in each spec to use: We have all the spec URLs already — collected by scraping the Specifications tables in MDN articles — and those are all already in the fork at https://github.com/w3c/browser-compat-data The only decision that needs to be made here is whether to upstream the spec URLs from https://github.com/w3c/browser-compat-data all at once, or whether to do it in stages, and when.
That looks promising. Given that we already have spec URLs for features documented in MDN, I think what’s proposed there could be useful in identifying cases where the relevant MDN article is missing the spec URL for some reason, or else has the wrong spec URL, or where the feature isn’t documented at all yet in MDN.
Yeah, getting the anchors is the part that can’t be done programatically in many cases.
Right. I suspect we’d end up finding that whatever we developed to identify the spec URLs programatically would have some limitations. But I think the combination with the existing spec URL data we already from MDN is what would make the w3c/webref#63 really powerful for what we need in BCD. |
It's great that we have a whole lot of links already collected and ready to go. I wouldn't propose revisiting if all of those are exactly right. Still, is there a proposed guidelines for which anchor to use for new data? https://github.com/mdn/browser-compat-data/blob/master/schemas/compat-data-schema.md#the-__compat-object doesn't spell it out. More concretely, the case that I've often run into is whether to link to the section defining an interface vs. the definition in the Web IDL block itself: https://html.spec.whatwg.org/multipage/workers.html#the-abstractworker-mixin vs. https://html.spec.whatwg.org/multipage/workers.html#abstractworker |
There are no such guidelines written down yet that I’m aware of. But I agree we should document some if we can.
From looking through a lot of existing specifications links in MDN articles and from trying to take into consideration what will be most useful to web developers, IMHO it’s almost always better to link to the section defining an interface rather than to the definition in the Web IDL block itself. |
reading this thread, @tidoust and I realized that the automatically extracted list of definitions generated by tidoust/reffy in w3c/webrefs provide probably the right list of anchors for all the IDL interfaces/attributes/methods that need to feed into this (or when it doesn't provide the right right anchor, it feels like this should be fixed in the spec upstream in any case) |
In the case of I do share @sideshowbarker's preference for linking to the section defining an interface, if the heading is right above at least, but I don't know how we'd achieve this. If one wants that, how would would fix it in the spec? |
in general, the trend in respec/bikeshed specs is that the anchor of the definition will be in the prose description rather than the IDL block. The HTML spec isn't doing that consistently yet, but to me that's a case of needing to upstream what we want there. |
(alternatively, we could easily annotate definitions to refer to the closest precedent heading id) |
I agree that it would be good to document a guideline. Since we already have JS |
In order to filter BCD to "everything Flexbox" and "everything Grid" it would be of great practical utility to me to start with URLs for those features. I'd also be a willing reviewer if we start there. At this point, I think only the termination of |
I agree that set of features should be one of the very highest priorities for dealing with overall, so I also agree it’d be a great set to start with as far as adding spec URLs. |
Introducing
|
I tried to pull out just the Flexbox spec URLs in #7161 (review) and did some self-review, which immediately revealed some issues:
To that I would add:
|
I strongly agree that’s what we should do — ideally. But I’m not familiar enough with the CSS spec conventions to know, given a with-number spec URL and given a corresponding without-number URL, can we safely/confidently assume that a particular feature in the with-number spec actually exists in the corresponding without-number spec? (and further, if the feature does exists there, does it have the same fragment ID?)
I don’t know what “doesn't direct the unnumbered variants to delta specs with the whole old spec missing” means… |
@tabatkins I've asked you about this before and IIRC you don't direct the unnumbered version at delta specs, right? I've confirmed this to hold true for a few delta specs listed in https://github.com/w3c/browser-specs:
That's not quite the same as guaranteeing that no ID in an unnumbered URL will ever go away, but close enough for our purposes I think. |
Yeah, we point the unnumbered at the "current version", which is judged on an ad hoc basis, but generally will not ever point to a delta spec. |
And recall that Bikeshed does have the ability to enforce that specific IDs be present in a spec (via the |
my sense is that this all converge nicely toward having spec_urls to point to exported definitions of the matching term - this means less ad-hoc manual processing, more consistent tracking, etc (in particular, I think exported definitions should be considered as Required IDs by bikeshed - e.g. by checking that all the webref-extracted definitions marked as exported are presented in the bikeshed source at any time) |
@foolip, @sideshowbarker, I note that dfns extracts in Webref now associate definitions with the heading under which they are found. For instance, the definition of
(I still need to clean up the "\n " in there, but that's a no-brainer) |
@tidoust would you suggest that we always link to the heading, or just that we allow linking to the heading on a case-by-case basis? |
As raised by @dontcallmedom in #6765 (comment), I would rather converge towards linking to the definitions themselves, and would e.g. encourage the "put the dfn in the heading itself" pattern, as done in various specifications (e.g. The disableRemotePlayback attribute). There won't be headings for all IDL definitions, but that seems fine as long as the dfn somewhat stands out. For instance, in WebRTC, Linking to definitions does not work well for specs that have definitions in IDL blocks directly (one would want to link to Interface ShadowRoot and not to the IDL block). That is where some editorial effort could be needed to move away from such editorial patterns. In the meantime, it may be doable to automate the choice of whether to link to the definition or the heading in most cases. For instance, the dfns extracts in webref could perhaps have something like an Linking to definitions also does not work well when the definition appears in the middle of a long paragraph. That does not seem to be a common case though, and that seems harder to flag automatically. Are there other cases where linking to the heading would make more sense that linking to the definition? |
Hi all, I'm ready to get back into this.
This makes sense to me. @sideshowbarker I feel like we could get into I also see there are comments and a draft PR about |
Yup — just now raised #8064 |
I think we can consider this to be wholly done |
Awesome, thank you @sideshowbarker! Are there more things you'd like to see done or cleaned up when it comes to linking specs to BCD and vice versa? For example, is |
https://github.com/w3c/browser-compat-data is a fork of BCD in which basically the only difference is that it adds
spec_url
values to every feature for which a spec URL can be determined.So this issue is for tracking the proposal that we upstream all that
spec_url
data from that fork to here.#2983 (comment) is where @Elchi3 and I discussed first just adding
spec_url
data for all JavaScript features, with the idea that we’d eventually do it for all features.So here’s where we can discuss a plan for taking the next steps to add spec URLs for the rest of the BCD features.
We wouldn’t necessarily need to upstream all the
spec_url
data from my fork for every feature all at once. I think at least that @Elchi3 believes it’d be better to do it in subtree “chunks” one-by-one — for example, starting with everything in thehtml
subtree, then seeing how that goes, and then after that, maybe thecss
subtree, etc.Given that I know @Elchi3 cares about the particulars of how this gets done, and when, I think we would want to wait until we have him back before we proceed on actually upstreaming any of the spec URL data. But perhaps in the meantime, we can try to discuss some of the logistics in preparation.
On that note, I want to mention here that the way the
spec_url
values get added to the fork is through a script I wrote at https://github.com/w3c/browser-compat-data/blob/master/scripts/add-specs.js. Some details:spec_url
for any features, the script can be re-run periodically to add any the new spec URLs it finds (from re-scraping the MDN articles), or to update any spec URLs that have changed (due to edits make to the MDN aricles)The text was updated successfully, but these errors were encountered: