v0.2.0
core:
InferClientRequest,InferClientResponse,InferClientError, andInferClientStreamDataaccept the type of a client route function or client tree, such astypeof client.todos.get, in addition to routes. Request types inferred from a client already make headers that itsglobalHeadersprovides optional. (36640ac)
core, server:
- Add
cookiestorespond()options, middleware responses and thrown errors. Each value is sent as its ownSet-Cookieheader. Fetch client results andRouteErrors have the received values ascookiesinstead of a joinedset-cookieheader. Browsers hideSet-Cookiefromfetch, socookiesis empty there. (a3b6a2a)
core, server:
- Header names with uppercase letters are a type error in
.headers(), response and errorheadersschemas,routeError()andrespond()headers. Received header names are lowercase, so those names never matched: required request headers failed validation, optional ones were alwaysundefined, and response headers were typed but missing on the client.globalHeadersandadditionalHeadersare not checked. (a3b6a2a)
core, server:
- Path params are written only as
:name.{name}segments are no longer params, and theparamSyntaxcompile option is removed: compiled paths keep:name, and OpenAPI documents still use{name}. (9a1a7da)
core, server, tanstack-query:
- Client calls may omit a
queryorheadersobject without required fields, abodywhose schema acceptsundefinedon 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 Queryrequestoptions and the local client follow the same rules, and local calls receive an omittedqueryorheadersas{}, 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 asstaticResponse, andApp.routesentries are a function or thatResponse. (dfe3e97)