v0.1.0
Initial release.
Protocol
- Four patch operations:
add,append,insert,complete completepatches carry the fully assembled value snapshot at that path- Dot-notation paths with array indices:
sections[0].heading - Numbers, booleans, and null are always atomic — never emitted partially
Emitter (Node)
- Single-pass FSM parser — no quadratic reparse, no buffering the full response
- Offset-based buffer scanning — plain string characters batched into one patch per token
- Full
\uXXXXunicode escape decoding including surrogate pairs across token boundaries pendingEscapeflag handles backslashes split across token boundaries- Stack entries carry accumulated values for
completepatch snapshots completionsoption (defaulttrue) — setfalseto suppress completion patchesrootoption namespaces all emitted paths- Middleware chain on the server side
Emitter (Python)
- Full FSM implementation mirroring the Node Emitter
- Identical wire semantics — patches from Python and Node are interchangeable
StreamingChunkdataclass withto_json(),from_json(), andreplace()- FastAPI and Flask examples included
Collector
- Reconstructs the object from patches via
setPath/getPath pathstartevent — fires once per path on firstadd/insertpathcompleteevent — fires oncompletepatches, value is the assembled snapshotchangeevent — fires on every data patch with current partial statecompleteevent — fires when stream ends with fully assembled object- Middleware chain on the client side
reset()preserves middleware and listeners, clears state and seen paths
React hook
useJsonCurrent<T>()wrapping a Collector instanceonChange,onPathStart,onPathComplete,onComplete,onErrorcallbacks as stable refsstatus:'idle' | 'streaming' | 'complete' | 'error'consume,complete,resetfor transport wiring
Last updated on