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

move away from EventSource #8207

Open
1 task done
pngwn opened this issue May 3, 2024 · 2 comments
Open
1 task done

move away from EventSource #8207

pngwn opened this issue May 3, 2024 · 2 comments
Assignees
Labels
gradio_client Related to the one of the gradio client libraries

Comments

@pngwn
Copy link
Member

pngwn commented May 3, 2024

  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.

EventSource has a number of issues:

Describe the solution you'd like

I think we should switch to the Web Streams API which is supported in more environments. More specifically i think we should use fetch-event-stream because:

  • it is tiny (less than 1kb).
  • it works in all environments (ish).
  • it support worker environments, which may be helpful for @gradio/lite.
  • I know the author and know it is a high quality library.
  • It will allow us to use any HTTP method + set arbitrary headers.

See the following from the repo:

  • Allows any HTTP method
  • Built with native Web Streams API
  • Works with browser, Node.js, Cloudflare Workers, Deno, and Bun
  • Supports WebWorker or Service Worker environments
  • Accepts AbortController for cancellable streams

I also think we should change the streaming API, but I'll open a new PR for that.

@pngwn pngwn added the gradio_client Related to the one of the gradio client libraries label May 3, 2024
@pngwn pngwn added this to the @gradio/client 1.0 milestone May 3, 2024
@hannahblair
Copy link
Collaborator

hannahblair commented May 3, 2024

Nice, thanks for making an issue for this!

@pngwn
Copy link
Member Author

pngwn commented May 3, 2024

Issue for the API changes: #8208

@pngwn pngwn self-assigned this May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gradio_client Related to the one of the gradio client libraries
Projects
None yet
Development

No branches or pull requests

2 participants