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

State: Selector to get current route path and query #55313

Open
wants to merge 5 commits into
base: add/state-route-types
Choose a base branch
from

Conversation

chriskmnds
Copy link
Contributor

@chriskmnds chriskmnds commented Aug 10, 2021

Changes proposed in this Pull Request

Addresses #57109
Adds a new selector to get the current route path & query as a string e.g. test/url?foo=bar

Testing instructions

  • Unit tests

Fixes #57109

@chriskmnds chriskmnds added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 10, 2021
@chriskmnds chriskmnds self-assigned this Aug 10, 2021
@github-actions
Copy link

github-actions bot commented Aug 10, 2021

@matticbot
Copy link
Contributor

matticbot commented Aug 12, 2021

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

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

name         parsed_size           gzip_size
entry-login        -98 B  (-0.0%)      +27 B  (+0.0%)
entry-main         -63 B  (-0.0%)      +16 B  (+0.0%)

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

Sections (~45 bytes added 📈 [gzipped])

name               parsed_size           gzip_size
purchase-product         -35 B  (-0.0%)       +0 B
plans                    -35 B  (-0.0%)      +14 B  (+0.0%)
migrate                  -35 B  (-0.0%)       +1 B  (+0.0%)
media                    -35 B  (-0.0%)      +11 B  (+0.0%)
jetpack-connect          -35 B  (-0.0%)      +16 B  (+0.0%)
incoming-redirect        -35 B  (-0.4%)       -8 B  (-0.2%)
home                     -35 B  (-0.0%)      +11 B  (+0.0%)
accept-invite            -35 B  (-0.0%)      +11 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 (~130 bytes added 📈 [gzipped])

name                                               parsed_size           gzip_size
async-load-signup-steps-user                            +202 B  (+0.1%)     +106 B  (+0.2%)
async-load-design-blocks                                 -35 B  (-0.0%)      +16 B  (+0.0%)
async-load-calypso-post-editor-media-modal               -35 B  (-0.0%)       +9 B  (+0.0%)
async-load-calypso-post-editor-editor-media-modal        -35 B  (-0.0%)       +9 B  (+0.0%)
async-load-calypso-layout-guided-tours                   -35 B  (-0.4%)       +7 B  (+0.2%)

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.

@chriskmnds
Copy link
Contributor Author

Rebased over #55315, which provides the underlying types for the respective state slices.
@jsnajdr is this what you had in mind for a path?query selector?

@chriskmnds chriskmnds removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 25, 2021
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State [Status] In Progress [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants