Skip to content

Update orpc dependencies to v1.12.1#137

Closed
renovate[bot] wants to merge 1 commit into
depsfrom
renovate/orpc
Closed

Update orpc dependencies to v1.12.1#137
renovate[bot] wants to merge 1 commit into
depsfrom
renovate/orpc

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Jul 11, 2025

This PR contains the following updates:

Package Change Age Confidence
@orpc/contract (source) 1.10.0 -> 1.12.1 age confidence
@orpc/server (source) 1.10.0 -> 1.12.1 age confidence

Release Notes

unnoq/orpc (@​orpc/contract)

v1.12.1

Compare Source

   🚀 Features
    View changes on GitHub

v1.12.0

Compare Source

Tanstack Query Default Options docs

You can configure default options for all query/mutation utilities using experimental_defaults. These options are spread merged with user-provided options, allowing you to set defaults while still enabling customization on a per-call basis.

const orpc = createTanstackQueryUtils(client, {
  experimental_defaults: {
    planet: {
      find: {
        queryOptions: {
          staleTime: 60 * 1000, // 1 minute
          retry: 3,
        },
      },
      list: {
        infiniteOptions: {
          staleTime: 30 * 1000,
        },
      },
      create: {
        mutationOptions: {
          onSuccess: (output, input, _, ctx) => {
            ctx.client.invalidateQueries({ queryKey: orpc.planet.key() })
          },
        },
      },
    },
  },
})

// These will automatically use the default options
const query = useQuery(orpc.planet.find.queryOptions({ input: { id: 123 } }))
const mutation = useMutation(orpc.planet.create.mutationOptions())

// User-provided options override defaults
const customQuery = useQuery(orpc.planet.find.queryOptions({
  input: { id: 123 },
  staleTime: 0, // overrides the default
}))
Cloudflare Durable Object Publisher Adapter docs

Building real-time features on Cloudflare Workers has never been easier, thanks to our publisher helpers:

import { DurablePublisher, PublisherDurableObject } from '@​orpc/experimental-publisher-durable-object'

export class PublisherDO extends PublisherDurableObject {
  constructor(ctx: DurableObjectState, env: Env) {
    super(ctx, env, {
      resume: {
        retentionSeconds: 60 * 2, // Retain events for 2 minutes to support resume
      },
    })
  }
}

export default {
  async fetch(request, env) {
    const publisher = new DurablePublisher<{
      'something-updated': {
        id: string
      }
    }>(env.PUBLISHER_DO, {
      prefix: 'publisher1', // avoid conflict with other keys
      customJsonSerializers: [] // optional custom serializers
    })
  },
}

[!NOTE]
Full example at Cloudflare Worker Playground

NestJS Integration Upgraded docs

NestJS Integration now supports oRPC plugins, custom error responses, custom send-response behavior, and global context type-safe.

declare module '@&#8203;orpc/nest' {
  /**
   * Extend oRPC global context to make it type-safe inside your handlers/middlewares
   */
  interface ORPCGlobalContext {
    request: Request
  }
}

@&#8203;Module({
  imports: [
    ORPCModule.forRootAsync({ // or use .forRoot for static config
      useFactory: (request: Request) => ({
        interceptors: [
          onError((error) => {
            console.error(error)
          }),
        ],
        context: { request }, // oRPC context, accessible from middlewares, etc.
        eventIteratorKeepAliveInterval: 5000, // 5 seconds
        customJsonSerializers: [],
        plugins: [
          new SmartCoercionPlugin({
            schemaConverters: [
              new ZodToJsonSchemaConverter(),
            ],
          }),
        ], // almost oRPC plugins are compatible
      }),
      inject: [REQUEST],
    }),
  ],
  controllers: [AuthController, PlanetController, ReferenceController, OtherController],
  providers: [PlanetService, ReferenceService],
})
   🚀 Features
   🐞 Bug Fixes

[!TIP]
If you find oRPC valuable and would like to support its development, you can do so here.

    View changes on GitHub

v1.11.3

Compare Source

Cloudflare Worker Ratelimit Adapter docs

Adapter for Cloudflare Workers Ratelimit.

import { CloudflareRatelimiter } from '@&#8203;orpc/experimental-ratelimit/cloudflare-ratelimit'

export default {
  async fetch(request, env) {
    const limiter = new CloudflareRatelimiter(env.MY_RATE_LIMITER)

    return new Response(`Hello World!`)
  }
}
   🚀 Features
    View changes on GitHub

v1.11.2

Compare Source

   🚀 Features
  • standard-server: Send initial comment in event stream to flush response headers immediately  -  by @​unnoq in #​1204 (91ac3)
   🐞 Bug Fixes
    View changes on GitHub

[!TIP]
If you find oRPC valuable and would like to support its development, you can do so here.

v1.11.1

Compare Source

   🚀 Features

[!TIP]
If you find oRPC valuable and would like to support its development, you can do so here.

    View changes on GitHub

v1.11.0

Compare Source

Pino Logging Integration docs

Easy add structured logging, request tracking, and error monitoring to your oRPC powered by Pino

const logger = pino()

const handler = new RPCHandler(router, {
  plugins: [
    new LoggingHandlerPlugin({
      logger, // Custom logger instance
      generateId: ({ request }) => crypto.randomUUID(), // Custom ID generator
      logRequestResponse: true, // Log request start/end (disabled by default)
      logRequestAbort: true, // Log when requests are aborted (disabled by default)
    }),
  ],
})
Ratelimit Helpers docs

The Rate Limit package provides flexible rate limiting for oRPC with multiple storage backend support. It includes adapters for in-memory, Redis, and Upstash, along with middleware and plugin helpers for seamless integration.

Ratelimiter
const ratelimiter = new MemoryRatelimiter({
  maxRequests: 10,
  window: 60000,
})
Manually usage
const result = await limiter.limit('user:123')

if (!result.success) {
  throw new ORPCError('TOO_MANY_REQUESTS', {
    data: {
      limit: result.limit,
      remaining: result.remaining,
      reset: result.reset,
    },
  })
}
Built-in middleware
const loginProcedure = os
  .$context<{ ratelimiter: Ratelimiter }>()
  .input(z.object({ email: z.email() }))
  .use(
    createRatelimitMiddleware({
      limiter: ({ context }) => context.ratelimiter,
      key: ({ context }, input) => `login:${input.email}`,
    }),
  )
  .handler(({ input }) => {
    return { success: true }
  })

const result = await call(
  loginProcedure,
  { email: 'user@example.com' },
  { context: { ratelimiter } }
)
Response Header Plugin
import { RatelimitHandlerPlugin } from '@&#8203;orpc/experimental-ratelimit'

const handler = new RPCHandler(router, {
  plugins: [
    new RatelimitHandlerPlugin(),
  ],
})
Retry After Plugin docs

The Retry After Plugin automatically retries requests based on server Retry-After headers. This is particularly useful for handling rate limiting and temporary server unavailability.

import { RetryAfterPlugin } from '@&#8203;orpc/client/plugins'

const link = new RPCLink({
  url: 'http://localhost:3000/rpc',
  plugins: [
    new RetryAfterPlugin({
      condition: (response, options) => {
        // Override condition to determine if a request should be retried
        return response.status === 429 || response.status === 503
      },
      maxAttempts: 5, // Maximum retry attempts
      timeout: 5 * 60 * 1000, // Maximum time to spend retrying (ms)
    }),
  ],
})
Expand support union/interaction in openapi generator

Now you can use union/interaction for define params, query, headers, ...

const procedure = os
   .route({ path: '/{type}' })
   .input(z.discriminatedUnion('type', [
      z.object({
        type: z.literal("a"),
        foo: z.number().int().positive(),
      }),
      z.object({
        type: z.literal("b"),
        foo: z.number().int().negative(),
      }),
    ]))
   🚀 Features

[!TIP]
If you find oRPC valuable and would like to support its development, you can do so here.

    View changes on GitHub

v1.10.4

Compare Source

   🚀 Features
  • ai-sdk: Disable validation at oRPC level in createTool to avoid double validation  -  by @​unnoq in #​1166 (3bec7)
    View changes on GitHub

v1.10.3

Compare Source

AI SDK implementTool & createTool helpers

Implement/Convert a procedure/contract -> AI SDK Tool

const getWeatherTool = implementTool(getWeatherContract, {
  execute: async ({ location }) => ({
    location,
    temperature: 72 + Math.floor(Math.random() * 21) - 10,
  }),
})

const getWeatherTool = createTool(getWeatherProcedure, {
  context: {}, // provide initial context if needed
})
   🚀 Features
   🐞 Bug Fixes
    View changes on GitHub

v1.10.2

Compare Source

OpenAPI - custom error format docs

By default, OpenAPIHandler, OpenAPIGenerator, and OpenAPILink share the same error response format. You can customize one, some, or all of them based on your requirements.

const handler = new OpenAPIHandler(router, {
  customErrorResponseBodyEncoder(error) {
    return error.toJSON()
  },
})
Native Fastify adapter docs

Previously, oRPC in Fastify used the Node adapter, which didn't integrate well with Fastify's ecosystem (e.g., cookies, helpers, middleware). This native adapter supports Fastify's request/reply APIs directly, enabling full access to Fastify features within oRPC.

import Fastify from 'fastify'
import { RPCHandler } from '@&#8203;orpc/server/fastify'
import { onError } from '@&#8203;orpc/server'

const handler = new RPCHandler(router, {
  interceptors: [
    onError((error) => {
      console.error(error)
    })
  ]
})

const fastify = Fastify()

fastify.addContentTypeParser('*', (request, payload, done) => {
  // Fully utilize oRPC feature by allowing any content type
  // And let oRPC parse the body manually by passing `undefined`
  done(null, undefined)
})

fastify.all('/rpc/*', async (req, reply) => {
  const { matched } = await handler.handle(req, reply, {
    prefix: '/rpc',
    context: {} // Provide initial context if needed
  })

  if (!matched) {
    reply.status(404).send('Not found')
  }
})

fastify.listen({ port: 3000 }).then(() => console.log('Server running on http://localhost:3000'))
   🚀 Features

[!TIP]
If you find oRPC valuable and would like to support its development, you can do so here.

    View changes on GitHub

v1.10.1

Compare Source

Message port transfer docs

By default, oRPC serializes request/response messages to string/binary data before sending over message port. If needed, you can define the transfer option to utilize full power of MessagePort: postMessage() method, such as transferring ownership of objects to the other side or support unserializable objects like OffscreenCanvas.

const handler = new RPCHandler(router, {
  experimental_transfer: (message, port) => {
    const transfer = deepFindTransferableObjects(message) // implement your own logic
    return transfer.length ? transfer : null // only enable when needed
  }
})
   🚀 Features

[!TIP]
If you find oRPC valuable and would like to support its development, you can do so here.

    View changes on GitHub

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Jul 11, 2025

Branch automerge failure

This PR was configured for branch automerge. However, this is not possible, so it has been raised as a PR instead.


  • Branch has one or more failed status checks

@renovate renovate Bot force-pushed the renovate/orpc branch from 4e84b9e to 9238cb2 Compare July 14, 2025 17:12
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.6.8 chore(deps): update orpc dependencies to v1.7.0 Jul 14, 2025
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jul 14, 2025

Open in StackBlitz

npm i https://pkg.pr.new/mmkal/trpc-cli@137

commit: 101c956

@renovate renovate Bot force-pushed the renovate/orpc branch 3 times, most recently from 6ed6b6f to d52e591 Compare July 15, 2025 03:23
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.7.0 chore(deps): update orpc dependencies to v1.7.1 Jul 15, 2025
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.7.1 chore(deps): update orpc dependencies to v1.7.2 Jul 16, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch from d52e591 to 55afff5 Compare July 16, 2025 11:36
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.7.2 chore(deps): update orpc dependencies to v1.7.4 Jul 18, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch from 55afff5 to 66556b4 Compare July 18, 2025 13:41
@renovate renovate Bot force-pushed the renovate/orpc branch 2 times, most recently from bef8608 to 9dc342c Compare July 26, 2025 12:44
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.7.4 chore(deps): update orpc dependencies to v1.7.5 Jul 26, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch from 9dc342c to 77476e3 Compare July 29, 2025 08:43
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.7.5 Update orpc dependencies to v1.7.5 Jul 29, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch from 77476e3 to 1de96c7 Compare July 29, 2025 08:45
@renovate renovate Bot changed the title Update orpc dependencies to v1.7.5 Update orpc dependencies to v1.7.6 Jul 31, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch from 1de96c7 to 236d4df Compare July 31, 2025 11:52
@renovate renovate Bot changed the title Update orpc dependencies to v1.7.6 Update orpc dependencies to v1.7.7 Aug 1, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch 2 times, most recently from 085c880 to 6ddb119 Compare August 2, 2025 07:02
@renovate renovate Bot changed the title Update orpc dependencies to v1.7.7 Update orpc dependencies to v1.7.8 Aug 2, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.7.8 Update orpc dependencies to v1.7.9 Aug 3, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch 2 times, most recently from 988b359 to 962c1f2 Compare August 7, 2025 04:43
@renovate renovate Bot changed the title Update orpc dependencies to v1.7.9 Update orpc dependencies to v1.7.10 Aug 7, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.7.10 Update orpc dependencies to v1.7.11 Aug 8, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch from 962c1f2 to 1d1080a Compare August 8, 2025 15:49
@renovate renovate Bot changed the title Update orpc dependencies to v1.8.6 Update orpc dependencies to v1.8.7 Sep 8, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch 2 times, most recently from 6914a88 to 0329e6a Compare September 9, 2025 17:10
@renovate renovate Bot changed the title Update orpc dependencies to v1.8.7 chore(deps): update orpc dependencies to v1.8.7 Sep 9, 2025
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.8.7 Update orpc dependencies to v1.8.7 Sep 10, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.8.7 Update orpc dependencies to v1.8.8 Sep 11, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.8.8 Update orpc dependencies to v1.8.9 Sep 15, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.8.9 chore(deps): update orpc dependencies to v1.8.9 Sep 23, 2025
@renovate renovate Bot force-pushed the renovate/orpc branch 2 times, most recently from 88a6cf8 to 51c6941 Compare September 23, 2025 14:14
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.8.9 chore(deps): update orpc dependencies to v1.9.0 Sep 23, 2025
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.9.0 Update orpc dependencies to v1.9.0 Sep 23, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.9.0 chore(deps): update orpc dependencies to v1.9.0 Sep 25, 2025
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.9.0 chore(deps): update orpc dependencies to v1.9.1 Sep 26, 2025
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.9.1 Update orpc dependencies to v1.9.1 Sep 26, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.9.1 Update orpc dependencies to v1.9.2 Sep 29, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.9.2 Update orpc dependencies to v1.9.3 Oct 4, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.9.3 chore(deps): update orpc dependencies to v1.9.3 Oct 9, 2025
@renovate renovate Bot changed the title chore(deps): update orpc dependencies to v1.9.3 Update orpc dependencies to v1.9.3 Oct 9, 2025
@renovate renovate Bot changed the title Update orpc dependencies to v1.9.3 Update orpc dependencies to v1.9.4 Oct 14, 2025
@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Dec 1, 2025

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (1.12.1). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant