Open H4ad opened 1 year ago
Hi @H4ad, is there a way to get your solution working with Next.js/Vercel?
@dbrxnds In theory, you just need to create an adapter for Vercel
, in order to parse in/out the Request/Response.
Create an issue on my Serverless Adapter repository with a minimal example of the stream usage on Vercel, so I can try add support.
Hi @H4ad, streaming actually works with app router on Vercel when using route handlers, as described here
@dbrxnds Do you know how to make streaming work using the page router on Vercel? Is that possible?
@H4ad We've got an open discussion on discord about serverless runtimes and new, http-based streaming features. Care to weigh in?
@nicolassanmar I believe if you use edge routes it 'just works'
edit: If, that is, you're referring to the tRPC streaming features, not those in NextJS (which are new to app router)
Using Lambda Web Adapter with AWS_LWA_INVOKE_MODE=response_stream
should just work. The Lambda extension converts transfer-encoding: chunked response to Lambda streaming protocol.
Describe the feature you'd like to request
httpBatchStreamLink
was implemented on this https://github.com/trpc/trpc/pull/4347Currently, the built-in AWS Lambda Adapter for tRPC didn't provide support for AWS Lambda Response Streaming, so I'm opening this issue just to keep track of the future support of this functionality.
Describe the solution you'd like to see
The ideal solution should be something like this:
Describe alternate solutions
I'm the maintainer of Serverless Adapter, a library to connect any serverless environment with any NodeJS Framework.
I already added support for AWS Lambda Response Stream (docs), and I also support tRPC (I still need to update my library to add support to the latest version) but I think it will work without any issue this new feature using my library.
If you want to add support for response streaming on the internal built-in, I suggest for who are interested in implementing, read the following files:
Of course, the final implementation can be different but this is just my suggestion.
Additional information
No response
π¨βπ§βπ¦ Contributing
Funding