-
Notifications
You must be signed in to change notification settings - Fork 2k
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: Fix the previous step of the user step may be wrong #97775
base: trunk
Are you sure you want to change the base?
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
2c90218
to
d4fb88d
Compare
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: App Entrypoints (~5505 bytes added 📈 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~86088 bytes removed 📉 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
7ecc074
to
53eb109
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well for me as I get sent back to the design setup step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Arthur! One of the main reasons we built Stepper is to avoid the assumption of linearity.
When things are assumed to be linear, people come up with all kinds of (bad) contraptions to create non-linear scenarios. The design of extraData
, especially previousStep
is antithetical to the Stepper design, and should be removed. Luckily, only 2–3 flows use it and I will remove it soon.
Could you please give me the reproduction steps of the bug you are describing?
USER: { | ||
slug: 'user', | ||
asyncComponent: () => | ||
import( /* webpackChunkName: "stepper-user-step" */ './steps-repository/__user' ), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want the user step in the steps library. It's a private step that should only used by the framework itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes sense because there are some components know what's the user step and use hardcoded slug, user
, to determine whether it's a user step. It doesn't look like a private step. In addition, what's the benefit of making the user step private? If there is a flow that requires auth at the beginning, we can still make the user step to the first step explicitly.
const USER_STEP: StepperStep = { | ||
slug: 'user', | ||
asyncComponent: () => | ||
import( | ||
/* webpackChunkName: "stepper-user-step" */ '../declarative-flow/internals/steps-repository/__user' | ||
), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this please 🙏🏼
const extraData = { | ||
previousStep: stepData?.previousStep, | ||
nextStep: step.slug, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the extraData feature is a source of bugs and I was hoping we should remove it. Luckily, only 2-3 flows use it at this point. Adding state in general should be an elaborate and careful design. The main reason I prefer Stepper to Start is the statelessness. It would be amazing if we can come up with another way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the bug of the extraData
? I agreed we can remove it if it's not a great design or re-design the structure of the step data. However, I think it's an urgent issue for the onboarding flow and we can come up with a better solution in the future.
Here's an alternative take, let me know what you think! #97786 |
Sorry for not being clear. I've updated the description 🙏 |
Related to #
Proposed Changes
firstAuthWalledStep
andlastPreAuthWalledStep
to get the previous step before auth and the next step after auth. However, it made the flow become liner because both of them are the result of the linear search in the steps array. So, the previous step and the next step might be wrong.Why are these changes being made?
Testing Instructions
Pre-merge Checklist