[Feature Request] Remove `decimal.js`
Is your feature request related to a problem? Please describe.
decimal.js adds an extra 31.9k of overhead to the bundle.
Its quite a heavy dependency considering that we're using just a few methods from it, like isDecimal()
Describe the solution you'd like
- Is it possible to just implement the features we need from
decimal.jsdirectly? - OR using lightweight options like
decimal.js-lightorbig.js
Describe alternatives you've considered I prefer removing the dependency altogether if possible.
Just piping in here as a co-champion of the decimal proposal to mention a third option that currently doesn't exist but may in the near-ish future: having decimal numbers available out-of-the-box in JS, so that, for many use cases, no library is needed at all. Any comments, concerns, or questions are welcome! Just file an issue in the proposal-decimal repo.
Is your feature request related to a problem? Please describe. decimal.js adds an extra
31.9kof overhead to the bundle.Its quite a heavy dependency considering that we're using just a few methods from it, like
isDecimal()Describe the solution you'd like
- Is it possible to just implement the features we need from
decimal.jsdirectly?- OR using lightweight options like
decimal.js-lightorbig.jsDescribe alternatives you've considered I prefer removing the dependency altogether if possible.
Hi @genu , thanks for filing this. Decimals are serialized as string over the wire and deserialized into Decimal of "decimal.js". I think it's good to preserve a decimal-like interface on the client side. If we completely get rid of the package, we'll need to implement such an interface.
I'm replacing it with "decimal.js-light" for now and it seems to work well (at the cost of not providing as many APIs). In the future if Decimal type becomes native, life will be much easier.
Fixed in 2.5.0