JavaScript client guide#
This page is not written yet
This page is a stub. It lists what it will cover and the source material.
Content is written after the v1.0 tag.
What belongs on this page#
The browser client. Cover WebSocket binary frames, the subprotocol, CBOR in the browser, and the prohibition on optimistic interface state.
Source material: clients/js/, this repo's own v1.0 reference
implementation (see the Quickstart for a
worked example), and tools/valence_probe.py for wire parity.
DEMO-CANDIDATE: a live connect-and-subscribe walkthrough in the browser, HELLO to rendered STATE, one frame at a time.
Common outline#
Every client guide covers these seven steps in this order.
- Open the transport and complete the handshake.
- Handle the catalog: fetch, cache by etag, or pin it.
- Pass the ready gate.
- Adopt retained STATE before rendering anything.
- Send an intent and render the echo, never the request.
- Keep the session alive, and honor the deadman if you own a source.
- Handle NACKs, including the range fallback for a code you do not know.
Where to go next#
- Quickstart: a worked example, end to end.
- Plugin guide: wiring a client into a host application.
- CLI guide: graph the motion your client produced.