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

Adding new assembler flow #72747

Merged
merged 7 commits into from
Jan 31, 2023
Merged

Adding new assembler flow #72747

merged 7 commits into from
Jan 31, 2023

Conversation

bangank36
Copy link
Contributor

@bangank36 bangank36 commented Jan 29, 2023

Proposed Changes

Testing Instructions

  • Checkout this branch, if you are using calypso live link, open the browser console and run this to make sure the feature flag is enabled document.cookie = 'flags=pattern-assembler/logged-out-showcase;max-age=1209600;path=/'
  • Log out from your wp account
  • Access theme showcase via /themes
  • Select blank-canvas-3 theme and confirm that /patternAssembler step is shown after finishing site creation
  • Select other theme and confirm that the end of flow is /home
Blank Canvas Card
Large screen ( > 960px )
Blank Canvas Card
Small Screen
Other Card
GbkUzH.mp4
dzfFfc.mp4
TQLgEA.mov

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests 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-ajp-p2)?

Reference

Related to #71706
Detailed post pbxlJb-3oe-p2

@bangank36 bangank36 self-assigned this Jan 29, 2023
@github-actions
Copy link

github-actions bot commented Jan 29, 2023

@matticbot
Copy link
Contributor

matticbot commented Jan 29, 2023

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

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

name                   parsed_size           gzip_size
entry-stepper               +290 B  (+0.0%)     +145 B  (+0.0%)
entry-main                  +114 B  (+0.0%)      +86 B  (+0.0%)
entry-login                 +114 B  (+0.0%)      +91 B  (+0.0%)
entry-domains-landing       +114 B  (+0.0%)      +91 B  (+0.1%)
entry-browsehappy           +114 B  (+0.1%)      +91 B  (+0.3%)
entry-gutenboarding          -38 B  (-0.0%)      -92 B  (-0.0%)

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

Sections (~7146 bytes added 📈 [gzipped])

name                  parsed_size           gzip_size
site-assembler-flow      +27173 B    (new)    +6645 B    (new)
site-setup-flow            +771 B  (+0.0%)     +129 B  (+0.0%)
import-flow                +771 B  (+0.0%)     +129 B  (+0.0%)
signup                     +611 B  (+0.2%)     +219 B  (+0.3%)
jetpack-connect            +611 B  (+0.1%)     +219 B  (+0.1%)
accept-invite              +611 B  (+0.2%)     +219 B  (+0.3%)
write-flow                 +559 B  (+0.2%)     +193 B  (+0.4%)
videopress-flow            +559 B  (+0.1%)     +193 B  (+0.2%)
newsletter-flow            +559 B  (+0.1%)     +193 B  (+0.2%)
link-in-bio-tld-flow       +559 B  (+0.1%)     +193 B  (+0.1%)
link-in-bio-flow           +559 B  (+0.1%)     +193 B  (+0.1%)
free-flow                  +559 B  (+0.2%)     +193 B  (+0.3%)
build-flow                 +559 B  (+0.2%)     +193 B  (+0.4%)
stats                       +52 B  (+0.0%)      +26 B  (+0.0%)
plugins                     +52 B  (+0.0%)      +25 B  (+0.0%)
plans                       +52 B  (+0.0%)      +24 B  (+0.0%)
marketplace                 +52 B  (+0.0%)      +27 B  (+0.0%)
domains                     +52 B  (+0.0%)      +26 B  (+0.0%)
checkout                    +52 B  (+0.0%)      +25 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 (~1158 bytes removed 📉 [gzipped])

name                                              parsed_size           gzip_size
async-load-pattern-list-renderer                     +37356 B  (+3.7%)   +11552 B  (+3.8%)
async-load-pattern-large-preview                     +37356 B  (+3.7%)   +11552 B  (+3.8%)
async-load-pattern-assembler-container               +37356 B  (+3.7%)   +11552 B  (+3.8%)
async-load-automattic-design-preview                   -334 B  (-0.0%)     -219 B  (-0.1%)
async-load-design-blocks                                +52 B  (+0.0%)      +25 B  (+0.0%)
async-load-calypso-layout-masterbar-checkout-tsx        +52 B  (+0.0%)      +24 B  (+0.1%)
async-load-calypso-layout-masterbar-checkout            +52 B  (+0.1%)      +25 B  (+0.1%)
async-load-calypso-blocks-editor-checkout-modal         +52 B  (+0.0%)      +22 B  (+0.0%)
async-load-design-wordpress-components-gallery          -13 B  (-0.0%)      -43 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.

@bangank36 bangank36 requested a review from a team January 29, 2023 23:36
@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 Jan 29, 2023
@bangank36 bangank36 requested a review from mmtr January 29, 2023 23:36
};

const submit = ( providedDependencies: ProvidedDependencies = {} ) => {
recordSubmitStep( providedDependencies, '', flowName, _currentStep );
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to introduce new intent for the site assembler flow? Or is the flow name enough for tracking cc @autumnfjeld

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the flow name should be enough for now cc: @autumnfjeld

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@arthur791004 I think we can leave this as it is and address it on metrics issue, how do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great!

Copy link
Contributor

Choose a reason for hiding this comment

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

We have discussed the topic of intent in a few different places:

  • p1671807817094079/1671770959.129519-slack-CRWCHQGUB
  • pbxlJb-3bS-p2#comment-2201
  • p1673498055131429-slack-C048CUFRGFQ

The problem with using intent=assembler is that we can't keep track of the build and write intent if we overwrite it with assembler. And the write intent is used in My Home to conditionally show content. Thus, we have some constraints we must respect.

Can you point to all the different flowName options we have? To give me a sense of where else flow is used.

Is it this same flow. And these are all the flow possibilities?

image

I'm worried we are using flow in two different ways:

  • stepper flow definition
  • singup flow definition (e.g. when flow=onboarding)
  • maybe these are all compatible?
  • see FigJam (which I didn't yet update! oops!)

image

Copy link
Contributor

Choose a reason for hiding this comment

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

I started a new metrics map for the logged out PA flow. Let's fill in all the items correctly:

image

Copy link
Contributor

@arthur791004 arthur791004 left a comment

Choose a reason for hiding this comment

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

Tested and look good to me 👍

@miksansegundo miksansegundo requested a review from a team January 30, 2023 09:40
@Copons Copons requested a review from a team January 30, 2023 10:42
Copy link
Contributor

@miksansegundo miksansegundo left a comment

Choose a reason for hiding this comment

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

The changes work well 👍. Great job!

We could find a clearer name for the flow. See my suggestions. @Automattic/lego any better ideas?

This new flow will be triggered from a theme switch and also from an empty theme search (see Themes: Improve the Empty Search Results Screen) and possibly from other places where we want to help users create their own theme from scratch.

image

@@ -13,6 +13,8 @@ export const MIGRATION_FLOW = 'import-focused';
export const COPY_SITE_FLOW = 'copy-site';
export const BUILD_FLOW = 'build';
export const WRITE_FLOW = 'write';
export const SITE_ASSEMBLER_FLOW = 'site-assembler';
Copy link
Contributor

Choose a reason for hiding this comment

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

I find the new flow name confusing:

  • /setup/site-assembler/patternAssembler - Used for a theme switch or an empty theme search.
  • /setup/site-setup/patternAssembler - Used for the onboarding flow.

Can we find a clearer name?

  • Maybe /setup/site-theme/patternAssembler
  • Maybe /setup/site-design/patternAssembler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

site-theme does not make sense to me, and site-design sounds like it more focus on the visualization of the site, and not include the content
I think this is not blocker though, will bring this up on tomorrow's sync
cc: @Automattic/lego

Copy link
Contributor

@autumnfjeld autumnfjeld Jan 31, 2023

Choose a reason for hiding this comment

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

Why are we mixing snake-case and camelCase? This seems wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the current setup for the names I think
snake-case is for the flow name, while camelCase is used for step name.
eg: /setup/site-setup/designSetup

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you. I was just realizing that, going to other steps, like https://wordpress.com/setup/site-setup/designSetup

Copy link
Contributor

Choose a reason for hiding this comment

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

For flows coming from the Theme Showcase, maybe to be cohesive with with-theme
https://wordpress.com/start/with-theme/user?ref=calypshowcase&theme=upsidedown:

/setup/with-assembler/patternAssembler

Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear, we need two path names, where the differentiation in path name is

  • logged-in -> theme switch PA flow
  • logged-out -> onboarding PA flow

Copy link
Contributor Author

@bangank36 bangank36 Jan 31, 2023

Choose a reason for hiding this comment

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

CMIIW, but adding 2 path names means we have to create 2 flows in the Stepper Framework

@miksansegundo
Copy link
Contributor

BTW. When testing this PR, I found a critical issue, not on production, and it seems not related to these changes. Can you confirm? @bangank36

When switching to any theme preserving the homepage within the logged-in showcase, the API /themes/mine returns an error 500 when the passing dont_change_homepage: true.

Screenshot 2566-01-30 at 16 56 53

Screenshot 2566-01-30 at 16 55 48

Screenshot 2566-01-30 at 16 55 29

@bangank36
Copy link
Contributor Author

Can you confirm? @bangank36

@miksansegundo I can reproduce the issue, I also think it is not related to this PR, since I was testing this issue on trunk
It should be something wrong with persistent template on theme switch, which is enabled via this flag themes/theme-switch-persist-template
Disable the flag via ?flags=-themes/theme-switch-persist-template makes the issue gone, I think we should create an issue to investigate this. In the mean time, we should set the flag themes/theme-switch-persist-template to false on all enviroment

@autumnfjeld
Copy link
Contributor

autumnfjeld commented Jan 31, 2023

I think we should create an issue to investigate this

Thank you.
An issue to add to the theme switch view https://github.com/orgs/Automattic/projects/338/views/35

@bangank36
Copy link
Contributor Author

I did the final test before merging

f868Oq.mov

@bangank36 bangank36 merged commit 6aff82f into trunk Jan 31, 2023
@bangank36 bangank36 deleted the add/assembler-flow branch January 31, 2023 05:36
@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 Jan 31, 2023
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.

5 participants