-
Notifications
You must be signed in to change notification settings - Fork 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
Components: Remove react-click-outside
in favor of withFocusOutside
#99122
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~313 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~5063 bytes removed 📉 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~751 bytes removed 📉 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
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.
I'm glad there's no "use case 3" — LGTM 🚀
- Code changes LGTM and are on par with the equivalent refactor in Gutenberg;
- Both scenarios from the testing instructions are working as expected
Proposed Changes
Removing
react-click-outside
in favor ofwithFocusOutside
.There seem to be some further cleanup opportunities here, but I'll leave them for another, less-convoluted-to-test PR.
Why are these changes being made?
While chasing where the first
findDOMNode
error comes from, I found that it comes from thereact-click-outside
package, and I realized we can replace that package completely withwithFocusOutside
from@wordpress/components
. We only need to rename the method. See how it was done in Gutenberg: WordPress/gutenberg#16878So, 3 good reasons:
findDOMNode
instanceTesting Instructions
http://calypso.localhost:3000/jetpack/connect/authorize?from=woocommerce-onboarding&_wp_nonce=foobar&blogname=Just%20Another%20WordPress.com%20Site&client_id=12345&close_window_after_login=0&close_window_after_auth=0&home_url=https://yourjetpack.blog&redirect_uri=https://yourjetpack.blog/wp-admin/admin.php&scope=administrator:34579bf2a3185a47d1b31aab30125d&secret=640fdbd69f96a8ca9e61&site=https://yourjetpack.blog&site_url=https://yourjetpack.blog&state=1&allow_site_connection=1&installed_ext_success=1&
in order to simulate the "Woo onboarding" version of the Jetpack Connect signup form.active
class.active
class./home/:site