Skip to content

Conversation

@gndelia
Copy link
Contributor

@gndelia gndelia commented Apr 29, 2025

This PR replaces bignumber.js with big.js. The goal is to reduce the bundle size, as big.js is significantly smaller than bignumber.js

See the bundle size for [email protected]:

image

From the diagram, we can see that bignumber.js takes up most of the bundle size

image

If we compare bignumber.js with big.js, we see the latter is smaller, while having most of the same functionality (or we can get by with some calls to get the same functionality)

BigNumber.js Big.js
image image

Tests pass so I expect it to have the same functionality.

Description commit by commit:

  • df0c59b Removes an incorrect exports (There's no contract in this package ! It must have been a copy-paste error)
  • b417f2b Replaces bignumber.js with big.js
  • 115e3d8 Adds the bundle mingzipped size badge into the README
  • ebea7b0 bumps the version.

Note I believe this should be a breaking change because while the output should stay the same, the input used to accept a BigNumber.js instance, which is no longer accepted. We use BigSource now.

@gndelia gndelia requested a review from gabmontes April 29, 2025 19:42
@gndelia gndelia merged commit c84b4c0 into master Apr 29, 2025
8 checks passed
@gndelia gndelia deleted the replace-bignumber.js-with-big.js branch April 29, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants