-
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
My Home: Try Home Layout i1. #41000
My Home: Try Home Layout i1. #41000
Conversation
{ React.createElement( cardComponents[ stats ], { | ||
checklistMode: stats === 'home-primary-checklist-site-setup' ? checklistMode : null, | ||
} ) } | ||
<h2>{ translate( 'Learn and grow' ) }</h2> |
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 19 times:
translate( 'Learn and grow with My Home' )
ES Score: 6
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Webpack Runtime (~16 bytes added 📈 [gzipped])
Webpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded. App Entrypoints (~2 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~16957 bytes removed 📉 [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 (~4744 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. |
One of the first questions that comes up is, where do we get the section headings from (eg. "Learn and grow")? If we handle them in the client (as is done here), the translations are handled in Calypso, but we're kinda breaking our guiding idea that the client is just mindlessly rendering whatever the API passes to it (well, at least we're making assumptions in the client of what content we'll be rendering). The headings could be translated on the server and sent by API based on a key to the section, but... that also feels weird and fragile. That would need more nested view arrays, I think: I can't decide if I like the idea of keeping the API responses just one level deep as they are now, and having the client would cut them up, like this PR does. It would depend on how much we anticipate the location sections changing; if we always have a stats card, it seems a premature optimization to make sure that can all be handled server-side. |
My intuition is that keeping the client pretty simple would be ideal. We may need to break up the abstractions further. For example instead of just locations, do we specify the pages/tasks to render for a component. Let's play around a bit to see what feels best. I'm also running into a similar problem for if we pick some sort of pager for educational cards. It could be that these turn into another "location/container" |
I like that. I think the API should treat each section with a header as a location.
Note that I deliberately not used current locations names so we can add the new layout to the endpoint without breaking existing behavior. Calypso would decide then how to render each section:
EDIT: Pushed an update to D41677-code exploring what the API response looks like returning all these new locations. We need to update now this PR to handle them. EDIT2: Just pushed a commit to this PR demonstrating how to use the new locations. |
@@ -16,7 +16,7 @@ const cardComponents = { | |||
'home-banner-legacy-stats-banners': StatsBanners, | |||
}; | |||
|
|||
const Upsells = ( { cards, primary, siteId, slug } ) => { | |||
const Tasks = ( { cards, primary, siteId, 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.
Just a heads up that I started something for Tasks in #41018 :)
|
||
return ( | ||
<> | ||
<h2>{ translate( 'Learn and grow' ) }</h2> |
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 19 times:
translate( 'Learn and grow with My Home' )
ES Score: 6
@@ -58,6 +58,10 @@ | |||
@include grid-template-columns( 12, 24px, 1fr ); | |||
grid-gap: 24px; | |||
} | |||
|
|||
h2 { | |||
font-family: 'Recoleta', serif; |
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.
We'll need to download the font, we can maybe check in to see how Gutenboarding is doing it. There are some performance considerations here as we do it, so we can maybe consult perfops on best practices.
I think this is starting to come together nicely @kwight @mmtr , I left some notes on the backend patch and asked a few clarifying questions for requirements in related thread. Here's a snapshot of WIP for the branch: Some next steps/tasks in misc order (I'll file issues).
|
|
||
return ( | ||
<> | ||
<h2>{ translate( 'Learn and grow' ) }</h2> |
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 19 times:
translate( 'Learn and grow with My Home' )
ES Score: 6
dc2639c
to
375d4ac
Compare
<EducationalCard | ||
header={ translate( 'The WordPress.com free photo library' ) } | ||
text={ translate( | ||
'Our free photo library integrates your site with over 40,000 beautiful copyright-free photos to create stunning designs.' |
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 20 times:
translate( 'The WordPress.com Free Photo Library integrates your site with beautiful copyright-free photos to create stunning designs.' )
ES Score: 8
return ( | ||
<> | ||
<h2 className="learn-grow__heading customer-home__section-heading"> | ||
{ translate( 'Learn and grow' ) } |
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 19 times:
translate( 'Learn and grow with My Home' )
ES Score: 6
@kwight I think we can close this one out? Please reopen if we still need this |
This PR explores what changes we need to make for something like My Home Layout i1.
See: pbAPfg-g0-p2
Testing instructions
/home/:site
with an prelaunch, launched and established site and observe the layout.