create-t3-app icon indicating copy to clipboard operation
create-t3-app copied to clipboard

feat: Add oRPC support

Open MaKTaiL opened this issue 8 months ago • 5 comments

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-experimental provider which allows automatic prefetching when using useSuspenseQuery on Client components. (cleaner DX)
  • Replaced tRPC CLI boolean option with a new multiple-choice option:
    • None, tRPC and oRPC are available
    • oRPC is only available when selecting App Router
  • Feature Comparison with tRPC: oRPC Docs

Screenshots

App Router:

image

Pages Router:

image

💯

MaKTaiL avatar Apr 08 '25 20:04 MaKTaiL

🦋 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

changeset-bot[bot] avatar Apr 08 '25 20:04 changeset-bot[bot]

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

vercel[bot] avatar Apr 08 '25 20:04 vercel[bot]

All tests completed successfully, finally! 🙏 All good for review @juliusmarminge, let me know if you have any questions.

MaKTaiL avatar Apr 11 '25 16:04 MaKTaiL

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.

bohdancho avatar May 07 '25 12:05 bohdancho

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 #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.

TRPC will have to be updated first before we can merge both. This could be handled in a different PR when the time comes.

MaKTaiL avatar May 13 '25 22:05 MaKTaiL