-
I think the way we represent globals in Web/API is not ideal. We have various interfaces that are for global objects in various scopes, like But then we also have items just at the top level, like This makes it hard for someone to know what's available in a given scope. If I'm working with service workers, I can see I think we should duplicate these "globals" in the top-level scopes in which they appear, namely [Edited to add: it's not that bad, since these globals are listed in the body of https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope#instance_properties . But they're not in the nav for that page or for https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope, which I would 100% expect. It's also conceptually confusing to call them "globals" when they're not available in all contexts (for example in audio worklets, unless I am mistaken).] |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 11 replies
-
I always wanted to duplicate these "globals", but I was in the minority back then. In addition to the argument of duplication and related to it, there was the argument of maintenance: if we update a page, we likely need to update 2 (and, in rare cases, more). We should also double check what consequences there are in relation to BCD (we don't need to do the same as them, but both mdn/content and mdn/browser-compat-data should be interoperable). So we would have:
Also, global scopes are prefixed with the A small extract from w3c/webref: |
Beta Was this translation helpful? Give feedback.
-
We can duplicate global scope interface pages without duplicating content itself if we implement symlink kinda stuff in yari:
Content of
When yari sees a Note: We could've directly used soft link feature of operating systems as git handles them perfectly without hiccups. But there are platform specific variations. |
Beta Was this translation helpful? Give feedback.
-
Pinging this issue again. I'm looking at mdn/content#29975, which adds links to various globals under the But also, I agree with teoli that we should duplicate these globals under all the base class global-scope objects, like
I think it would be better not to make this dependent on Yari features. |
Beta Was this translation helpful? Give feedback.
-
For those global properties and methods, maybe a solution is to keep two pages under If the documentation itself is huge, we place the documentation under
for example, for
note if the page is simple, we could simply place as two documentaion (but I think add a link to each other is still necessary) this can not only used in global properties/methods, but also some other situations that causes dumplite documentations and it is doing similar things in examples, see api landing template |
Beta Was this translation helpful? Give feedback.
-
That's what my proposal is.
Yes, I think this would be OK if it seems necessary. |
Beta Was this translation helpful? Give feedback.
-
OK sorry for the delay in reading through - yes let's duplicate - more thoughts: I'm not really for this, it does add complexity for authors which I'm generally on the team of 'reduce complexity' and I do think we can come up a better solution, but I think that better solution will be platform dependent. I've reasoned with both of the above with:
|
Beta Was this translation helpful? Give feedback.
-
We just merged mdn/content#32040, which as a test case fixes one of the 20 members that need fixing ( Once it's percolated, if it seems to work I'll continue with the others. The procedure for each page is:
|
Beta Was this translation helpful? Give feedback.
-
mdn/content#32040 has percolated now so we can look at it. We have two pages:
Both pages have a In both pages, the sidebar gets a link to the IndexedDB API at the top, e.g. In all pages for each property's interface or its members (i.e. the In the IndexedDB API sidebar, both property pages are listed: The old page at https://developer.mozilla.org/en-US/docs/Web/API/indexedDB redirects to https://developer.mozilla.org/en-US/docs/Web/API/Window/indexedDB. |
Beta Was this translation helpful? Give feedback.
-
I'm closing this, since it seems we are into execution now. I've created mdn/content#33019 to track execution. |
Beta Was this translation helpful? Give feedback.
-
This is done: mdn/content#33019 . Massive thanks @skyclouds2001 for all your work on it. |
Beta Was this translation helpful? Give feedback.
We just merged mdn/content#32040, which as a test case fixes one of the 20 members that need fixing (
indexedDB
).Once it's percolated, if it seems to work I'll continue with the others.
The procedure for each page is:
Window
.Window
to be an instance property page, and update the content accordinglyWorkerGlobalScope
, that's worker-specificWeb/API/WorkerGlobalScope/indexedDB
toWeb/API/indexedDB
domxref
links