Replies: 1 comment 3 replies
-
Nothing there is Node specific, that's how you make React stream the responses, that same code could also work with Cloudflare runtime, the only things imported from If this was specific of Node it would have been implemented on the Express adapter that all the templates you mention use. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am new to Remix. I was setting up a barebones project and discovered a bunch of functional code in the entry.server.tsx. I didn't understand why the code was there, but after some digging, I've traced the origin back to a Pull Request: #4060. From the Pull Request, I found this commit, which says "...implement streaming".
The express template, remix template and fly template all contain the identical code to allow for streaming. The code is specific to node, not the service. All of these templates depend on
@remix-run/node
. I suspect the reason this functional code ended up copied into all of the node templates is because it only has to be written once in integration/helpers/node-template.I was going to submit a Pull Request but found that a proposal is required first. I propose that this functionality is moved into the
@remix-run/node
package so that the functionality becomes a dependency of each application using these templates; that way, there's just a single place where streaming behaviour is defined and can be tested + improved over time. I imagine the solution would be something like:handleStreamableRequest
to@remix-run/node
containing the streaming functionality from the node templateentry.server.tsx
to use that implementation, e.g:Thanks for your time! :)
Beta Was this translation helpful? Give feedback.
All reactions