Skip to content

v3.1.0

Choose a tag to compare

@aleclarson aleclarson released this 23 May 02:54
· 33 commits to main since this release

What's new

  • Added NDJSON response stream support via the new rouzer/ndjson subpath.
    • Define streamed responses with ndjson.$type<T>().
    • Register ndjson.routerPlugin with createRouter(...) and ndjson.clientPlugin with createClient(...).
    • Handlers can return Iterable<T> or AsyncIterable<T> values, which Rouzer serializes as application/x-ndjson.
    • Generated client action functions resolve to an AsyncIterable<T> parsed from the response body.
  • Added response plugin support for non-JSON response codecs, with fast failure when plugin-backed routes are used without the matching router/client plugin.
  • Added a runnable NDJSON streaming example: examples/ndjson-stream.ts.

Notes

  • Streamed NDJSON items are parsed as JSON but are not validated against a Zod schema.
  • NDJSON support is for response streams; request bodies continue to use the existing JSON body schema path.
  • Generated client action functions now follow the documented client.json(...) non-2xx error behavior.