Skip to content

Native support for EventSource #1639

@SamyPesse

Description

@SamyPesse

EventSource is a good and simple API to easily implement streaming. At the moment, it's easy to generate an event source stream from a Cloudflare Worker, but it's not easy to consume one from a Clouflare Worker.

Most polyfills are incompatible with Cloudflare Workers:

While it's definitely possible to make a polyfill of EventSource works on Worker, it'd be great if this API could be natively supported, especially as the API surface is light and not browser-specific.

It looks like @cloudflare/ai also consumes an EventSource API, but it's unclear what polyfill is being used there and if the Cloudflare team could publish it as an open source package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions