This is awesome to see. I have gotten interested in CRDTs in the last couple years due to them being used in the Elixir/Phoenix ecosystem. One question though, how do you integrate a backend into your library? I don't see anything mentioned in the docs.
Thanks! As it builds on Yjs (many kudos to Kevin Jahns for creating that awesome project + community), any backend that's compatible with Yjs works. The demos work based on WebRTC / BroadcastChannel (for the same browser / device), but I've listed different backends you can use here: https://syncedstore.org/docs/sync-providers
Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
11–20 of 27 posts
Re: Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
#12Wow this is so awesome! How/where does the data get saved for later? I'm guessing from the example, you don't need a database? E.g. I can just save the data to a document database, and next time someone works on it, just sync with the database? Or do I not need it at all because it's stored on the browser? And how would the information be associated with accounts, if someone wanted that feature? Also curious how/wher…
Re: Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
#13This is awesome to see. I have gotten interested in CRDTs in the last couple years due to them being used in the Elixir/Phoenix ecosystem. One question though, how do you integrate a backend into your library? I don't see anything mentioned in the docs.
$ npx @hocuspocus/cli
Re: Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
#14Wow this is so awesome! How/where does the data get saved for later? I'm guessing from the example, you don't need a database? E.g. I can just save the data to a document database, and next time someone works on it, just sync with the database? Or do I not need it at all because it's stored on the browser? And how would the information be associated with accounts, if someone wanted that feature? Also curious how/wher…
You can indeed store updates in a centralized database (wrapped with an API to handle auth / accounts) - this is probably the most common scenario.
But you can also go fully decentralized and use y-indexeddb to store updates in in the browser, and use a different transport to sync updates between users (e.g. webrtc).
—-
The cool thing is that the data model behind CRDTs is very flexible in this regard. All changes are captured in small “updates”, and as long as these updates at some point arrive at your device, your document can be updated with the changes (it’s eventually consistent).
The site runs on github pages without a backend (examples use y-webrtc).
Re: Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
#15FYI, the examples don't work for me in Brave browser on linux: React example: "/App.tsx: Cannot read property 'getItem' of null (2:0)" Vue example: "file:///src/store.ts: Cannot read property 'getItem' of null (1:0)" Works fine in Chromium and Firefox though, so not sure what's up.
https://brave.com/privacy-updates/7-ephemeral-storage/
Re: Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
#16Does it autoreconnet? On reconnection, does it sync back changes that happened on or since failure ? Can you notify the user when it's happening ?
Re: Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
#17Re: Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
#18Awesome! I assume you’ve been using this in another project? How did you handle/implement undo-redo?
Re: Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
#19How does the y-websocket handles network failure ? Does it autoreconnet? On reconnection, does it sync back changes that happened on or since failure ? Can you notify the user when it's happening ?
Re: Show HN: SyncedStore CRDT – build multiplayer collaborative apps for React / Vue
#20https://github.com/local-first-web/state
https://github.com/automerge/automerge
https://github.com/automerge/automerge-rs
By the way despite that particular repo (@localfirst/state) last being touched 6 months ago, Herb Caudill definitely seems still active in this space (I believe he's been working on other parts of this more recently -- e.g. ideas about authentication), and I think automerge development itself (Martin Kleppmann) is quite active right now leading up to a 1.0 release which seems fairly imminent, for which a lot of fundamental work has been done, also coordinating with automerge-rs.