Replies: 5 comments 6 replies
-
@wbamberg this is a good question to ask. In terms of the API landing pages displaying BCD or not, I always thought that it was something that readers would want, but communicated as a quick overview, e.g.
They can then dig deeper into the individual interfaces for further info if they still want it. I thought it would be an annoying faff to say "Look at the interface pages for compatibility information" (although we do this in some places), so wherever possible, I tend to show the compat table for the central most useful feature of the API, or the entry point. It's imperfect, but it does give a quick idea. In terms of doing it properly, I'm not sure if we should show multiple tables, or some kind of aggregate table? |
Beta Was this translation helpful? Give feedback.
-
As a near-term approach, I suggest we omit the compat tables, but future proof ourselves by allowing an array of BCD strings in the front matter. This would let us generate spec tables from front matter, which I think would be useful on API pages today (without much real innovation needed, except for de-duplication). It also lets us prepare for a future where pages can show composite compatibility reports or aggregate tables. |
Beta Was this translation helpful? Give feedback.
-
I don't agree, and I don't think I even agree with what I said yesterday. Both options put readers through a bunch of yo-yo clicking to get a sense of the entire interface. If you've got the key to generate a table now, why not go ahead and do it, even if it's not perfect? You could incrementally improve a full table. For example, maybe the next step is collapsing the interfaces children with controls to expand one interface at a time and to expand them all. |
Beta Was this translation helpful? Give feedback.
-
Having thought a bit more, a couple of things:
[1] I think rather than GroupData we could consider listing the constituents of an API in the front matter for the API page. |
Beta Was this translation helpful? Give feedback.
-
Another thing about this that came up in the review of the EyeDropper API: mdn/content#9985. We would like to be able to mark some APIs as experimental. The way to do this is usually to include the I think the short term fix is probably to remove the link from |
Beta Was this translation helpful? Give feedback.
-
We've just recently started supporting BCD queries as front matter keys: mdn/yari#3258. This means the
{{Compat}}
macro can stop passing it as an argument, and Yari can just automatically add the right BCD table based on the front matter. It also means we can render other data out of the BCD query, too, like specifications tables and maybe soon the "deprecated" banner.So to take advantage of this we need to move the BCD query string from the
{{Compat}}
macro call to the front matter. We shouldn't do this for all pages, only pages that are essentially associated with a BCD query. So we shouldn't do it for freeform "guide" pages, even if those guide pages happen to want to show a BCD table.I've done this more or less for the JS and CSS pages, and started on the WebAPI pages. And then I got a question.
Under Web/API there are several different sorts of pages:
Freeform guide pages, like https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch. These are supposed to live under "API pages".
API pages - this describes a collection of features, that may include multiple interfaces and also individual methods belonging to other interfaces. Generally it aligns with specifications. For example, there’s an API we call the Fetch API, that contains all the stuff under the abstract concept of Fetch. This includes specific objects (interfaces) like
Request
andResponse
, but also includes thefetch()
method of theWindowOrWorkerGlobalScope
interface. It has its own spec , that defines all these bits.Interface pages: this describes single concrete type of object that a developer might interact with, like
Request
. These also live at the top level.Method pages: this describes a single method of an interface, like
Request.clone()
. These live underneath the interface they belong to.Property pages: this describes a single property of an interface, like
Request.method
. These live underneath the interface they belong to.Dictionary pages: this describes a dictionary in the Web API, which is a lot like an interface that doesn't have any methods. For example,
RsaPssParams
. These live at the top level alongside interfaces and APIs.So clearly, guide pages should not get BCD front matter, and interface, method, property, and dictionary pages should get it. But what about API pages? At first I thought they should, because they are reference pages, and we could certainly define a structure for them, and knowing the compat story for an API seems useful. But "APIs" don't map onto a single branch of the BCD tree. So the only way to do it would be for API pages to support more than one BCD query.
At the moment, as usual, it's a bit random.
I think probably they should either omit BCD, and people can refer to the interface pages, or should include multiple tables.
Beta Was this translation helpful? Give feedback.
All reactions