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

Refactor: [WalletConnect] lazy-load based on feature toggle #3047

Merged
2 commits merged into from
Dec 21, 2023
Merged

Refactor: [WalletConnect] lazy-load based on feature toggle #3047

2 commits merged into from
Dec 21, 2023

Conversation

katspaugh
Copy link
Member

@katspaugh katspaugh commented Dec 21, 2023

What it solves

WalletConnect code is now dynamically imported only if the feature is enabled.

Unfortunately, the large @walletconnect/ethereum-provider package still gets bundled with the main chunk because of the web3-onboard module that imports it statically. Fixed here.

Copy link

github-actions bot commented Dec 21, 2023

Branch preview

✅ Deploy successful!

https://lazy_wc--walletweb.review-wallet-web.5afe.dev

Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 1.32 MB (🟢 -138.47 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Seventeen Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/apps 125.32 KB (🔴 +89.36 KB) 1.45 MB
/apps/custom 116.78 KB (🔴 +89.35 KB) 1.44 MB
/apps/open 125.31 KB (🔴 +98.42 KB) 1.45 MB
/balances/nfts 20.46 KB (🟡 +1.74 KB) 1.34 MB
/home 150.42 KB (🔴 +89.33 KB) 1.47 MB
/new-safe/create 13.76 KB (🟡 +1.74 KB) 1.34 MB
/new-safe/load 9 KB (🟡 +1.66 KB) 1.33 MB
/settings/safe-apps 100.41 KB (🔴 +88.19 KB) 1.42 MB
/share/safe-app 10.45 KB (🟡 +1.08 KB) 1.33 MB
/transactions 53 KB (🟡 +77 B) 1.38 MB
/transactions/history 52.97 KB (🟡 +77 B) 1.38 MB
/transactions/messages 115.2 KB (🔴 +96.46 KB) 1.44 MB
/transactions/queue 26.91 KB (🟡 +87 B) 1.35 MB
/transactions/tx 6.33 KB (🟡 +83 B) 1.33 MB
/wc 709 B (🟡 +139 B) 1.32 MB
/welcome 7.1 KB (🟡 +5 B) 1.33 MB
/welcome/social-login 7.55 KB (🟡 +4 B) 1.33 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
77.72% (-0.01% 🔻)
11331/14580
🔴 Branches
53.79% (-0% 🔻)
2413/4486
🟡 Functions
61.52% (-0.07% 🔻)
1741/2830
🟡 Lines
79.06% (-0.01% 🔻)
10243/12956
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / index.tsx
55.56% 100% 0% 57.14%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / utils.ts
51.22% (-4.34% 🔻)
36.36%
28.57% (-4.76% 🔻)
51.72% (-4.53% 🔻)
🟢
... / WalletConnectContext.tsx
100%
83.33% (-3.03% 🔻)
84.62% 100%

Test suite run success

1346 tests passing in 184 suites.

Report generated by 🧪jest coverage report action from d4b86f3

@katspaugh katspaugh closed this pull request by merging all changes into dev in fc8342c Dec 21, 2023
@katspaugh katspaugh deleted the lazy-wc branch December 21, 2023 12:11
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant