Skip to content

Don't require action within a Promise reaction microtask. #570

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

Merged
merged 8 commits into from
May 19, 2025

Conversation

jan-ivar
Copy link
Contributor

@jan-ivar jan-ivar commented Apr 26, 2025

Copy link
Contributor

@jyasskin jyasskin left a comment

Choose a reason for hiding this comment

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

Thanks @jan-ivar. I've left a bunch of suggestions for @martinthomson to review, and you're welcome to apply any that you agree with or make other changes in response, but we can also take it from here.

@jyasskin jyasskin requested a review from martinthomson May 8, 2025 21:59
Comment on lines +1986 to +1989
If developer-supplied code needs to be able to call <code>event.{{Event/preventDefault()}}</code>
or choose a response object with
<code>fetchEvent.{{FetchEvent/respondWith()}}</code>,
it needs to be a callback rather than a reaction passed to <code>Promise.{{Promise/then()}}</code>.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a good example or a bad one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's probably ingrained at this point. Whether it's a good pattern or not might be debatable. The last place I personally encountered it was https://w3c.github.io/webrtc-extensions/#dfn-icecandidatepairremove (though our motivation there was finding a manner of interfering with the ICE agent that the most people could stomach).

@jan-ivar
Copy link
Contributor Author

Thanks for all the feedback, this is looking much better!

@martinthomson martinthomson merged commit 8b0f2a8 into w3ctag:main May 19, 2025
1 check passed
github-actions bot added a commit that referenced this pull request May 19, 2025
SHA: 8b0f2a8
Reason: push, by martinthomson

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jan-ivar jan-ivar deleted the synccallbacks branch May 19, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New principle: Support common promise practices
3 participants