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

Chore: speed up local dev build #4583

Closed
wants to merge 1 commit into from
Closed

Chore: speed up local dev build #4583

wants to merge 1 commit into from

Conversation

katspaugh
Copy link
Member

What it solves

Lazy-loading the core _app module results in somewhat faster local compilation times.

Copy link

github-actions bot commented Nov 29, 2024

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 100.22 KB (🟢 -917.43 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!

Forty-four Pages Changed Size

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

Page Size (compressed) First Load
/ 45.55 KB (🔴 +45.06 KB) 145.77 KB
/403 31.95 KB (🔴 +31.37 KB) 132.17 KB
/404 1.15 KB (🔴 +474 B) 101.37 KB
/_offline 30.55 KB (🔴 +29.49 KB) 130.77 KB
/addOwner 705.86 KB (🔴 +705.32 KB) 806.08 KB
/address-book 802 KB (🔴 +776.35 KB) 902.22 KB
/apps 820.61 KB (🔴 +781.1 KB) 920.83 KB
/apps/bookmarked 945 B (🔴 +483 B) 101.14 KB
/apps/custom 808.56 KB (🔴 +771 KB) 908.78 KB
/apps/open 879.41 KB (🔴 +825.7 KB) 979.63 KB
/balances 806.83 KB (🔴 +769.26 KB) 907.05 KB
/balances/nfts 789.11 KB (🔴 +771.58 KB) 889.33 KB
/bridge 702.13 KB (🔴 +699.56 KB) 802.35 KB
/cookie 44.93 KB (🔴 +36.18 KB) 145.15 KB
/home 821.13 KB (🔴 +762.48 KB) 921.35 KB
/imprint 36.94 KB (🔴 +35.55 KB) 137.16 KB
/licenses 48.11 KB (🔴 +43.16 KB) 148.33 KB
/new-safe/advanced-create 836.61 KB (🔴 +799.84 KB) 936.82 KB
/new-safe/create 835.4 KB (🔴 +799.54 KB) 935.62 KB
/new-safe/load 807.96 KB (🔴 +791.64 KB) 908.18 KB
/privacy 49.83 KB (🔴 +35.8 KB) 150.05 KB
/settings 44.57 KB (🔴 +44.11 KB) 144.78 KB
/settings/appearance 720.44 KB (🔴 +712.73 KB) 820.66 KB
/settings/cookies 730.62 KB (🔴 +723.29 KB) 830.84 KB
/settings/data 766.96 KB (🔴 +759.73 KB) 867.17 KB
/settings/environment-variables 767.01 KB (🔴 +758.22 KB) 867.23 KB
/settings/modules 756.71 KB (🔴 +747.23 KB) 856.93 KB
/settings/notifications 778.24 KB (🔴 +751.41 KB) 878.46 KB
/settings/safe-apps 736.42 KB (🔴 +713.25 KB) 836.63 KB
/settings/security 717.12 KB (🔴 +709.38 KB) 817.34 KB
/settings/setup 832.53 KB (🔴 +786.27 KB) 932.75 KB
/share/safe-app 758.98 KB (🔴 +749.82 KB) 859.2 KB
/stake 690.71 KB (🔴 +690.12 KB) 790.93 KB
/swap 690.77 KB (🔴 +690.04 KB) 790.99 KB
/terms 48.86 KB (🔴 +48.3 KB) 149.08 KB
/transactions 941.22 KB (🔴 +831.2 KB) 1.02 MB
/transactions/history 941.21 KB (🔴 +831.23 KB) 1.02 MB
/transactions/messages 889.95 KB (🔴 +826.04 KB) 990.17 KB
/transactions/msg 877.64 KB (🔴 +822.91 KB) 977.85 KB
/transactions/queue 881.58 KB (🔴 +828.6 KB) 981.8 KB
/transactions/tx 871.86 KB (🔴 +824.97 KB) 972.08 KB
/wc 690.68 KB (🔴 +690 KB) 790.9 KB
/welcome 738.21 KB (🔴 +731.4 KB) 838.43 KB
/welcome/accounts 828.55 KB (🔴 +828.16 KB) 928.77 KB
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

Caution

Test run failed

St.
Category Percentage Covered / Total
🟡 Statements
73.66% (-0.01% 🔻)
14329/19453
🔴 Branches
51.78% (+0.01% 🔼)
3514/6787
🔴 Functions 57.12% 2081/3643
🟡 Lines
75.27% (+0% 🔼)
13019/17297
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟡
... / App.tsx
66.23% 42.86% 0% 67.57%

Test suite run failed

Failed tests: 2/1661. Failed suites: 1/226.
  ● getConfigs › should fetch data from the API and concatenate results

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    Expected: "https://safe-client.safe.global/v1/chains"
    Received
           1: "https://safe-client.staging.5afe.dev/v1/chains"
           2: "https://safe-client.safe.global/v1/chains?cursor=limit%3D2%26offset%3D20"

    Number of calls: 2

      48 |
      49 |     // Check that fetch was called with the correct URLs
    > 50 |     expect(fetch).toHaveBeenCalledWith('https://safe-client.safe.global/v1/chains')
         |                   ^
      51 |     expect(fetch).toHaveBeenCalledWith('https://safe-client.safe.global/v1/chains?cursor=limit%3D2%26offset%3D20')
      52 |   })
      53 |

      at Object.toHaveBeenCalledWith (src/hooks/loadables/helpers/__tests__/config.test.ts:50:19)

  ● getConfigs › should handle a single page of results

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    Expected: "https://safe-client.safe.global/v1/chains"
    Received: "https://safe-client.staging.5afe.dev/v1/chains"

    Number of calls: 1

      70 |
      71 |     // Check that fetch was called with the correct URL
    > 72 |     expect(fetch).toHaveBeenCalledWith('https://safe-client.safe.global/v1/chains')
         |                   ^
      73 |   })
      74 |
      75 |   it('should handle network errors', async () => {

      at Object.toHaveBeenCalledWith (src/hooks/loadables/helpers/__tests__/config.test.ts:72:19)

Report generated by 🧪jest coverage report action from bbcccd4

@katspaugh katspaugh closed this Nov 29, 2024
@katspaugh katspaugh deleted the lazyapp branch November 29, 2024 14:07
@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2024
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