v11.0.0
Breaking Changes📦 trpcView on GitHub →
⚠ 4 breaking✨ 4 features🐛 3 fixes⚡ 1 deprecations🔧 6 symbols
Summary
tRPC v11 introduces significant performance optimizations, improved Next.js App Router support, and raises the minimum requirements for Node.js and TypeScript.
⚠️ Breaking Changes
- The minimum supported TypeScript version is now 5.1.0.
- The minimum supported Node.js version is now 18.x.
- The 'superjson' and 'transformer' configurations have been updated to require explicit imports in some environments to reduce bundle size.
- Internal types have been restructured; custom middleware that relied on private tRPC types may need updates.
Migration Steps
- Run 'npm install @trpc/server@latest @trpc/client@latest @trpc/react-query@latest @trpc/next@latest'.
- Check for any usage of 'router.interop()' and migrate to standard router definitions.
- Update transformer configurations if using 'superjson' to ensure compatibility with the new peer dependency requirements.
✨ New Features
- Introduced 'experimental_trpcNext' for improved Next.js App Router integration.
- Added support for Subscription 'emit' patterns in server-side calls.
- Enhanced type inference for complex nested routers.
- Improved performance for large-scale router definitions by optimizing type checking.
🐛 Bug Fixes
- Fixed an issue where batching would fail if one request in the batch had a malformed header.
- Resolved a race condition in the observable-based subscription client.
- Fixed type-narrowing issues when using 'input' in middleware chains.
🔧 Affected Symbols
initTRPCcreateTRPCNextrouter.interopTRPCClientErrorhttpBatchLinktransformer⚡ Deprecations
- Deprecated the use of 'router.interop()' for migrating from v9 to v10; users should now be fully on the v10+ router pattern.