Yield to main before every Interactivity API store action, unless it uses withEvent()
#64946
Labels
[Feature] Interactivity API
API to add frontend interactivity to blocks.
[Packages] Interactivity
/packages/interactivity
[Type] Enhancement
A suggestion for improvement.
[Type] Performance
Related to performance efforts
This is a follow-up issue to #64944. Please see that issue for additional context.
This issue is about implementing step 2. from the overall plan outlined in #64944 (and potentially part of step 3. as well): All store actions should be yielded to the main thread, unless they use
withEvent
. At this point,data-wp-on-async
should effectively be treated the same asdata-wp-on
, ignoring the difference between the directives, anddata-wp-on-async
should be discouraged as it no longer provides any value.Since this is a breaking change, this must not happen until at least one release cycle after #64944 was launched in WordPress Core. We need to keep an eye out on ecosystem adoption of
withEvent
as well, before being able to confidently make this change.The text was updated successfully, but these errors were encountered: