metamask-extension
metamask-extension copied to clipboard
feat: Skip wallet onboarding for developers
Description
- Implements a new development build script that skips onboarding by preloading state from the end-to-end test fixtures.
- The vault state is dynamically generated from the environment variables
TEST_SRP
andPASSWORD
. - This build hides all the "What's New?" modals and the "Product Tour" as well as all onboarding screens.
- The network is set to "Sepolia" by default.
- Alternatively, onboarding can be skipped without setting a
TEST_SRP
, in which case the e2e tests SRP and accounts are used.
Related issues
Related: #23615, #19389
Manual testing steps
- Checkout this branch
- Set a
TEST_SRP
environment variable on your.metamaskrc
file as well asPASSWORD
if you haven't already - Run
yarn start:skip-onboarding
- Load the extension on your favorite browser and open the popup
Screenshots/Recordings
After
https://github.com/MetaMask/metamask-extension/assets/13814744/e34bac0f-8f6f-4d04-8452-b9962c99cfb9
Pre-merge author checklist
- [x] I’ve followed MetaMask Coding Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
Pre-merge reviewer checklist
- [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
- [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.
hey cool idea :rocket: I think we could add a section in the README about this script. Somewhere here maybe? Also, adding a couple of comments (no-changes needed) but maybe this could also be useful to clarify in the documentation.
- it seems to work only with fresh installs: if I have an older wallet instance and I re-build with a new SRP, I see the old wallet accounts and if I generate new accounts, it's using the old SRP
https://github.com/MetaMask/metamask-extension/assets/54408225/ad40b554-f250-4b94-a229-ccf068a05fe7
- it loads only 1 Account, despite having more balance in subsequent accounts (similarly as in the e2e). Usually in regular builds, we load as many accounts as they have balance, in the following way:
- Account1 is loaded
- Account2 has balance -- is loaded
- Account3 has balance --is loaded
- Account4 doesn't have balance -- it is not loaded and we stop loading accounts at this point, no matter if the next account has balance
However, I think for the purposes of this script, it's totally fine to load only 1 account.
LGTM ! Thanks for the changes, gonna be such a life-changing
Builds ready [c44d152]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (530 ± 438 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 67 | 566 | 118 | 104 | 50 |
domContentLoaded | 8 | 33 | 12 | 6 | 3 | ||
load | 52 | 2414 | 530 | 912 | 438 | ||
domInteractive | 8 | 33 | 12 | 6 | 3 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 7.74 KiB (0.22%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)