KevinEdry / nestjs-trpc

Providing native support for decorators and implement an opinionated approach that aligns with NestJS conventions.
https://NestJS-tRPC.io
MIT License
73 stars 8 forks source link

Question: Thoughts on upgrading to trpc v11? #40

Open hrmcdonald opened 2 weeks ago

hrmcdonald commented 2 weeks ago

I know trpc v11 is not officially released yet, but much of the ecosystem seems to be operating as if it has since they've declared v11 as stable and ready for production at this point and have not released any updates to v10 since January of this year. They even go as far as to direct new visitors to the v11 version of their docs, and display next (v11) as the default branch on github.

The challenge here is that external tooling like Tanstack Router and React Query all operate under the assumption that you are using trpc v11 on their latest versions.

I'm mostly curious how difficult you think upgrading here might be @KevinEdry? Given nestjs-trpc itself doesn't support anything related to the trpc features largely affected by this migration like subscriptions and SSE, it might make sense to migrate to v11 going forward since that is what other trpc libraries also seem to have done a while ago. It'd also mean implementing those features into nestjs-trpc would not be incurring immediate tech debt around a later transition to v11 down the road.

Without this we're not able to leverage a lot of tooling in the trpc ecosystem I'm afraid.


One issue is that trpc-panel doesn't seem to be maintained anymore, but there is a fork that supports v11 being maintained here.

KevinEdry commented 2 weeks ago

I actually started the development of this package around trpc v11, but I later decided not to because I assumed most teams are not using v11 or are late to upgrade and are still works with v10.

The lift is a one liner and I've made sure to comment that line here: https://github.com/KevinEdry/nestjs-trpc/blob/c4e45b453c47f526b2b8e094b77feac9a21e42dc/packages/nestjs-trpc/lib/factories/router.factory.ts#L102

I'll ask the trpc team on the adoption of v11 and will let you know.

radarsu commented 2 weeks ago

I'm really looking forward to that. Problem I'm facing is that I want to use nestjs-trpc on the backend, but I need subscriptions feature.

Subscriptions in trpc v10 are based only on WebSockets which are going to be deprecated by trpc after v11 (due to lack of maintainer) and in trpc v11 they are implemented using SSE.

So I need trpc v11 to not waste time on implementing WebSocket-based solution that would then be replaced by SSE, but don't want to ditch nestjs-trpc to make that upgrade possible...