Repository navigation
v0.6.0
core, server:
- Custom codecs take precedence over the built-in ones for every media type they match, patterns included. A codec such as
bodyCodec(/.*/, ...)now also handlesapplication/json,application/x-www-form-urlencodedandmultipart/form-data, which used to stay with the built-in codecs because they list them as strings. Within the custom codecs, a media type listed as a string is still selected before patterns. (bddf9bc)
core, server:
- Rename the client types to match the other
Clienttypes:ApiClientForis nowClientFor,ApiClientOptionsis nowCreateClientOptions, andApiClientRouteValueis nowClientRouteValue. (f150152)
core, server:
- Server-Sent Events and error responses never use body codecs, on either side. The server writes event streams without passing them through the codecs, and the client reads error bodies with the built-in codecs only, so a custom codec that matches
application/json, such as a catch-all pattern, no longer breaks defined errors. (bddf9bc)
core, server:
- Throw
BodySerializationErrorfrom the built-in codecs'serializefor a value they don't encode. It extendsTypeErrorand carries themediaTypethe value was serialized for, the value kinds the codecexpected, and the kind of value itreceived. The JSON codec still throws the errors ofJSON.stringify. (bddf9bc)
server:
- Accept
FormDatarequest bodies without a declared content type. A route whose headers schema declares nocontent-typenow decodesmultipart/form-dataas well as JSON, soroute.body(type<FormData>())works with a client that sendsFormDataand nocontent-typeheader, which Fetch sets with the generated boundary. Such routes no longer answer multipart requests with415, so a route that shouldn't takeFormDatarejects it with its body schema. (0e5ba74)
tanstack-query:
- Add a
fetchfunction to each route's TanStack Query utils that calls the underlying client route directly (aae3fd4)