hicommonwealth / commonwealth

A platform for decentralized communities
https://commonwealth.im
GNU General Public License v3.0
67 stars 44 forks source link

Reduce bundle size by replacing dependencies that have "one util use" or "drop in replacements" #2618

Open dillchen opened 1 year ago

dillchen commented 1 year ago

Semi Easy


dillchen commented 1 year ago

import { Address } from 'ethereumjs-util'; in the cosmos_evm_metamask_web_wallet is our only use of ethereumjs-util on the client side.

https://github.com/hicommonwealth/commonwealth/blob/5d6051d96224e7897bdf6114935f53ac1acbe72f/packages/commonwealth/client/scripts/controllers/app/webWallets/cosmos_evm_metamask_web_wallet.ts

This adds (potentially 338kbs) gzipped => with half of it being loaded in chunk 7631 (eagerly loaded), however lot of is from the included magic-sdk packages?

image