Skip to content
rest-rpc
Esc
↑↓navigate↵open⌘Jpreview
On this page

v0.2.0

core:

  • InferClientRequest, InferClientResponse, InferClientError, and InferClientStreamData accept the type of a client route function or client tree, such as typeof client.todos.get, in addition to routes. Request types inferred from a client already make headers that its globalHeaders provides optional. (36640ac)

core, server:

  • Add cookies to respond() options, middleware responses and thrown errors. Each value is sent as its own Set-Cookie header. Fetch client results and RouteErrors have the received values as cookies instead of a joined set-cookie header. Browsers hide Set-Cookie from fetch, so cookies is empty there. (a3b6a2a)

core, server:

  • Header names with uppercase letters are a type error in .headers(), response and error headers schemas, routeError() and respond() headers. Received header names are lowercase, so those names never matched: required request headers failed validation, optional ones were always undefined, and response headers were typed but missing on the client. globalHeaders and additionalHeaders are not checked. (a3b6a2a)

core, server:

  • Path params are written only as :name. {name} segments are no longer params, and the paramSyntax compile option is removed: compiled paths keep :name, and OpenAPI documents still use {name}. (9a1a7da)

core, server, tanstack-query:

  • Client calls may omit a query or headers object without required fields, a body whose schema accepts undefined on routes with one body media type, and a request without required fields. Before, only headers could be omitted, and only inside a passed request. TanStack Query request options and the local client follow the same rules, and local calls receive an omitted query or headers as {}, as over HTTP. (0948a36)

server:

  • Add .static(value), which completes a route with the same response for every request, serialized once when the routes are compiled. Compiled Fetch routes have it as staticResponse, and App.routes entries are a function or that Response. (dfe3e97)

Last updated on

Was this page helpful?