-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[RFC] Next major overview #887
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Regarding
|
continued...
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Hey. Just came across this upcoming update. I wasn't aware that this update was in the works, and had started work on a similar project. https://github.com/rakeshpai/birdsong It isn't production-ready yet. It is heavily inspired by tRPC, but these are the differences from tRPC 9:
I had even more ambitious plans with my package, but some of those have fallen by the wayside for now:
I'm very happy to know that the first two points above, which are the biggest ergonomic differences from tRPC 9, are now going to be handled in 10. With that in mind, I'm happy to abandon my project. However, I thought I'd leave the rest of the list here to see if there's interest in targeting them with upcoming updates to tRPC. You can see usage examples of my package in the tests. Apologies for not documenting this better. Edit: Terminology (/s/module/package) |
Hey @rakeshpai! Birdsong looks great! Here's a response to your points: I don't see this changing for us.
tRPC v10 can run anywhere and is agnostic to the environment. We cannot use the Fetch API
We can consider this, but I don't think it's a great idea. I'm not a fan of implicit behavior on this level. In a way, having to specify keywords in front of the procedure names is still explicit. As a side note this was also brought up in #2270 (reply in thread).
We'd love to have your help here! This is something on our radar to look at before release. That being said, the client is kept fairly minimal.
Yeah, this is also something we discussed. It's not a huge problem right now (compared to the other things we're working on), but we're open to ideas here.
Awesome! tRPC has this too with the
You can likely achieve this with a custom link on the client. tRPC has also also been designed to minimize HTTP-specifics. For example, see the WebSocket link and trpc-chrome. It seems like you've thought about this a lot and we'd love to have you involved in the decision-making for v10. We'd also love to have you as a contributor to tRPC! If you're interested, please join the Discord and we can talk more. |
So. We're making a new major.
Goals
react-query
as well!Todos
Tracked in https://github.com/orgs/trpc/projects/1
formatError()
-equivalent.meta
-equivalentcreateRootRouter()
that additionally accepts{ transformer: X, formatError: Y}
.legacy()
at the end to transform them to the new version)client.query('postById', input, options)
whilst new stuff can beclient.queries.postById({ input, ...options})
examples/*
toexamples/.test
so we can track breaking changes easily and make sure we remain backward compatible for a long timeTRPCClient
to be functional instead of a class but reuse the same interfaceruntime
to make it backward compatiblestripInternal
-flagunknown
errors or make it guaranteed to beTRPCClientError
of some sort.?batch=1
maybe a transformed request could be?transform=1
ortransform=TRANSFORMER_NAME
?www/
-docs asv9.trpc.io
Stretch
@trpc/server
from node #1597trpc.output.snapshot()
feat:trpc.snapshot()
#3435Old notes
Definite
12.x
tsconfig
build target16.x
stripInternal
-flag@deprecated
stuffLegacyRouter
introduced in Middleware: swap context #915react-query
3
to4
{ id:null, result: {type: 'data', data: x } }
->{ result: { data: x } }
id: null
from HTTP responses?Maybe ❓
{ data: x }
instead of justx
so we could add metadata and potentially discriminated union of{ data: x } | { error: y }
~{ input: z.string(), resolve({input}) {}}
-> `t.pipe(t.input(z.string), ({input}) =>client.query
result into[ output, { meta } ]
useQuery()
API that expects suspense as default - See this gist: https://gist.github.com/KATT/aa1ad532d6e57520b942f657569e1505@trpc/server
to easier work with CloudFlare-workers etc (Make it easier to bundle@trpc/server
#1375)Transformers
Turn transformers into a middleware on the server?batch=1
maybe a transformed request could be?transform=1
ortransform=TRANSFORMER_NAME
?Misc
@trpc/react/ssg
->@trpc/react/ssr
&createSSGHelpers
->createServerSideHelpers
(or something, as it is often used ingetServerSideProps()
as well asgetStaticProps()
)Open questions
The text was updated successfully, but these errors were encountered: