-
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: move design picker state in onboarding store #38757
Gutenboarding: move design picker state in onboarding store #38757
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~38 bytes added 📈 [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. |
- connect PageLayoutSelector to store via hooks - remove props selectedLayouts and selectLayout from PageLayoutSelector component - remove selectedLayouts state from DesignSelector component
5be19b2
to
023a81e
Compare
LGTM
|
@@ -43,7 +43,24 @@ const siteVertical: Reducer< | |||
return state; | |||
}; | |||
|
|||
const reducer = combineReducers( { domain, siteTitle, siteVertical } ); | |||
const pageLayouts: Reducer< Set< string >, ReturnType< typeof Actions[ 'togglePageLayout' ] > > = ( | |||
state = new Set(), |
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.
I suspect we'll end up persisting this, Set
won't serialize well, and we don't have fine-grained control over the wp-data persistence behavior.
Shall we add pageLayouts
to the persistence array and see how this behaves?
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.
Good catch. It should work now with Array
. I've set it to persist and we can remove later if needed.
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.
& good to know :-)
- replace Set with Array to save page layouts
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!
@@ -23,3 +30,8 @@ export const setSiteTitle = ( siteTitle: string ) => ( { | |||
type: ActionType.SET_SITE_TITLE as const, | |||
siteTitle, | |||
} ); | |||
|
|||
export const togglePageLayout = ( pageLayout: Template ) => ( { |
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.
I don't like toggle
as an action and prefer add
/remove
, but this is fine for now 🙂
Co-Authored-By: Jon Surrell <[email protected]>
Changes proposed in this Pull Request
[WIP] add selected design to storeAlready implemented in Update/gutenboarding hide next button in intent gathering step #38705.Testing instructions
Fixes one issue mentioned in #38583 (review)