Skip to content

Add queueMicrotask() #3033

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

foolip
Copy link
Collaborator

@foolip foolip commented Jun 10, 2025

No description provided.

@github-actions github-actions bot added the feature definition Creating or defining new features or groups of features. label Jun 10, 2025
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this perhaps be a feature called "Microtasks"?

Points in favor:

Copy link
Contributor

Choose a reason for hiding this comment

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

If there are no other developer-exposed ways to use microtasks than via the queueMicroTask, then I agree with this suggestion. Let's re-id and re-name this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The concept of microtasks is much, much older than queueMicroTask(), so I think it would be confusing to name it just microtasks. IIRC, the concept was formalized when promises were introduced, but there were similar "delay this work until just before we return to the event loop" concepts around before that too.

Copy link
Contributor

Choose a reason for hiding this comment

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

The counter argument I can see is that, before queueMicrotask, microtasks where only a concept, or a thing browsers did internally, rather than an API developers can use. If this description is correct, then I don't see much confusion in renaming the feature to microtasks, because that word never really matched with anything devs could do before.

Not a hill I will die on though. Happy to keep the proposed name too.

I remember doing setTimeout(1) years ago, is that how we used to queue microtasks before?

Copy link
Contributor

Choose a reason for hiding this comment

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

If there are no other developer-exposed ways to use microtasks than via the queueMicroTask, then I agree with this suggestion. Let's re-id and re-name this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature definition Creating or defining new features or groups of features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants