Intent to Implement and Ship: queueMicrotask

104 views
Skip to first unread message

Fergal Daly

unread,
Jul 18, 2018, 2:25:47 AM7/18/18
to blink-dev, Domenic Denicola

Contact emails

fer...@chromium.org, dom...@chromium.org


Spec

https://github.com/whatwg/html/pull/2789

Discussion: https://github.com/whatwg/html/issues/512


Summary

Add a new method self.queueMicrotask(Function callback) to allow direct queueing of a microtask.


Motivation

There are many existing ways to queue asynchronous work on the platform, including setTimeout(,0)/the Edge-only setImmediate(); requestAnimationFrame(); and requestIdleCallback(). However, all of them yield to the browser's event loop.


Web developers often want to perform some work as soon as possible, without yielding, but still "async". This is especially useful for operations which can be completed immediately (e.g. serviced from cache). The web platform's primitive for this is queuing a microtask. Developers and frameworks are already queuing their own microtasks by using Promise.resolve().then(callback) or MutationObservers. This API exposes the microtask-queuing primitive directly.



Risks

Interoperability and Compatibility

Low


Edge: positive signals

Firefox: some support, back in 2016

Safari: no signals

Web developers: Positive, seen on github discussion above and by the many frameworks using hacks to work around this (Angular, Ember, Vue, asap dependents...)

Ergonomics

This is making directly available an action that is currently hackily performed. As such it's an ergonomic win.


Activation

Frameworks and developers can use this immediately as-is.



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?

Not yet. PR for tests is

https://github.com/web-platform-tests/wpt/pull/6334

Link to entry on the feature dashboard

https://www.chromestatus.com/feature/5111086432911360


Requesting approval to ship?

Yes



Yoav Weiss

unread,
Jul 18, 2018, 2:56:04 AM7/18/18
to Fergal Daly, blink-dev, Domenic Denicola
Could you please follow the current I2S template?

Things I'm missing here: 
* Is there an explainer for the feature?
* Was this filed for a TAG review?

--
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/CAAozHLkxxLUX9Ojn_ietwiC%3DLDZsRiO9mx-NSBWxN8VGOv6S8A%40mail.gmail.com.

Fergal Daly

unread,
Jul 18, 2018, 5:13:44 AM7/18/18
to Yoav Weiss, blink-dev, Domenic Denicola
On 18 July 2018 at 15:55, Yoav Weiss <yo...@yoav.ws> wrote:
Could you please follow the current I2S template?

Sorry, I copied a recent email rather than the canonical template. Thanks for catching these. I will follow up with some changes,

F
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

Hayato Ito

unread,
Jul 18, 2018, 5:22:41 AM7/18/18
to Fergal Daly, yo...@yoav.ws, blink-dev, Domenic Denicola
I chatted with Fergal.  Since the spec PR is not merged yet, maybe this might be just I2I for now, hoping that the situation will be more clear later.
We'll follow up.


To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEib5tZ_0XYttYiVxQ-iFHiY9F3Hm7kNOaye_Oadu0-ZDw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.

Daniel Bratell

unread,
Jul 26, 2018, 12:20:56 PM7/26/18
to Fergal Daly, Hayato Ito, yo...@yoav.ws, blink-dev, Domenic Denicola
Ok, just for the record we (API owners) consider this as withdrawn.

/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFpjS_1JTQ5iSJPtpwKc%3D_amutY%2BXQYUqf5kNwGtWSFG8YnyKw%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

Fergal Daly

unread,
Jul 27, 2018, 1:01:20 AM7/27/18
to Daniel Bratell, Hayato Ito, Yoav Weiss, blink-dev, Domenic Denicola
On 27 July 2018 at 01:20, Daniel Bratell <bra...@opera.com> wrote:
Ok, just for the record we (API owners) consider this as withdrawn.

Thanks. The TAG issue is here and the explainer is here but there's some debate on the TAG issue, so I will resend when that is resolved,

F
 
We'll follow up.


To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEib5tZ_0XYttYiVxQ-iFHiY9F3Hm7kNOaye_Oadu0-ZDw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAAozHLnfkpXLczbdxmKO2xA3yu4kkgkq4gkDNWnm8R7YKrdBuA%40mail.gmail.com.


--
Hayato
--
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+unsubscribe@chromium.org.
Reply all
Reply to author
Forward
0 new messages