Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
# Conflicts: # packages/tests/package.json # pnpm-lock.yaml
| const ctx = konn() | ||
| .beforeEach(() => { | ||
| const t = initTRPC.create({ | ||
| transformer: 'tupleson', // <------- help, idk if this is the right thing |
There was a problem hiding this comment.
To me, it depends, if tupleson is the default anyway, the string is fine, if not I would opt for a reference from the tupleson package in order to make it tree shakable
The tree shake will, however, only fork if the default is different from tupleson, or if this is a required property and thus none is the default...
There was a problem hiding this comment.
To me, it depends, if
tuplesonis the default anyway, the string is fine, if not I would opt for a reference from thetuplesonpackage in order to make it tree shakableThe tree shake will, however, only fork if the default is different from
tupleson, or if this is a required property and thus none is the default...
@Akxe
We've been leaning towards making Tupleson the transformer moving forward, deprecating the need for this field. It would make TSON a hard requirement for future implementations (but we maintain backward compat for a bit).
If users want to customize the transform logic, they do so by configuring TSON (which allows an alternative to the default JSON from stringifying/parsing).
Essentially, we would be moving the 'transformer' concept to be an implementation detail of Tupleson, instead of an implementation detail of tRPC.
That was an idea, at least. Thoughts?
There was a problem hiding this comment.
I do like the idea of using TSON. My point was merely informative :)
There was a problem hiding this comment.
I do not want a string to be there. It means that even if you were to replace it, the TSON dependency is forced upon the consumer.
From my point of view; no choice or choice in the form of a function or a Class.
Why string? What would you put there otherwise?
# Conflicts: # packages/tests/package.json # pnpm-lock.yaml
# Conflicts: # packages/client/package.json # pnpm-lock.yaml
|
@KATT What is a progress on it? I think streaming is really useful |
@XantreGodlike it's not high on the priority list for us right now as we don't need it ourselves. Our main priority at the moment is finishing the breaking changes we have for v11. If you work for a company that would like to fund the development of this, we may reconsider, feel free to contact us if so. |
Nope, it's for hobby purposes |
|
@KATT any progress on this vs unstable_streamingLink? |
|
Looking at the stream support 👀 |
|
Looking forward for this as its very useful for download big files |
|
Can't wait for it!! |
|
Looking forward to this for LLM applications so I can stream the LLM output without having to write a separate end-point through the framework I am using. |
|
@KATT For those that need this for personal projects, how can we help with getting this merged? |
|
Is there anything we can help? Looking forward to be merged soon |
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
tl;dr is that queries and mutations can return generator functions, and you can "just" use them
trpc/packages/tests/server/tupleson.test.ts
Lines 383 to 399 in 77f23db
🎯 Changes
Proof of concept of using tupleson to handle streaming data - tl;
resolveHTTPResponse-function that returns a fetchResponsehttpTuplesonLinkthat handles this type of response from the serverinitTRPCand figure out a way to reuse same configuration for both client and server (transformers will be unnecessary as we can configure them all in tson)