Skip to content
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

Content suggestion: Add one-liner to former WindowOrWorkerGlobalScope methods #8979

Closed
tjcrowder opened this issue Sep 16, 2021 · 7 comments
Closed
Labels
Content:WebAPI Web API docs effort: large This task is large effort. help wanted If you know something about this topic, we would love your help!

Comments

@tjcrowder
Copy link
Contributor

What is the new suggestion?

See this Twitter thread: Now that the potentially-confusing WindowOrWorkerGlobalScope prefix is gone, I suggest adding a one-liner paragraph near the top saying that the global is provided both by Window and WorkerGlobalScope (with links). Something like:

Available as a global in both windows and workers (see Window and WorkerGlobalScope).

Why is it important or useful?

The one good thing about the old prefix was that if you were "in the know," it told you right away whether something was Window-only (like document) or both (like encodeURIComponent).

Other supporting information

We'd make this change on the same set of pages that used to have the WindowOrWorkerGlobalScope prefix. I don't think we need this for Window-only or WorkerGlobalScope-only properties; it looks like they already have a prefix.

I should be able to work on this next week if you'd assign it to me. Any hints on how to approach it, etc., very welcome!

@tjcrowder
Copy link
Contributor Author

Probably best to remove self. in examples (for instance, here) at the same time. I think that's a holdover from when using self. as a prefix on the page title was being considered.

@Rumyra Rumyra added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Nov 25, 2021
@sideshowbarker sideshowbarker added help wanted If you know something about this topic, we would love your help! and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jul 6, 2022
@Josh-Cena Josh-Cena added Content:WebAPI Web API docs effort: large This task is large effort. labels Jun 27, 2023
@tjcrowder
Copy link
Contributor Author

@Josh-Cena @sideshowbarker Do you still want this? If so, I can finally (!) make good on my promise to do it.

But I see that things like setTimeout and Blob already have a note on them:

Note: This feature is available in Web Workers

Given that, is this still useful? If so, what form should it take? If not, I'll close the issue.

Sorry to have flaked on it. :-(

@sideshowbarker
Copy link
Collaborator

Howdy @tjcrowder. Thanks for following up. @OnkarRuikar, is this covered now by the work you've been doing?

@OnkarRuikar
Copy link
Contributor

OnkarRuikar commented Mar 10, 2024

Here is the Tweet thread for the ready reference:
Tweets


At the moment we have {{AvailableInWorkers}} macro to add following notes :

At the moment we do not have a mechanism to tag a page with following:

  1. available as global in both Window and Worker scopes
  2. available as global in only Window scope
  3. available as global in only Worker scope
  4. available in both Window and Worker scopes
  5. available in only Window scope
  6. available in only Worker scope

There are already too many status banners crowding page tops, e.g. Barcode Detection API and PaymentAddress#country. So introducing a new one won't be welcomed easily. May be we could repurpose the same {{AvailableInWorkers}} macro to show appropriate info.


Does automation already exist that could do that? Or does it take grunts like me to add it (hopefully add some macro)? ("Like me" because hey, I'm the one saying it "would be good," so put up or shut up.😀)

The automation to add such status macros is being developed. Once it is up and running we can easily add and keep updated the statuses mentioned in this post. The automation may take time to go live depending on the interest shown by the top brass.

One could use webref to determine the exposure set of global APIs, and in fact all APIs.

I agree. We are trying to utilise @webref/idl package for the automation but it doesn't have the complete data. Our script we'll have to do some inferences and some web features we need to curate manually.

There’s no place to put that information in BCD though, maybe there should be?

Yes, BCD couldn't be burdened more. We are planning to create a separate repo for hosting such info.

Given that, is this still useful? If so, what form should it take? If not, I'll close the issue.

This GitHub issue proposes to tag API pages with detailed scope info. So I say we keep it open to track this.
The automation is about just adding the macros/notes to the pages. Actually, first we'll have to start a discussion on MDN to get an approval to add an accurate scope info banner to all the Web API pages.

@OnkarRuikar, is this covered now by the work you've been doing?

Actually the work is about secure context statuses. But I have proposed to involve {{AvailableInWorker}} status macros as well.

@wbamberg
Copy link
Collaborator

Ah, this intersects with https://github.com/orgs/mdn/discussions/360 and #32040.

@wbamberg
Copy link
Collaborator

wbamberg commented Apr 5, 2024

I think we should close this issue in favour of the one outlined in https://github.com/orgs/mdn/discussions/360, unless people have objections to that (but since that discussion has been open for almost a year and I've started to implement it, I hope not to see any) 🤞 .

@tjcrowder
Copy link
Contributor Author

I agree, https://github.com/orgs/mdn/discussions/360 covers this. I see several agreements as votes on @wbamberg's comment above, so I'm going ahead and closing this, but someone can reopen if that's premature.

@wbamberg wbamberg closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs effort: large This task is large effort. help wanted If you know something about this topic, we would love your help!
Projects
Status: Done
Development

No branches or pull requests

6 participants