-
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: FSE launch store and flow #43983
Conversation
- Use only explicitly declared props - Connect to launch store - Add onSelect prop to advance when selecting an option - Use matching store keys and remove any store registration
- add useSite and useOnLaunch hooks - add onSubmit prop to Launch and call it when reaching last step - add isLaunching state to launch-button - add isLaunching prop to launch-modal and use it to render launching animation and custom title
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~147 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~52 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~8 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. 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. |
Caution: This PR affects files in the FSE Plugin on WordPress.com D46096-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 |
aria-haspopup="menu" | ||
onClick={ handleClick } | ||
> | ||
{ __( 'Launch site', 'full-site-editing' ) } |
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.
ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 23 times:
translate( 'Launch site' )
ES Score: 13
- add temporary getCart and setCart action to @data-stores/site - handle cart setting and redirect to checkout in useOnLaunch hook
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.
Reviewed the code. All LGTM! Testing now.
import reducer, { State } from './reducer'; | ||
import * as actions from './actions'; | ||
import * as selectors from './selectors'; | ||
import persistOptions from './persist'; |
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.
This has been discussed before, this adds a lot of code and only to limit the persistence duration to 1 week. If you want it like that, that's cool. If not, removing this, and use
would be cleaner IMO.
@@ -24,7 +26,9 @@ export default function DomainPickerButton() { | |||
aria-pressed={ isDomainModalVisible } | |||
onClick={ () => setDomainModalVisibility( ( s ) => ! s ) } | |||
> | |||
<span className="domain-picker-button__label">{ `Domain: ${ currentDomain.domain_name }` }</span> | |||
<span className="domain-picker-button__label">{ `Domain: ${ | |||
domain?.domain_name || freeDomain |
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.
Nit: optional chaining goes nicely with null coalescing
domain?.domain_name || freeDomain | |
domain?.domain_name ?? freeDomain |
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.
Tested every scenario and all work as stated. 🚢
Changes proposed in this Pull Request
/home
./home
./checkout
=> redirect to/home
.Testing instructions
Setup
define( 'A8C_FSE_SITE_LAUNCH_ENABLE', true );
to./config/sandbox.php
.yarn dev --sync
on your localapps\full-site-editing folder
.Scenario 1
/home
.Scenario 2
/home
.Scenario 3
/checkout
=> redirect to/home
when completing purchase or abandoning cart.Follow up
@data-stores/site
@data-stores/site
into a dedicatedcart
data-storeFixes part of #43750