Follow

I feel like a lot of devs are sleeping on and using one to store more "data" related state in order to keep logic on actual pages more sparse.

E.g. have your connection to the backend and your IndexedDB caching layer in the shared worker, then have pages load some basic web components and query the backend.

This works better for multi-window/tab setups which used to be the default in desktop apps back in the day.

Now it's all tied in a single page monolith.

· · Web · 1 · 1 · 1

@mauve we gotta sit down and talk this out. We have a very similar pattern with our stuff where we SSR some web components, use client side JS to upgrade their interactivity but communicate to our backend API’s via a web worker.

@macdonst I got inspired by looking at how some native UI frameworks do it. E.g. on iOS it seems that "veiws" are a lot more lightweight and you offload more of your data to a database. Similar with some desktop UI frameworks?

I think Electron was made to be that way to an extent with the node.js thread, but people are too used to shoving everything under the sun into the UI in JS land.

@mauve we shove everything into DynamoDB, SSR the HTML and only add JS to our web components if absolutely necessary. Check out enhance.dev

Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.