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

WPCOM: Migrate wpcom.undocumented() site plans to wpcom.req #57766

Merged
merged 2 commits into from
Nov 9, 2021

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Nov 8, 2021

Changes proposed in this Pull Request

This PR migrates all the wpcom.undocumented() site plans method to wpcom.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 undocumented cancelPlanTrial 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

  • Go to /plans/:site where :site is one of your Jetpack sites.
  • Verify that the request to /sites/:site/plans is still successful.
  • Verify the removed code is not in use.

@tyxla tyxla added [Type] Enhancement Framework [Feature] Plans & Upgrades All of the plans on WordPress.com and flow for upgrading plans. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Janitorial State labels Nov 8, 2021
@tyxla tyxla requested a review from a team November 8, 2021 16:22
@tyxla tyxla self-assigned this Nov 8, 2021
@tyxla tyxla changed the title WPCOM: Migrate wpcom.undocumented() site plans to wpcom.req WPCOM: Migrate wpcom.undocumented() site plans to wpcom.req Nov 8, 2021
@github-actions
Copy link

github-actions bot commented Nov 8, 2021

@matticbot
Copy link
Contributor

matticbot commented Nov 8, 2021

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~163 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
entry-main                  -697 B  (-0.1%)     -163 B  (-0.0%)
entry-login                 -486 B  (-0.1%)     -137 B  (-0.1%)
entry-gutenboarding         -349 B  (-0.0%)     -103 B  (-0.0%)
entry-domains-landing       -349 B  (-0.1%)     -103 B  (-0.1%)

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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Member

@jsnajdr jsnajdr left a 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.

@tyxla tyxla force-pushed the migrate/undocumented-site-plans branch from 699788e to bd54961 Compare November 9, 2021 10:58
@tyxla tyxla force-pushed the migrate/undocumented-site-plans branch from bd54961 to 7558f07 Compare November 9, 2021 11:29
@tyxla tyxla merged commit 41e68d3 into trunk Nov 9, 2021
@tyxla tyxla deleted the migrate/undocumented-site-plans branch November 9, 2021 11:45
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 9, 2021
nelsonec87 pushed a commit that referenced this pull request Dec 9, 2021
* WPCOM: Migrate wpcom.undocumented() site plans to wpcom.req

* Remove unused plan cancellation state and undocumented method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Plans & Upgrades All of the plans on WordPress.com and flow for upgrading plans. Framework State [Type] Enhancement [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants