-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: align trpc usage to official docs #581
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: a77fe75 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://create-t3-app-git-julius-trpc-procs-t3-oss.vercel.app/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd lean towards leaving it as is, mostly for the sake of keeping things consistent with the tRPC docs. The namespace collision of having just t
can be fixed by the user by exporting initTRPC.context
as any other name.
This is now the recommended way of doing things: https://trpc.io/docs/v10/nextjs#3-create-a-trpc-router |
Can I also review 🥺 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love importing the types directly instead of an object that has them.
Still getting used to getting rid of t
in application code - I feel like using t.procedure
etc in makes it very easy to see that the "base" version is being used. But we should go with tRPC docs over my opinions :)
Your review was still active 🤪 |
Closes #
✅ Checklist
Changelog
t
is often used for translation stuff so importing it as your trpc object may feel weird. This is another way of using trpc v10 in that we define all our "base"-procedures and stuff in one file and import those, instead of the entiret
-object.Goes inline with the authedProcedure too btw.
Leave your thoughts, I'm just putting it out there. Happy to close if y'all don't like it.
Screenshots
[Screenshots]
💯