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

Stepper: Move conservative lazy loading and optimize masterbar styles #97326

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

alshakero
Copy link
Member

@alshakero alshakero commented Dec 11, 2024

Related context: p1715786768590259-slack-C7YPUHBB2

Proposed Changes

  • Stepper now loads every step the moment it loads. The intention was to lazy-load them to prevent showing the glowing WordPress logo during the flow. But apparently, the loading was not lazy enough and it was slowing other more important things down, like LCP. This makes Stepper only cache the next step1.
  • The masterbar loaded dashicons everywhere, even though they're only used when logged in. Loading these icons is very slow (500-800ms damage to the largest contentful paint).
  • Don't wait for the geolocating request before rendering Stepper.

1 Stepper is non-linear, so the next step is undefined, but most likely it is the next step in the flows set defined in the flow.

Why are these changes being made?

To improve UX.

Testing steps

  1. Smoke test /setup/onboarding.
  2. Smoke test /Home and make sure the masterbar looks good.

@alshakero alshakero requested a review from a team as a code owner December 11, 2024 12:04
@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 Dec 11, 2024
@matticbot
Copy link
Contributor

matticbot commented Dec 11, 2024

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

App Entrypoints (~14 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
entry-stepper               -272 B  (-0.0%)      -14 B  (-0.0%)
entry-subscriptions         -249 B  (-0.0%)      -49 B  (-0.0%)
entry-main                  -249 B  (-0.0%)      -49 B  (-0.0%)
entry-login                 -249 B  (-0.0%)      -49 B  (-0.0%)
entry-domains-landing       -249 B  (-0.0%)      -49 B  (-0.0%)
entry-browsehappy           -249 B  (-0.1%)      -49 B  (-0.1%)

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

Sections (~31038 bytes added 📈 [gzipped])

name               parsed_size         gzip_size
stepper-user-step     +97637 B  (new)   +31038 B  (new)

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.

@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug stepper/more-conservaative-lazy-load on your sandbox.

@alshakero alshakero changed the title Stepper: Move conservative lazy loading Stepper: Move conservative lazy loading and optimize masterbar styles Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[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.

2 participants