Skip to Content
Changelogv0.1.0

v0.1.0

Initial release.

Protocol

  • Four patch operations: add, append, insert, complete
  • complete patches 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 \uXXXX unicode escape decoding including surrogate pairs across token boundaries
  • pendingEscape flag handles backslashes split across token boundaries
  • Stack entries carry accumulated values for complete patch snapshots
  • completions option (default true) — set false to suppress completion patches
  • root option 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
  • StreamingChunk dataclass with to_json(), from_json(), and replace()
  • FastAPI and Flask examples included

Collector

  • Reconstructs the object from patches via setPath / getPath
  • pathstart event — fires once per path on first add/insert
  • pathcomplete event — fires on complete patches, value is the assembled snapshot
  • change event — fires on every data patch with current partial state
  • complete event — 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 instance
  • onChange, onPathStart, onPathComplete, onComplete, onError callbacks as stable refs
  • status: 'idle' | 'streaming' | 'complete' | 'error'
  • consume, complete, reset for transport wiring
Last updated on