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

Re-enable streaming on Cloudflare Pages #5914

Merged
merged 5 commits into from
Jan 26, 2023

Conversation

AngusMorton
Copy link
Contributor

@AngusMorton AngusMorton commented Jan 20, 2023

Originally, we disabled streaming on Cloudflare Pages because the Cloudflare Worker runtime didn't support ReadableStream (#3764, #3777). At the end of last year, the Worker Runtime was updated and now supports ReadableStream (Standards Compliant Workers API). So we can now remove the workarounds we had in place for Cloudflare.

Closes #5900.

Changes

  • Re-enables streaming in the Cloudflare Pages integration.

Testing

I haven't added any tests - I couldn't see any examples of tests of streaming in other integrations.

I have deployed an example to Cloudflare Pages, available here: https://astro-streaming-cf.pages.dev/

The example is the basics example, except that the <head> meta tags have an await in them for ~2 seconds. You can see in the waterfall that we stream the first part and then wait for 2 seconds:

image

Docs

This brings the Cloudflare Pages integration back to the expected and documented streaming behaviour when SSR is enabled.

@changeset-bot
Copy link

changeset-bot bot commented Jan 20, 2023

🦋 Changeset detected

Latest commit: e27a812

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jan 20, 2023
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great to see, thanks for contributing!

@natemoo-re natemoo-re merged commit 088f519 into withastro:main Jan 26, 2023
@astrobot-houston astrobot-houston mentioned this pull request Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSR Streaming is disabled on Cloudflare
2 participants