
I've built a new personal website! → chrisnicholas.dev/blog/a-new…

Developer experience @liveblocks • Interactive articles on chrisnicholas.dev 🌱

I've built a new personal website! → chrisnicholas.dev/blog/a-new…

It works by: 1️⃣ Scanning your project for multiplayer ideas. 2️⃣ Letting you choose which parts to set up. 3️⃣ Reading relevant get started guides—there's 77. 4️⃣ Setting up @liveblocks and linking to a free API key. 5️⃣ Done!

New skill: /𝚖𝚊𝚔𝚎-𝚖𝚞𝚕𝚝𝚒𝚙𝚕𝚊𝚢𝚎𝚛 Run it on your app and it'll turn it into real-time project, with collaborative editing, cursors, avatars, more! $ npx skills add ctnicholas/skills

It needs no database, and everything works on the @liveblocks free plan. Hook in your app's auth system, and you're good to go.

Set up your own Slack for free! My open source demo features real-time messages, threads, reactions, DMs, notifications, statuses, and multiple workspaces. → lblcks.io/WQVfKMQ

Tech stack for this app is… ✦ @nextjs ✦ @vercel ✦ @tldraw ✦ @liveblocks ✦ @tiptap_editor
I've set up a multiplayer language learning app! You can annotate PDFs, and everything updates in realtime with @liveblocks. Plus, talk to your student, or your AI assistant, which can generate documents for you! It's free → lblcks.io/KURe1NG

I'm using tldraw for the annotations, a truly fantastic canvas. tldraw.dev

I've set up a multiplayer language learning app! You can annotate PDFs, and everything updates in realtime with @liveblocks. Plus, talk to your student, or your AI assistant, which can generate documents for you! It's free → lblcks.io/KURe1NG

@nvie and I turned this into an interactive deep-dive, with every demo from this thread and a few more. Have a play! lblcks.io/W1Ehpn6

You don't need to build any of this yourself. It's all baked into `LiveList`, the realtime array in @liveblocks Storage, ready for JavaScript and React. Servers, connections, syncing, conflict resolution—handled for you. The issue tracker below runs on it.

Final trick: ditch decimal for base 96. That's every printable ASCII character, so indices look like !, % or ). Plain string comparison sorts them, and the extra characters fit between decimal digits. Same precision, much shorter indices.

Pushing to the end is the most common list operation, so in real apps indices can grow longer than the data they're ordering. Our fix is viewport-based growth: when the last index runs out of room, add 3 digits at once, then add to the last one. 0.8 → 0.9 → 0.9001 → 0.9002

Real decimals have a catch too. Keep adding to the end of a list and floating point precision gives out after around 50 inserts—watch it break below. Switching to strings removes the limit, but creates a new issue: indices get longer and longer.

If Alice and Bob happen to choose the identical index, say `0.75`, there's no way to agree which comes first. So each user gets a unique ID that's tacked onto the end. Alice writes `0.75-001`, Bob writes `0.75-002`, and the tie disappears.

Using this method, every change affects only one index, so other items don't get renumbered. Alice and Bob can add, remove, and move items simultaneously, and both lists settle on the same order. Nothing cascades, nothing conflicts. Well, almost ↓

Fractional indexing turns this around. Rather than deriving an index from position, every item stores its own—picture it as a decimal between `0` and `1`. New item between `0.1` and `0.5`? Use the midpoint, `0.3`. Then between `0.1` and `0.3`, `0.2`. You never run out of space.