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

@robojs/trpc - Support for createContext w/ type inference and all #345

Open
Pkmmte opened this issue Oct 31, 2024 — with Volta.net · 3 comments
Open

@robojs/trpc - Support for createContext w/ type inference and all #345

Pkmmte opened this issue Oct 31, 2024 — with Volta.net · 3 comments
Labels

Comments

Copy link
Member

Pkmmte commented Oct 31, 2024

Points: 3


@robojs/trpc currently handles the route and proxies the creation of the t instance. While this is great and all, we've yet to abstract the .context function that comes with initTRPC before create.

https://trpc.io/docs/server/context

We should mimic that and make it chainable to maintain API compatibility with initTRPC. The existing context should be merged with the user-provided context.

@Pkmmte Pkmmte added enhancement New feature or request good first issue Good for newcomers hacktoberfest plugin labels Oct 31, 2024 — with Volta.net
@RohitN002
Copy link

"Hi @Pkmmte ! I’d like to work on implementing the abstraction for the .context function to make it chainable, as you suggested. I’ll ensure it aligns with initTRPC for API compatibility and handles merging with the user-provided context. Please let me know if you have any additional guidelines or if there’s anything specific you’d like me to keep in mind!"

@Pkmmte
Copy link
Member Author

Pkmmte commented Nov 5, 2024

Hi @RohitN002! There's not really anything specific to keep in mind, beyond just the purpose of the chain.

In short:

  • This package wraps several tRPC packages for easy use
  • Because tRPC is reliant on type inference, it's important that our wrapper functions mimic that exactly
  • We use wrappers to maintain an identical API for those already familiar with tRPC
  • As a benefit from wrapping, we're able to extract the underlying router instance seamlessly

Now that you know the above, hopefully this task becomes easier for ya! I've marked this issue as "claimed" for you.

If you need any guidance on how to start, check out our Contribution docs:
https://github.com/Wave-Play/robo.js/blob/main/CONTRIBUTING.md

@Pkmmte Pkmmte added the claimed label Nov 5, 2024
@Pkmmte
Copy link
Member Author

Pkmmte commented Nov 20, 2024

Hi @RohitN002, Are you still interested in working on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants