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

Add checkout included features list for new Stats products #78868

Merged
merged 5 commits into from
Jul 3, 2023

Conversation

elliottprogrammer
Copy link
Contributor

This PR adds the list of "Included features" displayed on the checkout page, for the new Stats products. (See screenshot):

Screenshots:

Stats paid products (Commercial and PWYW):

Markup 2023-06-30 at 18 54 08

Markup 2023-06-30 at 19 00 31

** Stats Free product ($0): **

Markup 2023-06-30 at 18 58 42

Stats "Included features" items discussion: p1HpG7-ngN-p2#comment-64474
Asana task: 1201210512993648-as-1204939720795290/f

Proposed Changes

  • Adds the new Jetpack Stats products constants to the calypso-products package.
  • Add the "Included features" list for Jetpack Stats products on the Checkout page.
  • Update unit tests.

Testing Instructions

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

@elliottprogrammer elliottprogrammer added [Feature] Stats Everything related to our analytics product at /stats/ Jetpack labels Jun 30, 2023
@elliottprogrammer elliottprogrammer requested a review from a team as a code owner June 30, 2023 23:20
@elliottprogrammer elliottprogrammer self-assigned this Jun 30, 2023
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jun 30, 2023
@github-actions
Copy link

github-actions bot commented Jun 30, 2023

@elliottprogrammer elliottprogrammer requested a review from a team June 30, 2023 23:20
@kangzj
Copy link
Contributor

kangzj commented Jul 2, 2023

Thanks for working on this @elliottprogrammer 👍

----1----

** Stats Free product ($0): **

The features shown for Free do NOT work as described or I'm missing something (Do I need sandbox public api?):

image

----2----

TS checking is failing for the PR which broke the type check in the unit tests:

error TS2739: Type '{ jetpack_ai_monthly: { product_name: ExistingReactNode; product_slug: "jetpack_ai_monthly"; type: "jetpack_ai_monthly"; term: "TERM_MONTHLY"; bill_period: 31; categories: never[]; getFeatures: () => never[]; getProductId: () => number; getStoreSlug: () => "jetpack_ai_monthly"; }; ... 36 more ...; jetpack_backup_add...' is missing the following properties from type 'Record<"jetpack_ai_monthly" | "jetpack_boost_yearly" | "jetpack_boost_monthly" | "jetpack_backup_t0_yearly" | "jetpack_backup_t0_monthly" | "jetpack_backup_t1_yearly" | "jetpack_backup_t1_bi_yearly" | ... 33 more ... | "jetpack_backup_realtime_monthly", Product>': jetpack_stats_monthly, jetpack_stats_pwyw_yearly, jetpack_stats_free_yearly

export const JETPACK_SITE_PRODUCTS_WITH_FEATURES: Record<

----3----

I'm working on support check for the Stats products. The products checks are pretty straight forward, but I'm not very sure about the feature checks. I noticed the diffs on WPCOM added the Plans as features, for example D113814-code, so I'm checking plans on the features too. I'm wondering if you have any advice please? Thanks in advance.

@matticbot
Copy link
Contributor

This PR modifies the release build for happy-blocks

To test your changes on WordPress.com, run install-plugin.sh happy-blocks add/checkout-stats-included-features on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-r7r-p2

@matticbot
Copy link
Contributor

This PR modifies the release build for editing-toolkit

To test your changes on WordPress.com, run install-plugin.sh editing-toolkit add/checkout-stats-included-features on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-mMA-p2

@elliottprogrammer elliottprogrammer force-pushed the add/checkout-stats-included-features branch from 88f96d7 to 8187c8e Compare July 3, 2023 12:40
@matticbot
Copy link
Contributor

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

App Entrypoints (~111 bytes added 📈 [gzipped])

name           parsed_size           gzip_size
entry-stepper       +137 B  (+0.0%)      +58 B  (+0.0%)
entry-main          +137 B  (+0.0%)      +52 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~177 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
checkout                                +959 B  (+0.1%)     +177 B  (+0.0%)
site-purchases                          +555 B  (+0.0%)      +88 B  (+0.0%)
settings-jetpack                        +555 B  (+0.1%)      +88 B  (+0.1%)
scan                                    +555 B  (+0.1%)      +88 B  (+0.0%)
purchases                               +555 B  (+0.0%)      +88 B  (+0.0%)
purchase-product                        +555 B  (+0.3%)      +88 B  (+0.2%)
plans                                   +555 B  (+0.1%)      +88 B  (+0.0%)
jetpack-search                          +555 B  (+0.1%)      +88 B  (+0.1%)
jetpack-connect                         +555 B  (+0.0%)      +88 B  (+0.0%)
jetpack-cloud-settings                  +555 B  (+0.1%)      +88 B  (+0.1%)
jetpack-cloud-pricing                   +555 B  (+0.1%)      +88 B  (+0.0%)
jetpack-cloud-plugin-management         +555 B  (+0.1%)      +88 B  (+0.0%)
jetpack-cloud-partner-portal            +555 B  (+0.1%)      +88 B  (+0.0%)
jetpack-cloud-features-comparison       +555 B  (+0.1%)      +88 B  (+0.1%)
jetpack-cloud-agency-dashboard          +555 B  (+0.1%)      +88 B  (+0.0%)
email                                   +555 B  (+0.1%)      +88 B  (+0.0%)
domains                                 +555 B  (+0.0%)      +88 B  (+0.0%)
backup                                  +555 B  (+0.1%)      +88 B  (+0.0%)

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 (~177 bytes added 📈 [gzipped])

name                                             parsed_size           gzip_size
async-load-calypso-my-sites-checkout-modal            +959 B  (+0.1%)     +177 B  (+0.1%)
async-load-calypso-blocks-editor-checkout-modal       +959 B  (+0.1%)     +177 B  (+0.1%)

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.
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.

@elliottprogrammer
Copy link
Contributor Author

elliottprogrammer commented Jul 3, 2023

Thanks for working on this @elliottprogrammer 👍

----1----

** Stats Free product ($0): **

The features shown for Free do NOT work as described or I'm missing something (Do I need sandbox public api?):

Thanks for reviewing @kangzj!
My apologies, looks like I did not push my last commit that separates the "included features" of Stats Free and the other Stats paid products. It should be fixed now and should now work as described. 👍

----2----

TS checking is failing for the PR which broke the type check in the unit tests:

error TS2739: Type '{ jetpack_ai_monthly: { product_name: ExistingReactNode; product_slug: "jetpack_ai_monthly"; type: "jetpack_ai_monthly"; term: "TERM_MONTHLY"; bill_period: 31; categories: never[]; getFeatures: () => never[]; getProductId: () => number; getStoreSlug: () => "jetpack_ai_monthly"; }; ... 36 more ...; jetpack_backup_add...' is missing the following properties from type 'Record<"jetpack_ai_monthly" | "jetpack_boost_yearly" | "jetpack_boost_monthly" | "jetpack_backup_t0_yearly" | "jetpack_backup_t0_monthly" | "jetpack_backup_t1_yearly" | "jetpack_backup_t1_bi_yearly" | ... 33 more ... | "jetpack_backup_realtime_monthly", Product>': jetpack_stats_monthly, jetpack_stats_pwyw_yearly, jetpack_stats_free_yearly

export const JETPACK_SITE_PRODUCTS_WITH_FEATURES: Record<

Ahh yes, thank you! Ok, adding the Stats products to products-list.ts fixes this and all tests should now be passing.

----3----

I'm working on support check for the Stats products. The products checks are pretty straight forward, but I'm not very sure about the feature checks. I noticed the diffs on WPCOM added the Plans as features, for example D113814-code, so I'm checking plans on the features too. I'm wondering if you have any advice please? Thanks in advance.

@kangzj , AFAIK, I don't think the Features in diff D113814-code have anything to do with the feature-checks in Calypso. If I'm not mistaken the Calypso feature-checks are just independent constants that you can add, although I haven't fully confirmed this, so don't quote me on that, but I believe from memory that this is the case. 😉

@kangzj, this should be ready for re-review again, if you don't mind and have time. Much appreciated. 🙂

Copy link
Contributor

@IanRamosC IanRamosC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests well!

@elliottprogrammer elliottprogrammer merged commit c87072d into trunk Jul 3, 2023
@elliottprogrammer elliottprogrammer deleted the add/checkout-stats-included-features branch July 3, 2023 18:00
@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 Jul 3, 2023
@a8ci18n
Copy link

a8ci18n commented Jul 3, 2023

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/8144637

Thank you @elliottprogrammer for including a screenshot in the description! This is really helpful for our translators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Stats Everything related to our analytics product at /stats/ Jetpack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants