The State Of Web Workers In 2021

You gotta appreciate the tenacity of Surma. He’s been advocating for Web Workers as a path forward to better-feeling websites for a lot of years now. He’s at it again making sure we all understand the landscape:

[…] regardless


The post The State Of Web Workers In 2021 appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.

You gotta appreciate the tenacity of Surma. He’s been advocating for Web Workers as a path forward to better-feeling websites for a lot of years now. He’s at it again making sure we all understand the landscape:

[…] regardless of where you look, multithreading is used everywhere. iOS empowers developers to easily parallelize code using Grand Central Dispatch, Android does this via their new, unified task scheduler WorkManager and game engines like Unity have job systems. The reason for any of these platforms to not only support multithreading, but making it as easy as possible is always the same: Ensure your app feels great.

Surma, “The State Of Web Workers In 2021”

So pretty much every platform has its own version of multi-threading, including the web. It’s just that on the web we have to sort of “fight” against the single-threaded nature of JavaScript by using Web Workers (which are “universally supported” if you’re wondering about that). The question is: use them how and for what? For the latter, Surma shows off an example of a game where “the entire app state and game logic is running in a worker.” For the former, the helper library comlink looks like a big reduction in toil.

Personally, I wish popular tooling would just kinda… do it. I don’t know what that really looks like, but it kinda feels like developer outreach isn’t really moving the needle on this. What if popular tooling like Apollo — which is in charge of a lot of “app state” — were to magically handle all of that off the main thread. Does that make sense? Is it possible?

Direct Link to ArticlePermalink


The post The State Of Web Workers In 2021 appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.


Print Share Comment Cite Upload Translate
APA
Chris Coyier | Sciencx (2024-03-28T09:20:59+00:00) » The State Of Web Workers In 2021. Retrieved from https://www.scien.cx/2021/08/04/the-state-of-web-workers-in-2021-2/.
MLA
" » The State Of Web Workers In 2021." Chris Coyier | Sciencx - Wednesday August 4, 2021, https://www.scien.cx/2021/08/04/the-state-of-web-workers-in-2021-2/
HARVARD
Chris Coyier | Sciencx Wednesday August 4, 2021 » The State Of Web Workers In 2021., viewed 2024-03-28T09:20:59+00:00,<https://www.scien.cx/2021/08/04/the-state-of-web-workers-in-2021-2/>
VANCOUVER
Chris Coyier | Sciencx - » The State Of Web Workers In 2021. [Internet]. [Accessed 2024-03-28T09:20:59+00:00]. Available from: https://www.scien.cx/2021/08/04/the-state-of-web-workers-in-2021-2/
CHICAGO
" » The State Of Web Workers In 2021." Chris Coyier | Sciencx - Accessed 2024-03-28T09:20:59+00:00. https://www.scien.cx/2021/08/04/the-state-of-web-workers-in-2021-2/
IEEE
" » The State Of Web Workers In 2021." Chris Coyier | Sciencx [Online]. Available: https://www.scien.cx/2021/08/04/the-state-of-web-workers-in-2021-2/. [Accessed: 2024-03-28T09:20:59+00:00]
rf:citation
» The State Of Web Workers In 2021 | Chris Coyier | Sciencx | https://www.scien.cx/2021/08/04/the-state-of-web-workers-in-2021-2/ | 2024-03-28T09:20:59+00:00
https://github.com/addpipe/simple-recorderjs-demo