Releases: middleapi/orpc
Releases · middleapi/orpc
v1.13.7
v1.13.6
🐞 Bug Fixes
- client, server: Prototype Pollution via
StandardRPCJsonSerializerDeserialization (GHSA-m272-9rp6-32mc)
View changes on GitHub
v1.13.5
v1.13.4
🐞 Bug Fixes
View changes on GitHub
v1.13.2
v1.13.1
🚀 Features
- nest, contract: Prefer import populateContractRouterPaths from
@orpc/contract- by @dinwwwh in #1312 (544b9)
View changes on GitHub
v1.13.0
Smart Coercion now stable docs
Automatically converts input values to match schema types without manually defining coercion logic.
import { OpenAPIHandler } from '@orpc/openapi/fetch'
import { SmartCoercionPlugin } from '@orpc/json-schema'
const handler = new OpenAPIHandler(router, {
plugins: [
new SmartCoercionPlugin({
schemaConverters: [
new ZodToJsonSchemaConverter(),
// Add other schema converters as needed
],
})
]
})Rethrow handler plugin docs
The RethrowHandlerPlugin allows you to catch and rethrow specific errors that occur during request handling. This is particularly useful when your framework has its own error handling mechanism (e.g., global exception filters in NestJS, error middleware in Express) and you want certain errors to be processed by that mechanism instead of being handled by the oRPC error handling flow.
import {
experimental_RethrowHandlerPlugin as RethrowHandlerPlugin,
} from '@orpc/server/plugins'
const handler = new RPCHandler(router, {
plugins: [
new RethrowHandlerPlugin({
// Decide which errors should be rethrown.
filter: (error) => {
// Example: Rethrow all non-ORPCError errors
// This allows unhandled exceptions to bubble up to your framework
return !(error instanceof ORPCError)
},
}),
],
}).$input now available in contract builder docs
Unlike .input, the .$input method lets you redefine the input schema after its initial configuration. This is useful when you need to enforce a void input when no .input is specified.
const base = os.$input(z.void())
const base = os.$input<Schema<void, unknown>>()🚀 Features
- json-schema: Stable SmartCoercionPlugin - by @dinwwwh in #1285 (f01f7)
- server: Rethrow handler plugin - by @dinwwwh in #1286 (b2d00)
🐞 Bug Fixes
View changes on GitHub
v1.12.3
🐞 Bug Fixes
- standard-server: Change SHORTABLE_ORIGIN from orpc:// to http:// for Android WebView compatibility - by @Copilot in #1295 (d1259)
View changes on GitHub
v1.12.2
🐞 Bug Fixes
- standard-server: Filter out undefined headers for node:http adapters compatibility - by @dinwwwh in #1269 (c994d)