remix icon indicating copy to clipboard operation
remix copied to clipboard

chore(templates): update cloudflare templates to support streaming and `defer` in entry.server.tsx

Open dgurns opened this issue 2 years ago • 1 comments

The cloudflare-pages and cloudflare-workers templates had been updated to React 18, but do not currently support streaming responses and defer.

This PR:

  • Updates those templates to do so. Now a new project initialized with either of those templates should support defer out of the box.
  • Updates the docs for defer to include steps on how to upgrade an older Remix app to support defer, including necessary changes in entry.client.tsx and entry.server.ts that enable client-side React 18 hydration and streaming responses.

I pulled the entry.server.tsx code from @jacob-ebey's example project which deploys to Cloudflare and also tested it successfully on my own project.

Thanks for all your great work and very excited to begin playing around with defer.

dgurns avatar Jan 22 '23 21:01 dgurns

⚠️ No Changeset found

Latest commit: 704fc042be715857e97621442605e49113a4a3cc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jan 22 '23 21:01 changeset-bot[bot]

@dgurns was this closed by mistake?

machour avatar Jan 28 '23 12:01 machour

Woah weird. Yeah didn't mean to close it. I think I clicked "sync fork" on Github and something happened ha! I'll look into it and reopen.

dgurns avatar Jan 28 '23 19:01 dgurns

Opened a new PR #5298

dgurns avatar Jan 29 '23 12:01 dgurns