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

Move adminInterface check to shouldShowGlobalSiteSidebar #87583

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

okmttdhr
Copy link
Member

@okmttdhr okmttdhr commented Feb 19, 2024

Related to https://github.com/Automattic/dotcom-forge/issues/5609

Proposed Changes

This pull request refactors the location of the adminInterface check, moving it into the shouldShowGlobalSiteSidebar function.
This change aims to streamline code by reducing the number of code seams. Previously implemented as a hook, the adminInterface check has been transformed into a selector, so it can now be utilized within both functional and connected components.

Testing Instructions

  • Open Calypso Live
  • Go to /sites, /read, /me and verify it shows Global View sidebar
  • Prepare a site with the classic view, and then go to a Calypso page (e.g., /home/your-site), verify it shows Global Site View sidebar

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

Copy link

github-actions bot commented Feb 19, 2024

@matticbot
Copy link
Contributor

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

Sections (~768 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
site-blocks                             +330 B  (+0.0%)     +108 B  (+0.0%)
security                                +330 B  (+0.0%)      +91 B  (+0.0%)
privacy                                 +330 B  (+0.0%)      +93 B  (+0.0%)
notification-settings                   +330 B  (+0.0%)      +87 B  (+0.0%)
me                                      +330 B  (+0.0%)      +92 B  (+0.0%)
help                                    +330 B  (+0.0%)      +59 B  (+0.0%)
developer                               +330 B  (+0.0%)      +83 B  (+0.0%)
account-close                           +330 B  (+0.0%)      +85 B  (+0.0%)
account                                 +330 B  (+0.0%)      +91 B  (+0.0%)
woocommerce-installation                +172 B  (+0.0%)      +70 B  (+0.1%)
woocommerce                             +172 B  (+0.1%)      +70 B  (+0.1%)
themes                                  +172 B  (+0.0%)      +70 B  (+0.0%)
theme                                   +172 B  (+0.0%)      +70 B  (+0.0%)
subscribers                             +172 B  (+0.0%)      +70 B  (+0.0%)
stats                                   +172 B  (+0.0%)      +70 B  (+0.0%)
sites-dashboard                         +172 B  (+0.0%)      +70 B  (+0.0%)
site-purchases                          +172 B  (+0.0%)      +70 B  (+0.0%)
site-monitoring                         +172 B  (+0.0%)      +70 B  (+0.0%)
settings-writing                        +172 B  (+0.0%)      +70 B  (+0.0%)
settings-security                       +172 B  (+0.0%)      +70 B  (+0.0%)
settings-reading                        +172 B  (+0.0%)      +70 B  (+0.1%)
settings-podcast                        +172 B  (+0.0%)      +70 B  (+0.0%)
settings-performance                    +172 B  (+0.0%)      +70 B  (+0.0%)
settings-newsletter                     +172 B  (+0.0%)      +70 B  (+0.0%)
settings-jetpack                        +172 B  (+0.0%)      +70 B  (+0.0%)
settings-discussion                     +172 B  (+0.0%)      +70 B  (+0.1%)
settings                                +172 B  (+0.0%)      +70 B  (+0.0%)
scan                                    +172 B  (+0.0%)      +70 B  (+0.0%)
purchases                               +172 B  (+0.0%)      +70 B  (+0.0%)
promote-post-i2                         +172 B  (+0.0%)      +70 B  (+0.1%)
preview                                 +172 B  (+0.1%)      +70 B  (+0.1%)
posts-custom                            +172 B  (+0.0%)      +70 B  (+0.0%)
posts                                   +172 B  (+0.0%)      +70 B  (+0.0%)
plugins                                 +172 B  (+0.0%)      +70 B  (+0.0%)
plans                                   +172 B  (+0.0%)      +70 B  (+0.0%)
people                                  +172 B  (+0.0%)      +70 B  (+0.0%)
pages                                   +172 B  (+0.0%)      +70 B  (+0.0%)
migrate                                 +172 B  (+0.0%)      +70 B  (+0.1%)
media                                   +172 B  (+0.0%)      +70 B  (+0.0%)
marketplace                             +172 B  (+0.0%)      +70 B  (+0.0%)
marketing                               +172 B  (+0.0%)      +70 B  (+0.0%)
jetpack-social                          +172 B  (+0.0%)      +70 B  (+0.1%)
jetpack-search                          +172 B  (+0.0%)      +70 B  (+0.0%)
jetpack-connect                         +172 B  (+0.0%)      +70 B  (+0.0%)
jetpack-cloud-settings                  +172 B  (+0.0%)      +70 B  (+0.0%)
jetpack-cloud-pricing                   +172 B  (+0.0%)      +70 B  (+0.0%)
jetpack-cloud-plugin-management         +172 B  (+0.0%)      +70 B  (+0.0%)
jetpack-cloud-overview                  +172 B  (+0.0%)      +70 B  (+0.0%)
jetpack-cloud-features-comparison       +172 B  (+0.0%)      +70 B  (+0.0%)
jetpack-cloud                           +172 B  (+0.0%)      +70 B  (+0.1%)
import                                  +172 B  (+0.0%)      +70 B  (+0.0%)
hosting                                 +172 B  (+0.0%)      +70 B  (+0.0%)
home                                    +172 B  (+0.0%)      +70 B  (+0.0%)
gutenberg-editor                        +172 B  (+0.0%)      +70 B  (+0.0%)
google-my-business                      +172 B  (+0.0%)      +70 B  (+0.0%)
github-deployments                      +172 B  (+0.0%)      +70 B  (+0.0%)
export                                  +172 B  (+0.0%)      +70 B  (+0.1%)
email                                   +172 B  (+0.0%)      +70 B  (+0.0%)
earn                                    +172 B  (+0.0%)      +70 B  (+0.0%)
domains                                 +172 B  (+0.0%)      +70 B  (+0.0%)
customize                               +172 B  (+0.0%)      +70 B  (+0.1%)
concierge                               +172 B  (+0.0%)      +70 B  (+0.0%)
comments                                +172 B  (+0.0%)      +70 B  (+0.0%)
checkout                                +172 B  (+0.0%)      +70 B  (+0.0%)
backup                                  +172 B  (+0.0%)      +70 B  (+0.0%)
add-ons                                 +172 B  (+0.0%)      +70 B  (+0.1%)
activity                                +172 B  (+0.0%)      +70 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.

Async-loaded Components (~96 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
async-load-calypso-reader-sidebar       +330 B  (+0.3%)      +96 B  (+0.3%)

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.
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.

@okmttdhr okmttdhr marked this pull request as ready for review February 19, 2024 06:01
@okmttdhr okmttdhr requested review from a team February 19, 2024 06:01
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 19, 2024
@okmttdhr
Copy link
Member Author

Merging this PR, as I need to use this selector in https://github.com/Automattic/dotcom-forge/issues/5628. Feel free to change it afterward.

@okmttdhr okmttdhr merged commit 0714648 into trunk Feb 19, 2024
18 checks passed
@okmttdhr okmttdhr deleted the update/global-sidebar-seam branch February 19, 2024 06:03
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants