Repository navigation
Feat: Streaming - #4960
Feat: Streaming#4960helmturner wants to merge 17 commits into
Conversation
refactor(server): cleanup
chore(server): begin implementing whatwg-fetch resolution
|
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
| const officialTsonSyncHandlers = [ | ||
| tsonBigint, | ||
| tsonDate, | ||
| tsonRegExp, | ||
| tsonSet, | ||
| tsonMap, | ||
| tsonUndefined, | ||
| tsonNumberGuard, | ||
| tsonURL, | ||
| tsonSymbol, | ||
| ] as const; |
There was a problem hiding this comment.
I am not sure we should be adding a bunch of transformers automatically as it is quite a big change,
I'd rather have only support for Promise and AsyncIterable and let the user define the others
There was a problem hiding this comment.
So, if I understand, were basically just defaulting to JSON for sync types, since tupleson only tuplefies non-json-serializables? By the way, I missed that little detail for way too long, and may have made some assumptions that rely on ALL serialized values being wrapped in a tuple (with nonce)
| return { | ||
| input: _createTson('input'), | ||
| output: _createTson('output'), | ||
| }; |
There was a problem hiding this comment.
Won't creating the transformer here and in the resolveHttp create two different instances that have different nonce and contains two different "heads"?
Will likely not cause any issues, but it'd be nicer if they'd use the same instance
There was a problem hiding this comment.
Hmm, did I miss some lazy initialization of the revolvers? I didn't realize I was instantiating twice. Can you link the line?
There was a problem hiding this comment.
I fail to see why we need this big complex file - I think the complexity here should be handled by tupleson for any streaming responses
E.g.
trpc/packages/server/src/http/resolveHTTPResponse.ts
Lines 601 to 613 in dd01f7f
There was a problem hiding this comment.
Yep, that's cruft that hasn't been removed yet. Just there for reference.
Closes #4530, #4477, #544, #1853
π― Changes
TBD
β Checklist