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

[expo] support DevToolsPluginClient websocket multiplexing on expo web #27702

Merged
merged 2 commits into from Mar 18, 2024

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Mar 15, 2024

Why

if an expo web app contain multiple devtool plugins, we will create multiple websocket connection on web.

How

  • move the connection multiplexer from DevToolsPluginClientImplApp to base DevToolsPluginClient
  • the multiplexer relies on static variables. however, the unit tests are running in single process. this pr introduces a WebSocketBackingStore for test to specify their backing store. for normal use case, the default backing store is a static variable.

Test Plan

refine unit test and the tests passed

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Mar 15, 2024
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Mar 15, 2024
@Kudo Kudo marked this pull request as ready for review March 15, 2024 18:08
@Kudo Kudo merged commit a8b2184 into main Mar 18, 2024
19 checks passed
@Kudo Kudo deleted the @kudo/dev-plugins/multiplexing branch March 18, 2024 18:58
Kudo added a commit that referenced this pull request Mar 19, 2024
#27702)

if an expo web app contain multiple devtool plugins, we will create
multiple websocket connection on web.

- move the connection multiplexer from `DevToolsPluginClientImplApp` to
base `DevToolsPluginClient`
- the multiplexer relies on static variables. however, the unit tests
are running in single process. this pr introduces a
`WebSocketBackingStore` for test to specify their backing store. for
normal use case, the default backing store is a static variable.

(cherry picked from commit a8b2184)
@Kudo Kudo added the published Changes from the PR have been published to npm label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants