News for hackers. Stuff that matters.
Re:Breaking Up with Long Tasks or: how I learned to group lo... by fenomas on Saturday January 04, 2025 @01:40AM (#42592953)
> you might be better off just offloading that optimized synchronous op to a worker thread (or to wasm) to not block the UI.

It works in principle, but note that this really complicates your build process. In particular, if you're writing a library that other people will use as a dependency, there's really no good way to use workers at all without affecting how people bundle their code using your library.

Re:Breaking Up with Long Tasks or: how I learned to group lo... by adregan on Saturday January 04, 2025 @09:49AM (#42594981)
The library use case is trickier, but bundlers do a pretty good job of handling workers (albeit with funky magic comments in webpack’s case).

What I find a pain is the uneven support for shared workers.