shapeshift / web

ShapeShift Web
https://app.shapeshift.com
MIT License
167 stars 176 forks source link

Exclude `@ledgerhq` from bundle #7855

Open 0xApotheosis opened 3 days ago

0xApotheosis commented 3 days ago

Overview

The @ledgerhq package, specifically the @ledgerhq/cryptoassets/lib-es/data/evm directory, takes up a significant proportion of web's bundle size.

We should lazy load this package so that it's only loaded by the client when a user is attempting to connect a Ledger (or even when the "Connect wallet" modal is loaded if the former is not possible.

References and additional details

Spawned from the spike into web's bundle size: https://github.com/shapeshift/web/issues/7768

Run yarn analyze to generate a visual representation of the bundle.

image

Acceptance Criteria

The @ledgerhq package is not included in the web bundle.

Need By Date

No response

Screenshots/Mockups

No response

Estimated effort

No response

0xean commented 2 days ago