The Commons

shared-state rooms · exhibit 01

The Commons

One pixel board for everyone who opens this page. Live cursors, a shared canvas, no backend, no signup. Paint something — it stays for whoever wanders in next.

🦊
you are
…

minted for this visit — refresh and you're someone new

the board · 64 × 36 · one shared blob waking the room…
your brush
painting vermilion

drag to paint · right-click or long-press sips a color · arrow keys + enter work too

room version
—

ticks on every accepted write — the heartbeat of the room

connectionconnecting
here now1
pixels ever placed0
your writes this minute0/26
merges witnessed0

waking the room…

01

How this works

There is no server behind this page — nothing deployed, no database of your own, no accounts. The Commons is one HTML file, and everything moving on it travels through two primitives every published 23artifacts page gets for free: the room, and its live event stream.

1

One room per artifact

A room is a single JSON document — capped at 256 KB — that lives with the artifact itself. Every pixel on this board is that one document; cursors moved out to their own ephemeral channel. It's on version — right now.

2

Compare-and-swap writes

No locks. A writer sends the whole new state and names the version it built on. If someone else got there first, the write bounces with a 409, the client folds the newer state into its own, and tries again — you've watched 0 of those merges from this chair. The blob is the durable truth: wet paint only ever previews it, and the version that confirms a cell is what dries it. A write carries nothing but paint: 0/26.

3

Presence carries the wet paint

The page opens one EventSource: version pings land the instant anyone writes — small boards now arrive inline on the ping, no follow-up fetch — and presence diffs tick every 100 ms. Your cursor lives on the whole page, not just the board: it goes up as a tiny POST naming the section under it, positioned within that section — so a phone and a desktop see each other in the right place even though the layout reflows. Your latest unconfirmed pixels ride along with it (60 at most), so a stroke shows on every screen in about 130 ms as translucent wet paint. It's a preview, not a promise: presence lives in server memory for 12 seconds, never on disk — close the tab mid-stroke and your wet paint evaporates with you.

4

Polling is the fallback

If the stream can't open — an older server, a room switched off — the page quietly falls back to the loop it started life with: refetch the room every 2.5 s and replay recorded cursor trails between polls. Wet paint needs the stream, so here strokes simply arrive already settled, at poll speed. Same board, same writes, just a beat slower. The pill above the board tells you which world you're in.

02

How far does this scale

Honest numbers. A canvas that seats a small crowd of strangers on zero infrastructure is exactly the point.

100–200

people live in the room at once — past that the server starts easing new connections off, and the cap is a hard 200.

≈130 ms

from your cursor — or your brushstroke, as wet paint — to every other screen: a 100 ms tick plus the wire. Durable settlement follows within seconds.

≈ free

watching costs one idle stream and a heartbeat every 20 s — reads are cheap, lurkers welcome.

forever

the room belongs to the artifact, not the version — the board outlives every republish. Presence doesn't, on purpose.

Those are design decisions, not apologies. Ephemeral presence over one event stream, durable pixels through compare-and-swap on one blob — and when the stream isn't there, the page degrades to polite polling instead of breaking. That trade buys something rarer than throughput: multiplayer with nothing to deploy, patch, or pay for. If you need thousands of concurrent editors, you need a real backend — and this page is proudly not one.