Skip to content
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

Customer Home: explicitly exclude VIP sites from loading Customer Home #39090

Merged
merged 2 commits into from
Jan 28, 2020

Conversation

gwwar
Copy link
Contributor

@gwwar gwwar commented Jan 27, 2020

This PR makes sure that Customer Home will not load for VIP sites for now.

Testing Instructions

  • Try visiting /home with a new VIP site or with an older VIP site with the date check in /client/state/sites/selectors/can-current-user-use-customer-home.js commented out
  • Verify that the section does not load and redirects to stats

@gwwar gwwar added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] My Home The main dashboard for managing a WordPress.com site. labels Jan 27, 2020
@gwwar gwwar requested a review from a team January 27, 2020 21:27
@gwwar gwwar self-assigned this Jan 27, 2020
@matticbot
Copy link
Contributor

@kwight
Copy link
Contributor

kwight commented Jan 27, 2020

I expect this will also need handling in the site selector for the wordpress.com/home/ route, similar to #38184.

@gwwar
Copy link
Contributor Author

gwwar commented Jan 27, 2020

Good catch @kwight I can add that

@matticbot
Copy link
Contributor

matticbot commented Jan 27, 2020

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~17 bytes added 📈 [gzipped])

name        parsed_size           gzip_size
entry-main        +69 B  (+0.0%)      +17 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~774 bytes added 📈 [gzipped])

name                  parsed_size           gzip_size
zoninator                   +75 B  (+0.0%)      +18 B  (+0.0%)
wp-super-cache              +75 B  (+0.0%)      +18 B  (+0.0%)
woocommerce                 +75 B  (+0.0%)      +18 B  (+0.0%)
themes                      +75 B  (+0.0%)      +18 B  (+0.0%)
theme                       +75 B  (+0.0%)      +18 B  (+0.0%)
stats                       +75 B  (+0.0%)      +18 B  (+0.0%)
sites                       +75 B  (+0.1%)      +18 B  (+0.1%)
settings-writing            +75 B  (+0.0%)      +18 B  (+0.0%)
settings-security           +75 B  (+0.0%)      +18 B  (+0.0%)
settings-performance        +75 B  (+0.0%)      +18 B  (+0.0%)
settings-discussion         +75 B  (+0.0%)      +18 B  (+0.0%)
settings                    +75 B  (+0.0%)      +18 B  (+0.0%)
sensei                      +75 B  (+0.1%)      +18 B  (+0.1%)
purchases                   +75 B  (+0.0%)      +18 B  (+0.0%)
preview                     +75 B  (+0.1%)      +18 B  (+0.1%)
posts-custom                +75 B  (+0.0%)      +18 B  (+0.0%)
posts                       +75 B  (+0.0%)      +18 B  (+0.0%)
post-editor                 +75 B  (+0.0%)      +18 B  (+0.0%)
plugins                     +75 B  (+0.0%)      +18 B  (+0.0%)
plans                       +75 B  (+0.0%)      +18 B  (+0.0%)
people                      +75 B  (+0.0%)      +18 B  (+0.0%)
pages                       +75 B  (+0.0%)      +18 B  (+0.0%)
migrate                     +75 B  (+0.1%)      +18 B  (+0.1%)
media                       +75 B  (+0.0%)      +18 B  (+0.0%)
marketing                   +75 B  (+0.0%)      +18 B  (+0.0%)
jetpack-connect             +75 B  (+0.0%)      +18 B  (+0.0%)
import                      +75 B  (+0.0%)      +18 B  (+0.0%)
hosting                     +75 B  (+0.0%)      +18 B  (+0.0%)
home                        +75 B  (+0.0%)      +18 B  (+0.0%)
hello-dolly                 +75 B  (+0.1%)      +18 B  (+0.1%)
gutenberg-editor            +75 B  (+0.0%)      +18 B  (+0.0%)
google-my-business          +75 B  (+0.0%)      +18 B  (+0.0%)
feature-upsell              +75 B  (+0.1%)      +18 B  (+0.1%)
export                      +75 B  (+0.0%)      +18 B  (+0.0%)
email                       +75 B  (+0.0%)      +18 B  (+0.0%)
earn                        +75 B  (+0.0%)      +18 B  (+0.0%)
domains                     +75 B  (+0.0%)      +18 B  (+0.0%)
customize                   +75 B  (+0.0%)      +18 B  (+0.0%)
concierge                   +75 B  (+0.0%)      +18 B  (+0.0%)
comments                    +75 B  (+0.0%)      +18 B  (+0.0%)
checkout                    +75 B  (+0.0%)      +18 B  (+0.0%)
checklist                   +75 B  (+0.0%)      +18 B  (+0.0%)
activity                    +75 B  (+0.0%)      +18 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@gwwar
Copy link
Contributor Author

gwwar commented Jan 27, 2020

@kwight added in 233fa8c though I did notice we don't filter appropriately using the site switcher component. That one looks incorrect for other sections too so we can fix those in a follow up.

Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@@ -3887,5 +3894,19 @@ describe( 'selectors', () => {
canCurrentUserUseCustomerHome( createState( { created_at: '2020-01-01', jetpack: true } ) )
).toBe( false );
} );

test( 'should return false for VIP site', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these tests ❤️

@gwwar
Copy link
Contributor Author

gwwar commented Jan 28, 2020

Thanks for the reviews @mmtr @kwight !

@gwwar gwwar merged commit d077255 into master Jan 28, 2020
@gwwar gwwar deleted the fix/customer-home-vip branch January 28, 2020 16:43
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] My Home The main dashboard for managing a WordPress.com site.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants