Hacker News new | ask | show | jobs
by speakwithalisp 2367 days ago
The reason frameworks usually don't run in a worker thread is because it is difficult to efficiently cross the barrier between workers and the main thread. Either you need a shared array buffer or the contents of your messages have to be copied on write. Even web assembly has similar issues as it runs in the same thread as any JavaScript you have.

I do agree about making the distinction between sites and apps though. A lot of the contortion frameworks do is to avoid triggering layout excessively. You can't even get the position of a DOM element without layout rerunning to figure out where it should be. I suspect a lot of these quirks are legacy web behaviors more applicable to sites than applications.

1 comments

I've done some experiments in regards to a message service. And though a lot of this work isn't ready for production I have seen a lot of success. Long story short SSR to rebind via webworker. Unfortunately it's just one of many experiments that are way back in my todo list now.