xchainjs-lib icon indicating copy to clipboard operation
xchainjs-lib copied to clipboard

bloated dependency: lodash

Open dynst opened this issue 5 months ago • 0 comments

$ du -hs node_modules/lodash/
5.0M    node_modules/lodash/

lodash is over 96 kB of the bundle size. https://bundlephobia.com/package/@xchainjs/[email protected]

There are 5 dependencies and 1 devDependencies that pull in lodash, a huge utility library that's basically been obsolete for years. (_.includes predates the standardization of Array.includes, which was part of Node.js 6.0 in 2016.)

The dependency on the custom fork foundry-primitives-xchainjs can just be removed as part of #1449 but everything else needs updating.

Upstream issues:

  • https://github.com/LedgerHQ/ledger-live/issues/10745
  • https://github.com/bitpay/bitcore/issues/3949 There have been PRs about this since 2022 though.
    • https://github.com/bitpay/bitcore/pull/3350
    • https://github.com/bitpay/bitcore/pull/3889
  • https://github.com/dashpay/dashcore-lib/issues/313
  • https://gitlab.com/mayachain/chains/zcash/-/merge_requests/23
  • https://github.com/OpenAPITools/openapi-generator-cli/issues/944

dynst avatar Jul 12 '25 18:07 dynst