Intent to Ship: AbortSignal.timeout() Static Method

97 views
Skip to first unread message

Scott Haseley

unread,
Apr 22, 2022, 6:50:00 PMApr 22
to blink-dev

Contact emails

shas...@chromium.org

Explainer

https://github.com/whatwg/dom/pull/1032#issue-1058779111

Specification

https://dom.spec.whatwg.org/#dom-abortsignal-timeout

Summary

Returns a new AbortSignal object that is automatically aborted after a given number of milliseconds. This method can be used by developers to easily implement timeouts for signal-accepting async APIs, e.g. fetch().


Blink component

Blink>DOM

TAG review

https://github.com/w3ctag/design-reviews/issues/711

Note: the TAG review is still pending (we replied to their initial set of questions and are awaiting response). Since filing the issue, however, the DOM spec PR has been merged and Safari and Firefox have implemented the feature, meaning this should be exempt from TAG review.

TAG review status

Pending

Risks


Interoperability and Compatibility

Low risk. This feature is already part of the DOM standard, has web platform tests, and is implemented by Safari and Firefox. We'll improve eventual interop by shipping this feature.



Gecko: Shipped/Shipping (https://bugzilla.mozilla.org/show_bug.cgi?id=1753309). Available in FF 100

WebKit: Shipped/Shipping (https://bugs.webkit.org/show_bug.cgi?id=236039). Available in Safari TP Release 141: https://developer.apple.com/safari/technology-preview/release-notes/

Web developers: Positive. Positive reception to Chrome, Safari, and Node tweets:
https://twitter.com/simonplend/status/1494309000824954882

Other signals: This has also shipped in Node and Deno.

Ergonomics

We think this API is useful on its own, but also think it will benefit from an API to combine AbortSignals, e.g. combining a timeout with user cancellation, which we're currently working on: https://github.com/shaseley/abort-signal-any/blob/main/README.md.


Activation

The feature has already been implemented in both Safari and Firefox, but it would benefit from a polyfill for use in older browser versions.


Security

None.


WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

No, this change is strictly additive.



Debuggability

Basic tooling only, i.e. autocomplete support for the new AbortSignal method will be provided.


Is this feature fully tested by web-platform-tests?

Yes

Flag name

--enable-blink-features=AbortSignalTimeout

Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1181925

Launch bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1292159

Measurement

https://chromestatus.com/metrics/feature/popularity#AbortSignalTimeout

Non-OSS dependencies

Does the feature depend on any code or APIs outside the Chromium open source repository and its open-source dependencies to function?

No.

Sample links

https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout

Estimated milestones

103


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).


None.


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5768400507764736

Links to previous Intent discussions

Intent to prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKXGoJ21UGV-atHU38es8AtFC4tYX7PQrMCoq-zObxo36z4ELQ%40mail.gmail.com


This intent message was generated by Chrome Platform Status.

Mike Taylor

unread,
Apr 26, 2022, 8:23:10 AMApr 26
to Scott Haseley, blink-dev
LGTM1
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKXGoJ3TAcMOMsYtEVbDubh5NLVT%3Dm6TANkvAWYAZO8Mhn-15A%40mail.gmail.com.


Yoav Weiss

unread,
Apr 27, 2022, 2:18:00 AMApr 27
to Mike Taylor, Scott Haseley, blink-dev

Daniel Bratell

unread,
Apr 27, 2022, 5:03:40 AMApr 27
to Yoav Weiss, Mike Taylor, Scott Haseley, blink-dev
Reply all
Reply to author
Forward
0 new messages