As detailed elsewhere, I am running into issues syncing a slider between notebooks.
While my Stackblitz example demonstrates how a shared slider using yJs can sync seamlessly between multiple clients (open the link in two tabs, side-by-side), a similar implementation on Observable runs into one big issue: the first client’s state is overwritten as soon as a second client interacts with the shared slider.
- Open Yjs / Ymap on Observable / dleeftink / Observable in two tabs, side-by-side (EDIT: Here is a notebook mirroring the Stackblitz example 1:1)
- Interact with the slider on the first tab (second tab updates fine), then the second (first tab state is overwritten)
- E.g. observe how the
sliderState
becomesundefined
after interacting with it in the second tab.
- E.g. observe how the
As this implementation works fine on Stackblitz, I am wondering whether the Observable runtime prevents third-party libraries to access websockets/webworkers across domains (e.g. cross scripting between user.static.observableusercontent.com/next/worker.html and observablehq.com) or that other CORS issues prevent yJs from functioning.
Maybe someone can shed some light on whether Observable’s sandboxing prevents libraries like yJs to communicate between clients?