Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 6 commits into from

Conversation

dgurns
Copy link
Contributor

@dgurns dgurns commented Jan 29, 2023

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.
  • Run cloudflare-pages/cloudflare-workers local dev servers on port 3000 to match the default remix server behavior

I pulled the entry.server.tsx code from @jacob-ebey's example project which deploys to Cloudflare and tested that the updated cloudflare-pages/cloudflare-workers templates run successfully for local dev, including with defer.

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

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2023

⚠️ No Changeset found

Latest commit: 62dfe73

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

@MichaelDeBoey
Copy link
Member

Closing this as we're already going to have these changes once #4600 is merged

@dgurns
Copy link
Contributor Author

dgurns commented Jan 29, 2023

Sounds good, only thought is it might still be worthwhile to have info in the defer README about how to upgrade an older Remix app to support it?

Even with the new implicit entry files, an older project would still have them explicitly defined and they likely wouldn't be set up for streaming yet.

Even better would be some kind of codemod that would automatically upgrade deps and entry files to support streaming/defer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants