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

Plans (State): Remove plansLoaded logic from JP app plans #92485

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

chriskmnds
Copy link
Contributor

@chriskmnds chriskmnds commented Jul 8, 2024

Part of addressing #86638

Proposed Changes

Removes the logic for generating the plansLoaded variable in the jetpack-app plans.

Caveats:

This is primarily used for generating a loading ellipsis before rendering the PlansFeaturesMain component, which generates its own loading status and placeholder. However, we'd need to confirm if <Header paidDomainName={ paidDomainName } /> is ok to render before the plans are populated in the data-store. Otherwise, one of the Query hooks (or pricing selector hook) can be used to re-establish the loading state where it was.

Why are these changes being made?

We only need one form of handling plan pricing in the code base, more so one framework. Anything else risks having alternative and differing views of the same data propagating across the code base.

Testing Instructions

  • On the JP app plans page:
    • Confirm nothing suspicious happens around the loading placeholders, like page sections/headers loading before the grid / different to production

See detailed instructions below on testing various cases with the JP app: #92485 (comment)

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-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented Jul 8, 2024

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

Sections (~282 bytes removed 📉 [gzipped])

name         parsed_size           gzip_size
jetpack-app      -1082 B  (-0.3%)     -236 B  (-0.2%)
stats             -238 B  (-0.0%)      -46 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.

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.

@chriskmnds chriskmnds requested a review from staskus July 8, 2024 11:31
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 8, 2024
@chriskmnds chriskmnds marked this pull request as ready for review July 8, 2024 11:32
@chriskmnds
Copy link
Contributor Author

chriskmnds commented Jul 8, 2024

@staskus can you please give me instructions on testing the JP app plans - or review the changes here? Thank you! 🙇

@staskus
Copy link
Contributor

staskus commented Jul 8, 2024

@chriskmnds, different flows are described wordpress-mobile/WordPress-iOS#21688. In short, if you log into the Jetpack app using a WP.com account, and create a site, you get taken to this domain and plan selection flow.

Simulator.Screen.Recording.-.iPhone.15.-.2023-10-04.at.16.24.38.mp4

However, it's more complicated to test this particular change on the app, since you would either need to input a different URL within the code using Xcode or use tools such as Charles to re-route URLs.

I think the middle ground would be to test scenarios described in this PR #83281:

Testing Instructions

Before testing, set wp-iphone or wp-android user agents.

paid_domain_name + free plan selection

  1. Pass paid_domain_name parameter (.com/jetpack-app/plans?paid_domain_name=greatdomain.com)
  2. Select Free Plan
  3. Confirm modal is opened

paid_domain_name + paid plan selection

  1. Pass paid_domain_name parameter (.com/jetpack-app/plans?paid_domain_name=greatdomain.com)
  2. Select Paid Plan
  3. Confirm tapping on Paid plan open redirection URL with a selected paid domain name, plan slug, and plan id (.com/jetpack-app/plans?plan_slug=value_bundle&plan_id=1009&domain_name=greatdomain.com)

no parameters + free plan selection

  1. Open plans page without any parameters (.com/jetpack-app/plans)
  2. Select Free Plan
  3. Confirm tapping on Free plan opens redirection URL with a free plan slug (.com/jetpack-app/plans?plan_slug=free_plan)

no parameters + paid plan selection

  1. Open plans page without any parameters (.com/jetpack-app/plans)
  2. Select Paid Plan
  3. Confirm tapping on Paid plan opens redirection URL with a paid plan slug and plan id (.com/jetpack-app/plans?plan_slug=value_bundle&plan_id=1003)

If needed, I could test tomorrow.

@chriskmnds chriskmnds force-pushed the update/plans-state-remove-plansLoaded branch from 7d1fc4d to 7d8fd42 Compare July 9, 2024 07:23
@chriskmnds chriskmnds requested a review from a team as a code owner July 9, 2024 07:23
@chriskmnds chriskmnds force-pushed the update/plabs-state-remove-plansLoaded-JPapp branch from 533e375 to 7b2a6d6 Compare July 9, 2024 07:24
Copy link
Contributor

@staskus staskus left a comment

Choose a reason for hiding this comment

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

I tested the described scenarios and also ran the page locally on the app. I haven't noticed anything suspicious around loading. 👍

Feel free to ping me when you deploy all these changes, I can quickly test in production as well.

@chriskmnds
Copy link
Contributor Author

Thank you for the detailed instructions and for the testing @staskus! Very much appreciate this 🙌

Feel free to ping me when you deploy all these changes, I can quickly test in production as well.

will do! Tomorrow I plan to get this and the base PR deployed :-)

@chriskmnds chriskmnds force-pushed the update/plans-state-remove-plansLoaded branch from 7d8fd42 to 5c7bc3b Compare July 10, 2024 10:46
Base automatically changed from update/plans-state-remove-plansLoaded to trunk July 10, 2024 11:00
@chriskmnds chriskmnds force-pushed the update/plabs-state-remove-plansLoaded-JPapp branch from 7b2a6d6 to 819349e Compare July 10, 2024 11:01
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/plabs-state-remove-plansLoaded-JPapp on your sandbox.

@chriskmnds chriskmnds merged commit 096afe7 into trunk Jul 10, 2024
11 of 12 checks passed
@chriskmnds chriskmnds deleted the update/plabs-state-remove-plansLoaded-JPapp branch July 10, 2024 12:12
@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 10, 2024
@chriskmnds
Copy link
Contributor Author

Thanks again @staskus for the instructions. Just deployed the changes. Also tested the cases that you mentioned.

p.s. for some reason the CTA/buttons were all disabled on the calypso.live image - but they look good in staging

@staskus
Copy link
Contributor

staskus commented Jul 10, 2024

Thanks for the ping, @chriskmnds. I retested some of the scenarios again on the app and they continue to work as before 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants