You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Run the same WordPress instance across many browser tabs (SharedWorker? Shared FS?) #32
changed the title [-][Browser] Run the same WordPress instance across many browser tabs[/-][+]Run the same WordPress instance across many browser tabs[/+]on Oct 22, 2022
A recent article describes how Notion used SharedWorker to share an SQLite database in OPFS across multiple browser tabs.
To execute any SQLite query, the main thread of each tab sends that query to the SharedWorker, which redirects to the active tab’s dedicated Worker. Any number of tabs can make simultaneous SQLite queries as many times as they want, and it will always be routed to the single active tab.
Another option would be to use SharedWorker as a traffic controller that elects one of the active tabs as a "leader" and uses it to resolve all the requests.
I've explored using SharedWorkers and learned this:
A SharedWorker would introduce coupling between Playground deployments.
Imagine visiting playground.wordpress.net, opening a site, and implicitly starting a SharedWorker. Then a new webapp version is deployed. Then you open new tab and go there. Now we have a few choices:
reuse the existing SharedWorker, even though it may be incompatible with the new webapp
start a new SharedWorker and run multiple conflicting Playgrounds for the same site. Potentially display a modal in other running tabs
start a new SharedWorker, hotswap the old SharedWorker, hotswap the old webapp for the new webapp
The solutions are either complex or a bad user experience. I'd rather not engage with this SharedWorkers at all and just wait for Emscripten to provide a filesystem backend that we could safely read and write in multiple web workers. Then we could keep running multiple independent web workers without overwriting each other's data
changed the title [-]Run the same WordPress instance across many browser tabs[/-][+]Run the same WordPress instance across many browser tabs (SharedWorker? Shared FS?)[/+]on Oct 10, 2024
Activity
[-][Browser] Run the same WordPress instance across many browser tabs[/-][+]Run the same WordPress instance across many browser tabs[/+]eliot-akira commentedon Jul 18, 2024
A recent article describes how Notion used
SharedWorkerto share an SQLite database in OPFS across multiple browser tabs.How we sped up Notion in the browser with WASM SQLite
The idea was earlier explored in detail in
wa-sqlite.It's basically how you imagined in this comment.
[UX] Stored Playgrounds (no more data loss), multiple Playgrounds, UI…
adamziel commentedon Oct 5, 2024
I've explored using SharedWorkers and learned this:
A SharedWorker would introduce coupling between Playground deployments.
Imagine visiting playground.wordpress.net, opening a site, and implicitly starting a SharedWorker. Then a new webapp version is deployed. Then you open new tab and go there. Now we have a few choices:
The solutions are either complex or a bad user experience. I'd rather not engage with this SharedWorkers at all and just wait for Emscripten to provide a filesystem backend that we could safely read and write in multiple web workers. Then we could keep running multiple independent web workers without overwriting each other's data
[-]Run the same WordPress instance across many browser tabs[/-][+]Run the same WordPress instance across many browser tabs (SharedWorker? Shared FS?)[/+]