Intent to Ship: Promise.withResolvers

302 views
Skip to first unread message

Shu-yu Guo

unread,
Sep 14, 2023, 7:50:14 PM9/14/23
to blink-dev

Contact emails

s...@chromium.org

Explainer

None

Specification

https://tc39.es/proposal-promise-with-resolvers

Summary

Promise.withResolvers is a static methods that returns a new Promise along with its resolver functions, i.e. `const { promise, resolve, reject } = Promise.withResolvers()`. This is a standard version of a common helper function found in many JS libraries. Historically, some may know it as `defer` or `deferred`.



Blink component

Blink>JavaScript>Language

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

Very little risk. This is a new static method on the Promise constructor.



Gecko: Positive This is a Stage 3 TC39 proposal.

WebKit: Positive (https://bugs.webkit.org/show_bug.cgi?id=259153) This is a Stage 3 TC39 proposal.

Web developers: Positive

Other signals:

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?

None



Debuggability



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes

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

In test262.

Flag name on chrome://flags

--js-promise-withresolvers

Finch feature name

JavaScriptPromiseWithResolvers

Requires code in //chrome?

False

Estimated milestones

Shipping on desktop119
DevTrial on desktop117
Shipping on Android119
DevTrial on Android117


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/5810984110784512

Links to previous Intent discussions



This intent message was generated by Chrome Platform Status.

Yoav Weiss

unread,
Sep 16, 2023, 2:22:41 AM9/16/23
to Shu-yu Guo, blink-dev
LGTM1

Very neat!! That would definitely have simplified some testing code I recently wrote :)

On Fri, Sep 15, 2023 at 1:50 AM 'Shu-yu Guo' via blink-dev <blin...@chromium.org> wrote:

Contact emails

s...@chromium.org

Explainer

None

https://github.com/tc39/proposal-promise-with-resolvers/blob/main/README.md seems to be the explainer for this. (which I found useful)
 
--
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/CAN-e9e-C0T4tV-8kOVfYZVG1nL9wXqK-twi-Tj3fFp3K8V398Q%40mail.gmail.com.

Mike Taylor

unread,
Sep 16, 2023, 10:22:33 AM9/16/23
to Yoav Weiss, Shu-yu Guo, blink-dev

Alex Russell

unread,
Sep 16, 2023, 1:22:56 PM9/16/23
to Mike Taylor, Yoav Weiss, Shu-yu Guo, blink-dev
Reply all
Reply to author
Forward
0 new messages