Skip to content
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

Merged
merged 6 commits into from
Oct 10, 2022
Merged

Conversation

juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Oct 6, 2022

Closes #

✅ Checklist

  • I have followed every step in the contributing guide (updated 2022-10-06).
  • The PR title follows the convention we established conventional-commit
  • I performed a functional test on my final commit

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 entire t-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]

💯

@vercel
Copy link

vercel bot commented Oct 6, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
create-t3-app ✅ Ready (Inspect) Visit Preview Oct 10, 2022 at 3:28PM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2022

🦋 Changeset detected

Latest commit: a77fe75

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 Minor

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

@github-actions github-actions bot added 📌 area: cli Relates to the CLI 📌 area: t3-app Relates to the generated T3 App labels Oct 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 100
🟢 Accessibility 100
🟢 Best practices 93
🟠 SEO 86
🟠 PWA 54

Lighthouse ran on https://create-t3-app-git-julius-trpc-procs-t3-oss.vercel.app/

@juliusmarminge juliusmarminge changed the title feat: another one of using trpc v10 feat: another way of using trpc v10 Oct 6, 2022
Copy link
Member

@c-ehrlich c-ehrlich left a 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.

@juliusmarminge
Copy link
Member Author

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

@juliusmarminge juliusmarminge changed the title feat: another way of using trpc v10 feat: align trpc usage to official docs Oct 10, 2022
@nexxeln
Copy link
Member

nexxeln commented Oct 10, 2022

Can I also review 🥺

Copy link
Member

@c-ehrlich c-ehrlich left a 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 :)

cli/template/addons/trpc/auth-server-utils.ts Show resolved Hide resolved
cli/template/addons/trpc/server-utils.ts Show resolved Hide resolved
cli/template/addons/trpc/auth-server-utils.ts Show resolved Hide resolved
@juliusmarminge
Copy link
Member Author

Can I also review 🥺

Your review was still active 🤪

@juliusmarminge juliusmarminge merged commit dd0e172 into next Oct 10, 2022
@juliusmarminge juliusmarminge deleted the julius/trpc-procs branch October 10, 2022 21:55
devvianto605 pushed a commit to devvianto605/create-devviantex-nextjs-app-deprecated that referenced this pull request Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📌 area: cli Relates to the CLI 📌 area: t3-app Relates to the generated T3 App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants