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

Gutenboarding: Remove all unused bits and reorganize the rest #74475

Merged
merged 16 commits into from
Mar 17, 2023

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Mar 15, 2023

While working on #74399 I noticed that none of Gutenboarding is accessible, since it would always redirect to /start:

app.get( [ '/new', '/new/*' ], ( req, res ) => {
const lastPathSegment = req.path.substr( req.path.lastIndexOf( '/' ) + 1 );
const languageSlugs = getLanguageSlugs();
let redirectUrl = '/start';
if ( languageSlugs.includes( lastPathSegment ) && ! isDefaultLocale( lastPathSegment ) ) {
redirectUrl += `/${ lastPathSegment }`;
}
if ( Object.keys( req.query ) > 0 ) {
redirectUrl += `?${ stringify( req.query ) }`;
}
res.redirect( 301, redirectUrl );
} );

Regardless that we won't be using it, we are building the Gutenboarding entry point along with all of its code.

Might be easier to review on a per-commit basis, since all changes that aren't removals are in separate commits.

Proposed Changes

This PR removes the unused Gutenboarding entry point, along with all unused code from there.

The little remaining code is being moved where it is currently used and makes more sense.

Testing Instructions

  • Verify that you can't reach any Gutenboarding route (/new*)
  • Smoke test new user signup and existing user site creation flow.
  • Verify all checks are green.

@tyxla tyxla self-assigned this Mar 15, 2023
@matticbot
Copy link
Contributor

matticbot commented Mar 15, 2023

@tyxla tyxla changed the title Remove/gutenboarding Gutenboarding: Remove all unused bits Mar 15, 2023
@matticbot
Copy link
Contributor

matticbot commented Mar 15, 2023

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

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

name                   parsed_size             gzip_size
entry-gutenboarding     -2290401 B  (deleted)  -670069 B  (deleted)
entry-stepper              -8935 B    (-0.3%)    -5083 B    (-0.7%)
entry-login                -2089 B    (-0.2%)    -2111 B    (-0.6%)
entry-main                 -1971 B    (-0.1%)    -2119 B    (-0.5%)
entry-browsehappy           -273 B    (-0.3%)     -231 B    (-0.7%)
entry-domains-landing       -234 B    (-0.0%)     -175 B    (-0.1%)

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

Sections (~19467 bytes removed 📉 [gzipped])

name                        parsed_size           gzip_size
import-flow                    -85945 B  (-3.2%)   -24994 B  (-3.6%)
pattern-assembler-step         -85362 B  (-7.8%)   -24906 B  (-7.9%)
sites-dashboard                 +5621 B  (+1.1%)    +1734 B  (+1.0%)
hosting                         +5621 B  (+0.7%)    +1734 B  (+0.7%)
home                            +5278 B  (+0.4%)    +1711 B  (+0.5%)
settings                        +5064 B  (+0.6%)    +1561 B  (+0.6%)
gutenberg-editor                -4107 B  (-0.6%)    -1011 B  (-0.5%)
marketplace                      -941 B  (-0.1%)     -458 B  (-0.2%)
site-setup-flow                  -885 B  (-0.1%)      +56 B  (+0.0%)
account                          -737 B  (-0.1%)     -215 B  (-0.1%)
plugins                          -583 B  (-0.0%)      -88 B  (-0.0%)
media                            -583 B  (-0.0%)      -88 B  (-0.0%)
write-flow                       +412 B  (+0.2%)      +14 B  (+0.0%)
link-in-bio-tld-flow             +412 B  (+0.1%)      +14 B  (+0.0%)
link-in-bio-flow                 +412 B  (+0.1%)      +14 B  (+0.0%)
free-flow                        +412 B  (+0.1%)      +14 B  (+0.0%)
build-flow                       +412 B  (+0.2%)      +14 B  (+0.0%)
newsletter-post-setup-flow       -291 B  (-0.1%)     +319 B  (+0.5%)
plugin-bundle-flow               -285 B  (-0.3%)     +146 B  (+0.5%)
videopress-flow                  +251 B  (+0.1%)     -570 B  (-0.6%)
theme                            -237 B  (-0.0%)     -109 B  (-0.1%)
jetpack-connect                  -227 B  (-0.0%)     -191 B  (-0.1%)
themes                           -220 B  (-0.0%)     -112 B  (-0.0%)
people                           -199 B  (-0.0%)      -22 B  (-0.0%)
domains                          -199 B  (-0.0%)      -28 B  (-0.0%)
podcasts-flow                    -196 B  (-0.1%)     -405 B  (-0.7%)
plans                            -183 B  (-0.0%)      -74 B  (-0.0%)
jetpack-cloud-pricing            -183 B  (-0.0%)      -74 B  (-0.0%)
site-blocks                      -180 B  (-0.0%)      -21 B  (-0.0%)
purchases                        -180 B  (-0.0%)      -21 B  (-0.0%)
privacy                          -180 B  (-0.0%)      -21 B  (-0.0%)
notification-settings            -180 B  (-0.0%)      -21 B  (-0.0%)
me                               -180 B  (-0.0%)      -21 B  (-0.0%)
help                             -180 B  (-0.0%)      -21 B  (-0.0%)
happychat                        -180 B  (-0.0%)      -21 B  (-0.0%)
account-close                    -180 B  (-0.0%)      -21 B  (-0.0%)
devdocs                          +164 B  (+0.1%)      +22 B  (+0.0%)
stats                            -163 B  (-0.0%)      -41 B  (-0.0%)
sensei-flow                      +145 B  (+0.1%)     +323 B  (+0.4%)
preview                          +108 B  (+0.0%)      +18 B  (+0.0%)
posts-custom                     +108 B  (+0.0%)      +19 B  (+0.0%)
posts                            +108 B  (+0.0%)      +19 B  (+0.0%)
pages                            +108 B  (+0.0%)      +29 B  (+0.0%)
security                          +82 B  (+0.0%)     +460 B  (+0.2%)
signup                            -40 B  (-0.0%)      +63 B  (+0.1%)
accept-invite                     -40 B  (-0.0%)     -102 B  (-0.1%)
newsletter-flow                   +28 B  (+0.0%)     -519 B  (-0.2%)
with-theme-assembler-flow         -17 B  (-0.5%)       -3 B  (-0.2%)

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

name                                                                 parsed_size            gzip_size
async-load-calypso-lib-account-settings-helper                         -118300 B  (-26.2%)   -36115 B  (-25.7%)
async-load-calypso-lib-preferences-helper                              -105778 B  (-92.5%)   -32356 B  (-92.4%)
async-load-automattic-design-preview-src-components-style-variation     -87337 B   (-7.9%)   -25413 B   (-7.8%)
async-load-automattic-design-preview                                    -85764 B   (-8.2%)   -24965 B   (-8.2%)
async-load-design                                                        +4862 B   (+0.2%)    +1583 B   (+0.3%)
async-load-design-blocks                                                  -915 B   (-0.0%)     -222 B   (-0.0%)
async-load-design-playground                                              -759 B   (-0.0%)     -151 B   (-0.0%)
async-load-calypso-post-editor-media-modal                                -583 B   (-0.0%)      -88 B   (-0.0%)
async-load-calypso-post-editor-editor-media-modal                         -583 B   (-0.0%)      -88 B   (-0.0%)
async-load-quick-language-switcher                                        -557 B   (-0.2%)      -46 B   (-0.1%)
async-load-signup-steps-woocommerce-install-step-store-address            -484 B   (-0.2%)     +125 B   (+0.1%)
async-load-signup-steps-woocommerce-install-transfer                      -199 B   (-0.1%)      -19 B   (-0.0%)
async-load-signup-steps-woocommerce-install-step-business-info            -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-woocommerce-install-confirm                       -199 B   (-0.1%)      -23 B   (-0.0%)
async-load-signup-steps-woocommerce-install                               -199 B   (-0.1%)      -27 B   (-0.0%)
async-load-signup-steps-website-content                                   -199 B   (-0.1%)      -22 B   (-0.0%)
async-load-signup-steps-user                                              -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-theme-selection                                   -199 B   (-0.1%)      -26 B   (-0.0%)
async-load-signup-steps-test-step                                         -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-store-features                                    -199 B   (-0.1%)      -20 B   (-0.0%)
async-load-signup-steps-starting-point                                    -199 B   (-0.1%)      -20 B   (-0.0%)
async-load-signup-steps-social-profiles                                   -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-site-type                                         -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-site-title                                        -199 B   (-0.1%)      -24 B   (-0.0%)
async-load-signup-steps-site-picker                                       -199 B   (-0.1%)      -19 B   (-0.0%)
async-load-signup-steps-site-or-domain                                    -199 B   (-0.1%)      -20 B   (-0.0%)
async-load-signup-steps-site-options                                      -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-site                                              -199 B   (-0.1%)      -15 B   (-0.0%)
async-load-signup-steps-rewind-were-backing                               -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-rewind-migrate                                    -199 B   (-0.1%)      -20 B   (-0.0%)
async-load-signup-steps-rewind-form-creds                                 -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-reader-landing                                    -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-plans-pm                                          -199 B   (-0.0%)      -26 B   (-0.0%)
async-load-signup-steps-plans-atomic-store                                -199 B   (-0.1%)      -29 B   (-0.0%)
async-load-signup-steps-plans                                             -199 B   (-0.0%)      -26 B   (-0.0%)
async-load-signup-steps-page-picker                                       -199 B   (-0.1%)      -23 B   (-0.0%)
async-load-signup-steps-p2-site                                           -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-p2-join-workspace                                 -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-p2-get-started                                    -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-p2-details                                        -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-p2-confirm-email                                  -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-p2-complete-profile                               -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-new-or-existing-site                              -199 B   (-0.1%)      -20 B   (-0.0%)
async-load-signup-steps-intent                                            -199 B   (-0.1%)      -20 B   (-0.0%)
async-load-signup-steps-emails                                            -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-domains                                           -199 B   (-0.0%)      -26 B   (-0.0%)
async-load-signup-steps-difm-site-picker                                  -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-creds-permission                                  -199 B   (-0.1%)      -20 B   (-0.0%)
async-load-signup-steps-creds-confirm                                     -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-creds-complete                                    -199 B   (-0.1%)      -20 B   (-0.0%)
async-load-signup-steps-courses                                           -199 B   (-0.1%)      -22 B   (-0.0%)
async-load-signup-steps-clone-start                                       -199 B   (-0.1%)      -22 B   (-0.0%)
async-load-signup-steps-clone-ready                                       -199 B   (-0.1%)      -22 B   (-0.0%)
async-load-signup-steps-clone-point                                       -199 B   (-0.1%)      -23 B   (-0.0%)
async-load-signup-steps-clone-jetpack                                     -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-clone-destination                                 -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-clone-credentials                                 -199 B   (-0.1%)      -19 B   (-0.0%)
async-load-signup-steps-clone-cloning                                     -199 B   (-0.1%)      -21 B   (-0.0%)
async-load-signup-steps-add-ons                                           -199 B   (-0.1%)      -20 B   (-0.0%)
async-load-calypso-components-web-preview-component                       +196 B   (+0.0%)     +240 B   (+0.2%)
async-load-automattic-help-center                                         +196 B   (+0.0%)     +806 B   (+0.4%)
async-load-store-app-store-stats                                          -163 B   (-0.1%)      -41 B   (-0.1%)
async-load-calypso-my-sites-stats-stats-post-detail                       +108 B   (+0.3%)      +20 B   (+0.2%)
async-load-calypso-my-sites-site-settings-seo-settings-form               +108 B   (+0.0%)      +18 B   (+0.0%)
async-load-signup-steps-design-picker                                     +105 B   (+0.0%)     +949 B   (+1.2%)
async-load-design-wordpress-components-gallery                             +82 B   (+0.0%)    +1565 B   (+0.7%)
async-load-calypso-layout-masterbar-checkout-tsx                           -11 B   (-0.0%)       -8 B   (-0.0%)
async-load-calypso-blocks-inline-help-popover                              -11 B   (-0.0%)       -8 B   (-0.0%)

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.

@tyxla tyxla changed the title Gutenboarding: Remove all unused bits Gutenboarding: Remove all unused bits and reorganize the rest Mar 15, 2023
@tyxla tyxla marked this pull request as ready for review March 15, 2023 16:02
@tyxla tyxla requested a review from a team as a code owner March 15, 2023 16:02
@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 Mar 15, 2023
@tyxla tyxla requested review from a team March 15, 2023 16:03
@tyxla tyxla added the Stepper label Mar 15, 2023
@@ -24,3 +25,5 @@ export const USER_STORE = User.register( {
} );

export const AUTOMATED_ELIGIBILITY_STORE = AutomatedTransferEligibility.register();

export const PLANS_STORE = Plans.register();
Copy link
Contributor

Choose a reason for hiding this comment

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

Good example of how importing directly from the actual store is useful! This change probably wouldn't have been needed if the code was already using the new redux pattern :)

@Automattic Automattic deleted a comment from github-actions bot Mar 16, 2023
Copy link
Contributor

@noahtallen noahtallen left a comment

Choose a reason for hiding this comment

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

No concerns on my end!

That said, I'd love to get confirmation from the product side that gutenboarding is fully dead and that there aren't any future plans for it.

@tyxla tyxla force-pushed the remove/gutenboarding branch from a2cd29e to fb9fc7a Compare March 16, 2023 09:15
Copy link
Contributor

@worldomonation worldomonation left a comment

Choose a reason for hiding this comment

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

I know I'm not part of the reviewers list, but wanted to say thank you for going back and removing deprecated code. It's an underappreciated task.

I do not believe any E2E tests remain that uses Gutenboarding, but POMs do remain. I will create another PR based on this branch that cleans those POMs up.

Copy link
Member

@sirbrillig sirbrillig left a comment

Choose a reason for hiding this comment

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

I don't have any info on the usage of this flow, but from a Payments perspective, removing it is great! We've had to do a bunch of extra work to support Gutenboarding in addition to signup in past years so this would mean one fewer thing to maintain.

Copy link
Member

@alshakero alshakero left a comment

Choose a reason for hiding this comment

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

Did a quick sweep, and it's much easier to review than I thought! LGTM!

Disclaimer: I didn't test. Only reviewed.

Comment on lines +47 to +67
/*
* Parses the `anchor_podcast` parameter from a given URL.
* Returns `true` if provided URL is an anchor FM signup URL.
*/
function getIsAnchorFmSignup( urlString ) {
if ( ! urlString ) {
return false;
}

// Assemble search params if there is actually a query in the string.
const queryParamIndex = urlString.indexOf( '?' );
if ( queryParamIndex === -1 ) {
return false;
}
const searchParams = new URLSearchParams(
decodeURIComponent( urlString.slice( queryParamIndex ) )
);
const anchorFmPodcastId = searchParams.get( 'anchor_podcast' );
return Boolean( anchorFmPodcastId && anchorFmPodcastId.match( /^[0-9a-f]{7,8}$/i ) );
}

Copy link
Member

Choose a reason for hiding this comment

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

We have another one of these here. Maybe worth putting in the onboarding package.

Copy link
Member Author

Choose a reason for hiding this comment

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

Given that those are different functions, I preferred not to introduce additional dependencies to the Login block used in multiple places, but this is definitely something worth arranging at some point.

@alshakero
Copy link
Member

Not gonna lie, having spent months working on this, it breaks my heart a little.

@tyxla
Copy link
Member Author

tyxla commented Mar 17, 2023

Thank you all for taking a look 🙌

Not gonna lie, having spent months working on this, it breaks my heart a little.

I totally sympathize. It served us really well!

@tyxla tyxla merged commit ab04c34 into trunk Mar 17, 2023
@tyxla tyxla deleted the remove/gutenboarding branch March 17, 2023 08:10
@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 Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants