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

Guidance on HTTP-based WebSocket fallbacks in React Native #255

Open
trevorarmstrong-ai opened this issue Sep 19, 2023 · 1 comment
Open

Comments

@trevorarmstrong-ai
Copy link

trevorarmstrong-ai commented Sep 19, 2023

So I'm trying to enable http stream & sse fallbacks for the websocket in our React Native app. When I try to use these transports I get they're not supported, after instrumenting your code I see the reason for http stream reporting as unsupported is that EventTarget, Event, & MessageEvent implementations are missing. I assume sse is in a similar boat.

Any guidance on what I might need to include/polyfill here to get this working? Any examples floating around out there?

@FZambia
Copy link
Member

FZambia commented Sep 19, 2023

Hello, @trevorarmstrong-ai

That's a not investigated area at this point. I think that in general the approach would be to use polyfills like https://github.com/mysticatea/event-target-shim , https://github.com/mattkrick/event-target-polyfill to bring required types to the global scope. Probably define MessageEvent polyfill manually if there are no polyfills for it.

There is also #201 which seems like a similar issue with ReactNative.

If you manage to make it work - please share how exactly, would be a great help. From my side I can definitely take a look at this at some point - but no concrete instructions for now unfortunately.

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

No branches or pull requests

2 participants