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

Gutenboarding: persist free domain when selecting free plan #43935

Merged
merged 5 commits into from
Jul 7, 2020

Conversation

razvanpapadopol
Copy link

@razvanpapadopol razvanpapadopol commented Jul 7, 2020

Note to anyone reading this while preparing a release of the FSE plugin

This change doesn't require any release notes. We're developing a new feature which is currently hidden behind a flag.

Changes proposed in this Pull Request

  • Update condition to trigger automatic domain update when selecting Free plan.
  • Add plan to ONBOARD store and remove selectedPlanSlug from @data-stores/plans.

Testing instructions

Fixes #43927

Razvan Papadopol added 2 commits July 7, 2020 13:37
- remove use-debounce dependency from client
- Add plan to ONBOARD store; add getPlan selector; add updatePlan action
- Update condition to call setDomain when selecting a free plan
@razvanpapadopol razvanpapadopol added [Type] Bug [Feature Group] Emails & Domains Features related to email integrations and domain management. [Goal] New Onboarding previously called Gutenboarding labels Jul 7, 2020
@razvanpapadopol razvanpapadopol requested a review from a team as a code owner July 7, 2020 10:53
@razvanpapadopol razvanpapadopol self-assigned this Jul 7, 2020
@matticbot
Copy link
Contributor


export const getDefaultPlan = ( _: State, hasPaidDomain: boolean, hasPaidDesign: boolean ) =>
Copy link
Author

Choose a reason for hiding this comment

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

plans store shouldn't care about external state such as hasPaidDomain or hasPaidDesign.

Copy link
Contributor

@yansern yansern Jul 7, 2020

Choose a reason for hiding this comment

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

Thanks. I can see that now useSelectedPlan(), a hook in the consumer app, now determines what plan to return. If a free plan is selected, but a paid domain or paid design is selected, it will change to a paid plan. Is there a place where setPlan()/updatePlan() is called when this is changed or is this not necessary?

Copy link
Author

Choose a reason for hiding this comment

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

If a free plan is selected, but a paid domain or paid design is selected

At the moment, only if a paid domain is selected because we still don't have the UI ready to connect the concepts of paid plan <=> premium design. Check this convo: #42601 (comment)

Is there a place where setPlan()/updatePlan() is called when this is changed or is this not necessary?

We're not updating the selected plan in these cases in Gutenboarding because we always want to show Plans grid. See in code: https://github.com/Automattic/wp-calypso/pull/43935/files#diff-7ccae80646b579bcdfe01b44b7601d43R57-R59

@matticbot
Copy link
Contributor

matticbot commented Jul 7, 2020

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

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

name                 parsed_size           gzip_size
entry-gutenboarding        -86 B  (-0.0%)      -13 B  (-0.0%)

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.

return {
...state,
selectedPlanSlug: action.slug,
};
Copy link
Author

Choose a reason for hiding this comment

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

With this state moved to consumer app's store (Onboard at the moment) it will be easier to understand the scope of plans / domain-suggestions data-stores. Their purpose is to store data fetched from the API and error/loading related states. Keeping track of application state (plan, domain, last search query, etc) should be the responsibility of each consumer app.
Some context about this: https://github.com/Automattic/wp-calypso/pull/43858/files#r449029095

Copy link
Contributor

Choose a reason for hiding this comment

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

Keeping track of application state (plan, domain, last search query, etc) should be the responsibility of each consumer app.

Agree! This makes it clear who does what now.

@razvanpapadopol razvanpapadopol added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 7, 2020
Copy link
Contributor

@yansern yansern left a comment

Choose a reason for hiding this comment

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

Selecting a subdomain then select a free plan - the subdomain now persists.

@matticbot
Copy link
Contributor

Caution: This PR affects files in the FSE Plugin on WordPress.com
Please ensure your changes work on WordPress.com before merging.

D46029-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing in the FSE Plugin for more info: PCYsg-ly5-p2

@razvanpapadopol razvanpapadopol merged commit 25289b8 into master Jul 7, 2020
@razvanpapadopol razvanpapadopol deleted the fix/gutenboarding-persist-free-domain branch July 7, 2020 14:27
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 7, 2020
@deBhal deBhal mentioned this pull request Jul 13, 2020
31 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Emails & Domains Features related to email integrations and domain management. [Goal] New Onboarding previously called Gutenboarding [Type] Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gutenboarding: subdomain selection is lost or changed
3 participants