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

Use ReadableStream #202

Closed
wants to merge 6 commits into from
Closed

Use ReadableStream #202

wants to merge 6 commits into from

Conversation

MaxLeiter
Copy link

Fixes support for Cloudflare workers and vercel edge runtime. ReadableStreams are available in Node.js since Node 18: https://nodejs.org/docs/latest-v18.x/api/webstreams.html#web-streams-api

Copy link
Member

@zeke zeke left a comment

Choose a reason for hiding this comment

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

I don't know much about the internal of this stuff, but this look sensible to me, and the tests are passing. I'm cool with shipping this, barring any opposition from @mattt

@MaxLeiter your PR body explains the purpose of this change, but can you add a bit more detail that I can use for some release notes about this change?

Copy link
Contributor

@mattt mattt left a comment

Choose a reason for hiding this comment

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

Thanks so much for taking a look at this, @MaxLeiter. Overall, this is looking much nicer! I have one refactoring suggestion to move parseEvent to a static method on the SSE class (patch here: 0001.patch)

The only blocker is that I think we need to define the async iterator for the class if we're keeping the existing usage in replicate.stream. Left a suggestion in a comment with some untested code.

Speaking of untested, I don't believe the stream method has any test coverage at the moment, because I couldn't figure out how to get SSE to play nicely with nock. I tested this locally by hand for the initial version, but it'd be great to automate this.

@mattt
Copy link
Contributor

mattt commented Mar 12, 2024

Hi @MaxLeiter. Thanks again for your help with this. We just merged #214 and released v0.28.0, which should resolve any issues you were having. We also added a Cloudflare Workers integration test suite with #217. If you have a chance, please give that a try and confirm that's working for you 🙇

@mattt mattt closed this Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants