←back to thread

Learn Yjs Interactively

(learn.yjs.dev)
296 points paulgb | 3 comments | | HN request time: 0.629s | source
Show context
jakelazaroff ◴[] No.42731601[source]
Hey HN! I'm the developer at Jamsocket who made this. In case you're not familiar with Yjs, it's a CRDT library for building collaborative and local-first apps.

The thing is, if you're not used to working with distributed state there's definitely a learning curve. Even simple things like incrementing a counter — the "hello world" of JavaScript framework demos — get tricky when dealing with multiple clients. Worse, a lot of tutorials are just like "install this library and text editor integration and boom you have an app", which doesn't give you a good mental model for what's actually happening.

So we made Learn Yjs! It's an interactive Yjs tutorial. I wanted it to be really intuitive for people just getting their feet wet with local-first development, so there are lots of explorable demos and coding exercises. The idea is to use interactive examples to build an understanding from the ground up.

Hope you like it :)

replies(4): >>42732669 #>>42733533 #>>42734849 #>>42734940 #
1. KaiMagnus ◴[] No.42734940[source]
> "install this library and text editor integration and boom you have an app", which doesn't give you a good mental model for what's actually happening.

I was interested in working with CRDTs and collaboration in general for a while now and this has been the biggest issue whenever I tried to get into it. Websockets also seem a bit harder to find (free) hosting for.

Btw, your other tutorials on CRDTs were also a great help.

replies(2): >>42739361 #>>42739499 #
2. Imustaskforhelp ◴[] No.42739361[source]
Cloudflare workers can host soketi which is websocket.
3. jakelazaroff ◴[] No.42739499[source]
Thank you!

As far as websocket hosting, there are a few services out there. We offer a pretty generous free tier for Y-Sweet [1] with 10GB of storage. There's also PartyKit and Liveblocks, though I'm not sure what their pricing is like.

[1] https://jamsocket.com/y-sweet#y-sweet-pricing