-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat: Add Hook to monitor network connectivity status #56861
Conversation
This code is non-functioning currently.
This bridge will be required for the planned JavaScript Hook to monitor connection status.
Provides React Hook for monitoring the network connection status via the bridge to the host app.
This reverts commit a8d3660.
Semicolon is unnecessary. Co-authored-by: Tanner Stokes <[email protected]>
This bridge enables monitoring the connection status on Android.
Allow the Android platform to request the current network connection status.
The Demo editor fails to build without a mocked bridge method.
Size Change: 0 B Total Size: 1.72 MB ℹ️ View Unchanged
|
Flaky tests detected in aadf8c6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7128077772
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 🚀
Note
This PR supersedes the reverted #56609.
Related
What?
Add a React Hook for monitoring the network connection status via the bridge to
the host app.
Why?
The network connection status will enable future features improving the UX when
a user's network connection changes, e.g. displaying status indicators.
Fixes wordpress-mobile/gutenberg-mobile#6409.
How?
Add a
useIsConnected
React Hook that invokes bridge methods retrieving andmonitoring the network connection status from the host app. Relying upon the
host app will result in a single source of truth and mitigate conflicting
statuses.
Testing Instructions
Checkout this branch within the
gutenberg-mobile
submodule.Start the Metro server via
npm run start:reset
.Apply the following patch:
Test Diff
Configure the app to load the local Metro server:
LOCAL_GUTENBERG=true bundle exec pod install
.localGutenbergMobilePath
withinlocal-builds.gradle
.Build and run the WordPress app.
Launch the editor and verify the connection status displayed is accurate.
Toggle airplane mode, verify the connection status displayed is accurate.
Testing Instructions for Keyboard
n/a, this internal tool introduces no user-facing changes.
Screenshots or screencast
n/a, this internal tool introduces no visible changes.