-
Notifications
You must be signed in to change notification settings - Fork 5k
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
UX: Load the extension HTML pages and background with async JavaScript #20843
Conversation
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. |
8b407dc
to
46604aa
Compare
70358b6
to
ab73693
Compare
45b8562
to
ccef0c8
Compare
e558a10
to
696c60c
Compare
Builds ready [2554c62]
Page Load Metrics (633 ± 350 ms)
Bundle size diffs
|
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## develop #20843 +/- ##
========================================
Coverage 68.40% 68.40%
========================================
Files 1006 1006
Lines 40218 40218
Branches 10758 10758
========================================
Hits 27508 27508
Misses 12710 12710 ☔ View full report in Codecov by Sentry. |
2554c62
to
9c4f387
Compare
Builds ready [c61c0c8]
Page Load Metrics (1856 ± 72 ms)
Bundle size diffs
|
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.
hell yes
applyLavaMoat, | ||
isMMI: buildType === 'mmi', | ||
}); | ||
renderJavaScriptLoader({ | ||
groupSet, | ||
commonSet, | ||
browserPlatforms, | ||
applyLavaMoat, |
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.
ok to remove the mmi line?
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.
Unfortunately not because of this code in the home.html
file:
{{@if(it.isMMI)}}
<title>MetaMask Institutional</title>
{{/if}}
Explanation
At present the loading of both the fullscreen view and MetaMask popup are really slow due to the loading of ~15-20 synchronous JavaScript files in
home.html
,popup.html
, andnotification.html
. Our users experience this slowness most notably when clicking on the MetaMask icon in the extensions toolbar -- the click happens, then nothing for seemingly 1-2 seconds, and then the popup finally renders the user's wallet.This PR loads both the UI and background scripts (1) sequentially and (2) asynchronously, drastically improving perceived performance. Now when clicking the MetaMask extension icon, the popup displays immediately, shows a spinner while the scripts load, and then load in the UI.
Screenshots/Screencaps
FastLoad.mov
Manual Testing Steps
yarn start
Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Board
label.In this case, a QA Engineer approval will be be required.