Hey folks,
We’ve recently landed a fix <https://chromium-review.googlesource.com/c/chromium/src/+/6931651> on issue <https://issues.chromium.org/issues/40894694> where multiple deferred scripts where all executing in the same task. That’s something developers have been complaining about, as a source of long tasks in sites that have many different deferred scripts from various sources. The fix is behind the experimental SeparateDeferModuleScriptTasks flag at the moment and +Scott Haseley is planning to Finch it to see its impact on INP in the wild. As far as we can tell, because current deferred scripts are running at a very high priority, the fix is barely web-exposed. rAF is the only JS-driven task that can now run in between those scripts, and even that is only when the scripts delay it by over a 100ms. For classic deferred scripts or external module scripts, rAF could already run between them in case of a network delay. Inline module scripts are the only ones where rAF could not run between the different scripts before, and now it can. Given the above, and the amount of work it took us to actually find a scenario where this is WPT-testable, we don’t think there’s real compat risk with shipping this. At the same time, this will be behind a flag so we can roll it back quickly in case of surprises that we’d somehow miss during the Finch period. There’s still an open question of whether the HTML spec <https://html.spec.whatwg.org/#the-end> needs to be changed, or if “spin the event loop” allows for the tasks to be queued. We’d appreciate opinions on that front. -- 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+unsubscr...@chromium.org. To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/49e6655f-0ee9-4f67-960a-ccfa2e49e2b2n%40chromium.org.