-
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
Gutenboarding: persist free domain when selecting free plan #43935
Conversation
- 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
|
||
export const getDefaultPlan = ( _: State, hasPaidDomain: boolean, hasPaidDesign: boolean ) => |
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.
plans
store shouldn't care about external state such as hasPaidDomain
or hasPaidDesign
.
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.
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?
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.
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
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~13 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. |
return { | ||
...state, | ||
selectedPlanSlug: action.slug, | ||
}; |
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.
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
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.
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.
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.
Selecting a subdomain then select a free plan - the subdomain now persists.
Caution: This PR affects files in the FSE Plugin on WordPress.com 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 |
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
plan
toONBOARD
store and removeselectedPlanSlug
from@data-stores/plans
.Testing instructions
Fixes #43927