v0.5.0
core:
- Show a client call’s resolved response, such as
{ status: 200; body: Post; ... }, on hover in editors instead of an internalClientResponseEntrytype. (34a29eb)
core, server:
- Export the built-in body codecs from
@rest-rpc/coreand@rest-rpc/serverasjsonCodec,urlEncodedCodec,formDataCodec,textCodecandbinaryCodec, so a custom codec can call one for the values it doesn’t handle. Their operations are both defined and typed with what they return, such asPromise<FormData>fromformDataCodec.deserialize(). (3d6507c)
server:
- Accept handlers that only throw, such as a stub that throws a defined
NOT_IMPLEMENTEDerror, without a return type annotation. (d3b9f08)
server:
- Re-export the rest of
@rest-rpc/coreexceptroutefrom@rest-rpc/server, so server code and its tests import only@rest-rpc/server:clientInterceptor(),extractContract()and theAbsolutePath,ApiClientFor,ApiClientRouteValue,BodyDeserializer,BodySerializer,BuiltInBodyCodec,ClientHeaders,ClientInterceptor,Contract,FetchLike,FetchOptions,IncomingBody,InferClientStreamData,ResponseOptions,RouteDefinitionandSseResponsetypes. (5deb097)
server:
- Remove
createLocalClient()and theLocalClienttype. To call an app in process with the same behavior as over HTTP, such as in tests, pass itsfetchtocreateClient(routes, { fetch: app.fetch }).createClientandApiClientOptionsare now exported from@rest-rpc/servertoo. To call one route without HTTP, usecall(). (99c0b66)
server:
- Run interceptors for
OPTIONSrequests toapp.routes, asapp.fetchdoes, so an interceptor answers CORS preflights when Bun servesapp.routeswithoutapp.fetch. Bun answered them with its own404before. A preflight no interceptor answers is sentNOT_FOUND. (b38ff78)