Open chriskmnds opened 10 months ago
Just a quick update on progress:
plans
state. This is the first piece in the puzzle taken care of.Also noting a point of exploration (that may lead to a detour before proceeding with site-plans):
plans
and products
being populated in the state tree. Our intention is to migrate both plans
and products
to data-stores, as we have complete state coverage there. So at any point we will need to strip off currency-code
and have it handled via some data-store hook. getCurrentUserCurrencyCode
in the code, with several in Class components that require additional wrapping/refactoring to utilize hooks.
What
Migrate/replace the Redux plans state (selectors and query components) to happen through the plans data store under
/packages/data-stores/plans
.Why
Since https://github.com/Automattic/wp-calypso/pull/86349 we have effectively turned the existing plans' state redundant (which is primarily used for pricing). We are now maintaining two completely separated forms of state handling, one through the monolithic Redux state and another through the data-stores package. This needs some ownership to clean up the trace for the greater well-being of the codebase.
How
The following can be done through individual PRs:
getPlanPrices
selector (it should be straight-up replaceable byPlans.usePricingMetaForGridPlans
)Plans.usePricingMetaForGridPlans
orPlans.usePlans
andPlans.useSitePlans
(both delivering the respective pricing state)/client/data
/packages/data-store/plans
to reflect only the remaining (used) properties needed in the new selectors (and/or add whatever new properties are needed)orig_cost
orraw_price
that are no longer needed)