Skip to content

fetchLater() API (previously: PendingBeacon API) #85

Closed

Description

@mingyc

Request for position on an emerging web specification

  • WebKittens who can provide input:

Information about the spec

Design reviews and vendor positions

Anything else we need to know

We would like to have feedback from WebKit about this API before finalizing its shape and behavior.

Activity

  1. added
    topic: web apis
    venue: WICG
    from: Google
    on Nov 10, 2022
  2. othermaciej commented on Dec 20, 2022

    @othermaciej

    How does this relate to Beacon API? Why is it a separate spec and not an extension of Beacon API?

    Also on first glance, this is a lot more complicated than Beacon API itself, which is just one method, not a class hierarchy of multiple interfaces. Is the extra complexity actually necessary? At first glance, it's not obvious why it is necessary to have all these ways to customise a "pending" beacon when regular beacons don't need these things. (If Beacon API itself is underpowered, then that would be more reason to extend the Beacon API instead of making an orthogonal API).

  3. othermaciej commented on Dec 20, 2022

    @othermaciej

    Also needs to be examined to see if it enables cross-site tracking.

  4. added
    concerns: complexity
    concerns: privacy
    concerns: integration
    on Dec 20, 2022
  5. mingyc commented on Dec 21, 2022

    @mingyc
    Author

    I'll try to answer some of your questions. Feel free to add more under https://github.com/WICG/pending-beacon/issues so that more pepole can discussion

    How does this relate to Beacon API? Why is it a separate spec and not an extension of Beacon API?

    At the beginning there were discussions around the following options

    1. extending navigator.sendBeacon() with a flag: the use cases went beyond a single flag. They need to be able to update what will be sent and/or cancel it. But the existing sendBeacon() semantic doesn't support it.
    2. adding a new declarative DOM API: but scripting will be neccessary to fill data.
    3. [chosen] adding a new stateful JS API.

    1 and 2 have its own drawbacks, and the 3rd one is chosen. @fergald might be able to provide full context.

    Also on first glance, this is a lot more complicated than Beacon API itself, which is just one method, not a class hierarchy of multiple interfaces. Is the extra complexity actually necessary?

    It's answered in WICG/pending-beacon#59. In short we would like to provide more type safety on compile time.

    At first glance, it's not obvious why it is necessary to have all these ways to customise a "pending" beacon when regular beacons don't need these things. (If Beacon API itself is underpowered, then that would be more reason to extend the Beacon API instead of making an orthogonal API).

  6. mingyc commented on Dec 21, 2022

    @mingyc
    Author

    Also needs to be examined to see if it enables cross-site tracking.

    The scope of this API proposal doesn't include cross-site tracking.

    Also cc @fergald

  7. mingyc commented on Jan 19, 2023

    @mingyc
    Author

    @othermaciej pinging for any updates or comments

  8. mingyc commented on Feb 2, 2023

    @mingyc
    Author

    Friendly pinging again for your position.

    How does this relate to Beacon API? Why is it a separate spec and not an extension of Beacon API?

    In addition to the above reasons from #85 (comment), we further added a section to explain why not extending the Fetch API (Beacon API is roughly equivalent to Fetch keepalive for Post-only request). Simply put, our requirements are beyond the scope of Fetch.

  9. marcoscaceres commented on Feb 6, 2023

    @marcoscaceres
    Contributor

    I’m also concerned about adding an entirely new API.

    They need to be able to update what will be sent and/or cancel it. But the existing sendBeacon() semantic doesn't support it.

    sure, but I’m wondering if all possible options have been explored for extending the existing spec? For instance, perhaps a third argument could be added to sendBeacon() accepting a dictionary that:

    • takes an optional AbortController’s signal
    • takes an optional http method name, so to support POST.
    • takes the timeout.

    Perhaps something like the above could addressed the use cases without needing an entirely new API?

  10. added
    concerns: venue
    on Feb 6, 2023
  11. 30 remaining items

  12. reopened this on Mar 29, 2023
  13. moved this from Unscreened to Blocked in Standards Positions Review Backlogon Mar 29, 2023
  14. annevk commented on Apr 27, 2023

    @annevk
    Contributor

    We put forward a proposal that would remove a number of our concerns here and would make us supportive of this effort: WICG/pending-beacon#70 (comment).

  15. added and removed
    blocked
    on May 5, 2023
  16. marcoscaceres commented on May 5, 2023

    @marcoscaceres
    Contributor

    Marking as support given the progress made...

  17. mingyc commented on Jul 18, 2023

    @mingyc
    Author

    Note: the PendingBeacon API has been evolved to a fetch-based approach, and the latest discussions happen in whatwg/fetch#1647

  18. changed the title [-]PendingBeacon API[/-] [+]fetchLater() API (previously: PendingBeacon API)[/+] on Nov 9, 2023
  19. mingyc commented on Dec 10, 2024

    @mingyc
    Author

    Filed implementation request at https://bugs.webkit.org/show_bug.cgi?id=284347

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

concerns: API designconcerns: complexityconcerns: integrationconcerns: maintenanceconcerns: privacyconcerns: venuefrom: Googleposition: supporttopic: loadingtopic: web apisvenue: WICG

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions