Skip to content

Document fetchLater() #39016

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

Merged
merged 65 commits into from
Apr 9, 2025
Merged

Document fetchLater() #39016

merged 65 commits into from
Apr 9, 2025

Conversation

tunetheweb
Copy link
Contributor

@tunetheweb tunetheweb commented Apr 7, 2025

Description

Adds docs on fetchLater() API added in Chrome 135.

Motivation

New API that needs documenting.

NOTE the spec changes have NOT been merged yet, so the docs show missing spec at present.

Additional details

ChromeStatus: https://chromestatus.com/feature/4654499737632768
Previous Origin Trail article on developer.chrome.com: https://developer.chrome.com/blog/fetch-later-api-origin-trial

Explainer: https://github.com/WICG/pending-beacon/blob/main/docs/fetch-later-api.md
Spec PR (not merged yet): whatwg/fetch#1647

Related issues and pull requests

Added to BCD in mdn/browser-compat-data#26135 and mdn/browser-compat-data#26437.

@tunetheweb tunetheweb requested review from a team as code owners April 7, 2025 10:15
@tunetheweb tunetheweb requested review from hamishwillee, wbamberg and pepelsbey and removed request for a team April 7, 2025 10:15
@github-actions github-actions bot added Content:WebAPI Web API docs Content:HTTP HTTP docs size/l [PR only] 501-1000 LoC changed labels Apr 7, 2025
Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tunetheweb getting there! A few more comments for you, mostly around the quotas guide rewrite.

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@tunetheweb
Copy link
Contributor Author

@chrisdavidmills any thoughts on KB (ambiguous as to whether 1000 bytes or 1024 bytes, though technically it's 1000) versus KiB (explicitly 1024 bytes and technically more accurate)?

@noamr suggested it's technically KiB and so changed it in 44b6681 but doesn't seem like KiB is used much in MDN.

@chrisdavidmills
Copy link
Contributor

@chrisdavidmills any thoughts on KB (ambiguous as to whether 1000 bytes or 1024 bytes, though technically it's 1000) versus KiB (explicitly 1024 bytes and technically more accurate)?

@noamr suggested it's technically KiB and so changed it in 44b6681 but doesn't seem like KiB is used much in MDN.

@tunetheweb I've seen KiB used elsewhere on MDN; I think it's good to be accurate.

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tunetheweb I think this is pretty much ready to go. I've just left a few non-blocking suggestions for you. Let me know when you've considered them, and I will get it merged!

@@ -2,6 +2,8 @@
title: "Permissions-Policy: deferred-fetch"
slug: Web/HTTP/Reference/Headers/Permissions-Policy/deferred-fetch
page-type: http-permissions-policy-directive
status:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker, but you actually don't need to add these anymore; the system adds them automatically based on the BCD.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(just informational; you don't need to remove them again)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the sidebar didn't show the flask icon without these explicit addition?

image

Or do you mean they ARE needed, but will be added automatically after merge so I didn't need to add them manually (but no harm that I have done it - but more FYI for next time to save me some bother?).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or do you mean they ARE needed, but will be added automatically after merge so I didn't need to add them manually (but no harm that I have done it - but more FYI for next time to save me some bother?).

Yes, exactly correct.

tunetheweb and others added 3 commits April 9, 2025 13:07
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
@tunetheweb
Copy link
Contributor Author

Thanks for your help reviewing @noamr and @chrisdavidmills !

I've seen some movement on the spec PR so hopefully that'll follow along soon. But this one has dragged on so let's not wait for that in case it's not as close as I think since Chrome has shipped this already. Will add spec links to BCD after it's been merged and it should flow into here.

@chrisdavidmills chrisdavidmills merged commit 31ba9f6 into mdn:main Apr 9, 2025
9 checks passed
@chrisdavidmills
Copy link
Contributor

Nice work, @tunetheweb.

cssinate pushed a commit to cssinate/content that referenced this pull request Apr 11, 2025
* Fetch Later API

* More updates

* Rename api

* Add quotas docs

* Tweaks

* Cleanup

* Linting fix

* Linting fix

* Update PP docs

* Fix folder name

* Fix example

* Linting fixes

* More linting fixes

* Tweak

* Explain example

* More linting

* Add CSP and more exception details

* Update files/en-us/web/api/window/fetchlater/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/api/window/fetchlater/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/api/window/fetchlater/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/api/window/fetchlater/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* more quota examples

* Update files/en-us/web/api/fetchlater_api/fetchlater_quotas/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Review feedback

* Accepting first batch of review feedback

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>

* Second batch of suggestions from code review

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>

* Update files/en-us/web/api/fetchlater_api/index.md

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>

* Update files/en-us/web/api/fetchlater_api/index.md

* Update files/en-us/web/api/fetchlater_api/index.md

* Update files/en-us/web/api/fetchlater_api/index.md

* Update files/en-us/web/api/fetchlater_api/fetchlater_quotas/index.md

* Update files/en-us/web/api/fetchlater_api/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/api/fetchlater_api/fetchlater_quotas/index.md

* Update files/en-us/web/api/fetchlater_api/fetchlater_quotas/index.md

* Update files/en-us/web/api/window/fetchlater/index.md

* Review feedback

* Update files/en-us/web/api/fetchlaterresult/activated/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Rename file

* Meta cleanup

* Tweaks

* browser-compat for deferred-fetch and deferred-fetch-init

* Permissions Policy updates

* Apply suggestions from code review

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>

* Update files/en-us/web/api/fetchlater_api/fetchlater_quotas/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/api/fetchlater_api/fetchlater_quotas/index.md

* Review feedback

* KB -> KiB

* Permissions Policy BCD fixes

* Frontmatter

* Fetch Interfaces

* Update files/en-us/web/api/deferredrequestinit/index.md

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>

* Update files/en-us/web/api/fetchlater_api/fetchlater_quotas/index.md

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>

* Update files/en-us/web/api/fetchlater_api/fetchlater_quotas/index.md

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:HTTP HTTP docs Content:WebAPI Web API docs size/l [PR only] 501-1000 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants