-
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
WPCOM: Migrate wpcom.undocumented()
site plans to wpcom.req
#57766
Conversation
wpcom.undocumented()
site plans to wpcom.req
Link to Calypso live: https://calypso.live?image=registry.a8c.com/calypso/app:build-18761 |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~163 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. 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. |
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.
Looks good 👍 Nice find that cancelSitePlanTrial
was unused.
699788e
to
bd54961
Compare
bd54961
to
7558f07
Compare
* WPCOM: Migrate wpcom.undocumented() site plans to wpcom.req * Remove unused plan cancellation state and undocumented method
Changes proposed in this Pull Request
This PR migrates all the
wpcom.undocumented()
site plans method towpcom.req.get()
.The PR also simplifies the code a little bit - we don't need to encode the site fragment, because anywhere in the code where we're making requests to this endpoint, we pass the numeric site ID. There is no longer a reason to support non-numeric IDs there - we removed that support a while ago. We're also removing an unnecessary wrapping
Promise
-wpcom.req.get()
already returns a promise.We also use the opportunity to remove the unused
cancelSitePlanTrial
action creator, its related reducer and tests and the unused undocumentedcancelPlanTrial
method. It was created almost 6 years ago in #2952 and it hasn't been used yet, so it's time to go.Part of the ongoing effort to get rid of
wpcom.undocumented()
.Testing instructions
/plans/:site
where:site
is one of your Jetpack sites./sites/:site/plans
is still successful.