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

Remove editor import in gutenboard #41411

Merged
merged 1 commit into from
Apr 24, 2020

Conversation

sgomes
Copy link
Contributor

@sgomes sgomes commented Apr 23, 2020

Looks like this legacy import is no longer needed.

This was severely impacting Gutenboarding entry point size, inflating it by ~670KB uncompressed, or ~140KB gzipped!! (two exclamation marks required)
It was pulling in a number of large components and dependencies, e.g. date picking stuff.

Local testing seems to indicate everything works fine after removal, as I was able to complete the creation process up until the full editor popped up.

Changes proposed in this Pull Request

  • Remove unnecessary @wordpress/editor import

Testing instructions

Ensure that Gutenboarding continues to work normally. Team Luna will know a lot better than me exactly what that entails 🙂

The comment said it shouldn't be necessary. The comment was right,
it wasn't.
@sgomes sgomes added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Performance [Goal] New Onboarding previously called Gutenboarding labels Apr 23, 2020
@sgomes sgomes requested a review from a team April 23, 2020 16:55
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

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

Webpack Runtime (~109 bytes added 📈 [gzipped])

name      parsed_size           gzip_size
manifest       +606 B  (+0.3%)     +109 B  (+0.3%)

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 (~150071 bytes removed 📉 [gzipped])

name                   parsed_size            gzip_size
entry-gutenboarding      -688744 B  (-29.1%)  -149663 B  (-24.5%)
entry-main                  -154 B   (-0.0%)     +171 B   (+0.0%)
entry-domains-landing       -142 B   (-0.0%)     -503 B   (-0.3%)
entry-login                 +111 B   (+0.0%)      -76 B   (-0.0%)

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

Sections (~2412 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
gutenberg-editor           -3947 B  (-0.5%)     -711 B  (-0.3%)
checkout                   -1508 B  (-0.1%)     -407 B  (-0.1%)
settings                    +204 B  (+0.0%)      +29 B  (+0.0%)
settings-writing            +192 B  (+0.0%)     -295 B  (-0.3%)
posts-custom                -172 B  (-0.1%)     -473 B  (-0.6%)
posts                       -172 B  (-0.1%)     -473 B  (-0.6%)
post-editor                  +91 B  (+0.0%)      -76 B  (-0.0%)
devdocs                      +53 B  (+0.0%)       -3 B  (-0.0%)
marketing                    +39 B  (+0.0%)      +21 B  (+0.0%)
stats                        -36 B  (-0.0%)       -8 B  (-0.0%)
pages                        +33 B  (+0.0%)      +20 B  (+0.0%)
earn                         -30 B  (-0.0%)       -5 B  (-0.0%)
themes                       -24 B  (-0.0%)      -12 B  (-0.0%)
reader                       -24 B  (-0.0%)       -6 B  (-0.0%)
plans                        +18 B  (+0.0%)      +63 B  (+0.1%)
people                       -18 B  (-0.0%)       -5 B  (-0.0%)
comments                     -18 B  (-0.0%)       -4 B  (-0.0%)
woocommerce                  -12 B  (-0.0%)      -24 B  (-0.0%)
site-blocks                  -12 B  (-0.0%)       -2 B  (-0.0%)
plugins                      -12 B  (-0.0%)      -54 B  (-0.1%)
notification-settings        -12 B  (-0.0%)       -3 B  (-0.0%)
import                       -12 B  (-0.0%)       -4 B  (-0.0%)
google-my-business           -12 B  (-0.0%)       -3 B  (-0.0%)
email                        +12 B  (+0.0%)      +23 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 (~2358 bytes removed 📉 [gzipped])

name                                                         parsed_size           gzip_size
async-load-post-editor-media-modal                                +221 B  (+0.1%)     +288 B  (+0.4%)
async-load-design-blocks                                          -153 B  (-0.0%)     -165 B  (-0.0%)
async-load-design-playground                                       +85 B  (+0.0%)     -851 B  (-0.2%)
async-load-design                                                  +27 B  (+0.0%)    -1607 B  (-0.4%)
async-load-signup-steps-domains                                    -18 B  (-0.0%)       -5 B  (-0.0%)
async-load-extensions-woocommerce-app-store-stats-referrers        -12 B  (-0.0%)       -5 B  (-0.0%)
async-load-components-web-preview-component                        -12 B  (-0.0%)       -4 B  (-0.0%)
async-load-lib-preferences-helper                                  -11 B  (-0.1%)       -9 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.

@simison simison requested a review from a team April 23, 2020 18:06
@simison
Copy link
Member

simison commented Apr 23, 2020

Background for this in WordPress/gutenberg#19893

@simison simison closed this Apr 23, 2020
@simison simison reopened this Apr 23, 2020
@simison
Copy link
Member

simison commented Apr 23, 2020

Oops. :-)

@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 Apr 23, 2020
Copy link
Contributor

@ockham ockham left a comment

Choose a reason for hiding this comment

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

Still working well! 🎉

Thanks a ton @sgomes, I'd kinda forgotten about this one 😅

@sirreal
Copy link
Member

sirreal commented Apr 24, 2020

I like to keep these around for you, @sgomes, because I know how much pleasure you get from knocking 140KB out of our bundle 😉

Thanks!

@sirreal sirreal merged commit 6823c60 into master Apr 24, 2020
@sirreal sirreal deleted the update/remove-editor-import-from-gutenboarding branch April 24, 2020 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] New Onboarding previously called Gutenboarding [Type] Performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants