Definitely not a better title, but a clearer synopsis: web workers [were] not the [appropriate solution to the problem we set out to solve, in fact their constraints helped us discover an extant problem and address it. Nothing peculiar or otherwise about web workers was implicated].
It’s possible this realization has broader value: digging in to better understand a problem and finding the appropriate solution is different than you presupposed are important skills! But I do think the title and summary do it a disservice. And I’m wary of how that might mistakenly influence people to reflexively dismiss web workers for appropriate use cases.
This is a problem with react, and it's middlewares where things become a convoluted mess if there isn't at least one person that's experienced with what's actually happening and is attentive to avoid pitfalls with potential side-effects.
This is what to, the issue boils down, and such incorrect React’s usage should be clear to junior-level developers.
[0]: https://github.com/welldone-software/why-did-you-render
It seems like maybe the API provider (Apollo) should provide a way to avoid the extraneous renders. Maybe this is unavoidable due to the React hooks architecture.
However, I would say it doesn’t emphasise issue, from React’s perspective, enough.
Languages like C++ or Rust, where pointer/reference definitions are required, has an advantage that you won’t miss the fact that something has pointer.
Worthy mention - `additionalProperties` property of `react-hooks/exhaustive-deps` ESLint rule, allows to define hooks which requires referential stability for dependencies. Personally, I’ve yet to use it.
Not that I don't appreciate the effort, but the more articles I see like this, it starts to make me wonder. In the future will I have to write a full report with infographics every time I debug or optimize something?
Imagine how much more productive engineers could be these days if they didn't have to do a presentation or book tour every time they solved a problem.
Web workers definitely have their place to be useful. I think we can just take it as "Web workers weren't the right solution for this".
Still an interesting read.
I would also be wary of any code I wrote after 16 years (though some I do... the very pure no dependency stuff!)
In 2 years that'll be 3x8 years and I hope to pass the audition.