feat: Add oRPC support
Closes #
✅ Checklist
- [x] I have followed every step in the contributing guide (updated 2022-10-06).
- [x] The PR title follows the convention we established conventional-commit
- [x] I performed a functional test on my final commit
Changelog
- Added oRPC support (App Router only)
- Included support for
@tanstack/react-query-next-experimentalprovider which allows automatic prefetching when using useSuspenseQuery on Client components. (cleaner DX) - Replaced tRPC CLI boolean option with a new multiple-choice option:
None,tRPCandoRPCare availableoRPCis only available when selecting App Router
- Feature Comparison with tRPC: oRPC Docs
Screenshots
App Router:
Pages Router:
💯
🦋 Changeset detected
Latest commit: eb5950719c3ba8b565d5b2b8c4b7938c471078f2
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| create-t3-app | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| create-t3-app | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 29, 2025 10:39pm |
All tests completed successfully, finally! 🙏 All good for review @juliusmarminge, let me know if you have any questions.
Suggestion: would it maybe make sense to unify trpc and orpc templates so that we don't need extra templates for non-rpc specific pages like layout.tsx, page.tsx, _component/post.tsx etc? oRPC's API is very similar to that of tRPC in the new React Query integration. But we would have to wait for https://github.com/t3-oss/create-t3-app/issues/2065.
We would then import the api hook like
import { useRPC } from "~/rpc/context";
instead of
import { useORPC } from "~/orpc/context";
and
import { useTRPC } from "~/trpc/context";.
Or event useApi for consistency with api server-side caller.
Suggestion: would it maybe make sense to unify trpc and orpc templates so that we don't need extra templates for non-rpc specific pages like
layout.tsx,page.tsx,_component/post.tsxetc? oRPC's API is very similar to that of tRPC in the new React Query integration. But we would have to wait for #2065.We would then import the api hook like
import { useRPC } from "~/rpc/context";instead ofimport { useORPC } from "~/orpc/context";andimport { useTRPC } from "~/trpc/context";. Or eventuseApifor consistency withapiserver-side caller.
TRPC will have to be updated first before we can merge both. This could be handled in a different PR when the time comes.