-
Notifications
You must be signed in to change notification settings - Fork 19
U - data.browser_compatibility ingredient doesn't allow multiple BCD tables #405
Comments
Fixing this will affect our linting error count to go down by 2 (so, not a priority but needed for the finish line). 1 error javascript-language-feature/data.browser_compatibility/expected-macro |
Of course it's easy to enable to linter to accept multiple calls to I wonder what having multiple Probably it's premature to worry about that. Maybe this is enough of an edge case anyway that a tool could treat this as a special case. At least though I think the linter should require that if there's more than one |
Yes, I think we should require h3 demarcation.
Does that hint that we should have separate MDN pages? https://developer.mozilla.org/en-US/docs/Web/CSS/gap#Browser_compatibility is a prime example for multiple compat tables, I think. I guess you could say that |
I don't think we should split To make it silly, we wouldn't consider having different pages for https://developer.mozilla.org/en-US/docs/Web/CSS/color_value because we use it in many different contexts, and might have different examples demonstrating them. Also this wouldn't help with the hypothetical devtools example above, would it? I think the problem there is basically one of mapping a CSS property name onto a In fact I wonder: if we want to require H3 titles when a page contains more than one compat table, should that title text be taken from the BCD "description"? And if so, should we require that if a stumptown item contains more than one BCD query, that every one must have a description? But I do think that there's a good case for saying that Class fields should be split into two pages: "Public class fields" and "Private class fields". You just have to look at the table of contents to see that it's describing two quite different things:
String.match() feels like yet another case :). It seems like there's a "primary" table that you'll always care about , whatever you're doing with I would be tempted, in this case, to omit the "named capture groups" table, and instead just rely on a link to the relevant page from the documentation for Or perhaps we should stop worrying about all that for now, and just update the linter to allow multiple tables, with mandatory H3 headings :). |
I've got some thoughts on multiple compat tables. I don't like them and I wish I had resisted allowing the CSS "contexts" pattern in the first place. The other cases seem easier to fix, because it's not so much a problem of the underlying data. Take On the one hand, there's a real content problem in that the On the other hand, the structure in BCD is weird. It's nearly one-off. Apart these CSS properties, I can't think of anywhere else we do anything like this. It's as if we've hidden a subfolder in Instead, I would like to see the data get fixed and the tables reduced to one: there should be one basic support feature ("Does this browser recognize this property name?") and subfeatures for different contexts ("Does this browser do something like the spec'ed behavior for Regarding this case:
I agree with this. I like the idea of linking to another page and being done with it (we have a structure for this—See also—after all). But if we want to be a bit more permissive, I could see allowing additional compat tables in other sections besides "Browser compatibility". But in that section, there should be one and only feature represented. |
I feel bad since this was apparently my suggestion back then. I'd be happy to have a "basic support" for I think the thing that led us into this was that there's no practical sense talking about "support for
...and that doesn't seem sensible. And as a practical guide to readers "basic support" in the case of mdn/browser-compat-data#2516 (comment) says '"Basic support" in other CSS data has meant something along the lines of "the browser recognizes this property or value and includes it in the cascade."' which I suppose leaves room for data like my example above. But that definition of basic support isn't documented anywhere that I can see. The schema doc defines basic support as "indicating that a minimal implementation of a functionality is included", which, well, I'm not sure how to interpret. It seems like this is leading us towards a rule where every CSS property has a |
The schema docs also say:
So, I think, you could say that the minimal implementation is the initial implementation in the flex context (I guess) and that there are then sub features that represent evolutions of this feature, namely its availability in other contexts. I don't know if this makes it more practical, but I think this is the way we've seen sub features in other domains.
I think it would be great actually to be more consistent about this. BCD consumers have been bitten by this before and iirc had to special case this in their code. On the cases class fields and String.match: |
I opened mdn/browser-compat-data#6175 to discuss the feature structure issue in BCD. Maybe we can get that in the next sprint? |
I've removed the second table from String.match and I will split the class fields page soon. Thanks for filing that issue, Daniel! I think we can come back to this topic when we fix CSS linting issues, which will probably in the next sprint or the sprint after. |
I've split the class fields page into two pages and so now there is only one compat table per BCD section. I will close this issue, and when we're dealing with CSS docs, we should file a new issue for dealing with these cases in CSS. |
This compat ingredient (https://github.com/mdn/stumptown-content/blob/master/scripts/scraper-ng/rules/html-require-recipe-ingredients/ingredient-handlers/data-browser-compatibility.js) doesn't allow multiple tables. These occur two times in JS docs and affects the current goal of fixing all linter errors. This also happens in CSS docs sometimes.
I assume we should update the ingredient handler for this.
Acceptance criteria
The linter spec is updated to describe how to represent multiple compat tables, and the linter is updated accordingly.
The text was updated successfully, but these errors were encountered: