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

FetchLater #2657

Open
mingyc opened this issue Feb 17, 2025 · 12 comments · May be fixed by #2771
Open

FetchLater #2657

mingyc opened this issue Feb 17, 2025 · 12 comments · May be fixed by #2771
Labels
feature definition Creating or defining new features or groups of features.

Comments

@mingyc
Copy link

mingyc commented Feb 17, 2025

Specification

whatwg/fetch#1647

Description

Propose to add a new feature FetchLater for the corresponding JS API.

Documentation

https://github.com/WICG/pending-beacon/blob/main/docs/fetch-later-api.md

Browser support

@mingyc mingyc added the feature definition Creating or defining new features or groups of features. label Feb 17, 2025
@captainbrosset
Copy link
Contributor

Thank you, we should indeed add this. The feature is shipping with Chrome and Edge 134.
Note that BCD has not yet been updated for Chrome Beta 134, at least I don't think it has. @Elchi3 can you confirm?

@Elchi3
Copy link
Collaborator

Elchi3 commented Feb 17, 2025

I saw and tested this but I haven't confirmed it shipping in Chrome 134 beta.

@mingyc
Copy link
Author

mingyc commented Feb 18, 2025

We haven't enabled it for M134 Beta yet.

@mingyc
Copy link
Author

mingyc commented Feb 18, 2025

Sorry maybe a noob question, but if we are already using Chromium WebFeature for FetchLater. Do we still need to switch to WebDXFeature, or can we log both?

@captainbrosset
Copy link
Contributor

We haven't enabled it for M134 Beta yet.

https://chromestatus.com/roadmap still has it as part of 134. Will it stay on 134, or likely move out to a later release?

Sorry maybe a noob question, but if we are already using Chromium WebFeature for FetchLater. Do we still need to switch to WebDXFeature, or can we log both?

Maybe @foolip will know how to reply to this, I'm not sure I understand what you mean by "Chromium WebFeature" vs. "WebDXFeature". I'm guessing this is about use-counters, but not sure.

@atopal
Copy link
Collaborator

atopal commented Feb 18, 2025

@mingyc assuming you're talking about use counters, you'd have to add a WebDXFeature use counter, even if you already added an old style WebFeature use counter already, but you can have both, no problem. Keep in mind, WebDXFeatures are different from old style use counters in that there is a 1:1 mapping between a use counter and a feature, they measure usage on a high level feature level, more about that in the public doc.

@foolip
Copy link
Collaborator

foolip commented Feb 19, 2025

@mingyc you must mean WebFeature::kFetchLater which is the classic use counter, the kind that we show data from on chromestatus.com. You can absolutely keep such use counters, and just add a simple mapping from them to "WebDXFeature" which is organized around web-features. https://chromium-review.googlesource.com/c/chromium/src/+/6269037 is an example of this I did recently.

@mingyc
Copy link
Author

mingyc commented Mar 3, 2025

Update: The launch is delayed to M135.

I've also sent out https://chromium-review.googlesource.com/c/chromium/src/+/6310147 as suggested above to map the classic use counter.

aarongable pushed a commit to chromium/chromium that referenced this issue Mar 3, 2025
- WebDX community [issue for FetchLater][1]
- As suggested in [the discussion][2], this CL introduces a new
WebDXFeature for FetchLaterAPI, and maps the existing use counter to it.

[1]: web-platform-dx/web-features#2657
[2]: web-platform-dx/web-features#2657 (comment)

Bug: 40276121
Change-Id: I539c038725254522d6553723a7780b1840b4bb74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6310147
Commit-Queue: Ming-Ying Chung <[email protected]>
Auto-Submit: Ming-Ying Chung <[email protected]>
Reviewed-by: Tsuyoshi Horo <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1426974}
@ErwinHofmanRV
Copy link
Contributor

ErwinHofmanRV commented Mar 13, 2025

+1 from RUMvision (as we're writing a blogpost covering the deprecation of unload and alternatives like beforeunload, pagehide, visibilitychange and fetchLater and then concluded that we couldn't add a baseline-component for our fetchLater chapter yet 😅 )

@Elchi3
Copy link
Collaborator

Elchi3 commented Mar 13, 2025

It is in Chromium 135. I collected compat data for it in mdn/browser-compat-data#26135

The keys are:

  • api.FetchLaterResult
  • api.FetchLaterResult.activated
  • api.Window.fetchLater

So, someone should create a web-feature with these BCD keys.

@captainbrosset
Copy link
Contributor

I'll take this one.

@captainbrosset captainbrosset linked a pull request Mar 13, 2025 that will close this issue
@captainbrosset
Copy link
Contributor

@mingyc could you please take a look at #2771 and review the feature description in the yml file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants