react-compound-slider
react-compound-slider copied to clipboard
Removing the `d3-array` dependency?
As you can see on Bundlephobia, the package d3-array
currently comprises 40% of the total size of react-compound-slider
! It's not the heaviest thing in the world but still, lightening the load is never a bad thing.
d3-array
is used exactly once: its ticks
function is used here
https://github.com/sghall/react-compound-slider/blob/b24286d953df08b0ffe508ed5b8bc5741b6068da/src/scales/LinearScale.ts#L1
I wonder if you'd consider extracting just the ticks
function so the rest of d3-array
doesn't need to be included?
https://github.com/d3/d3-array/blob/master/src/ticks.js
Yeah, this is a fair point. I'm working on a refactor of this code. At the minimum could make it so you could tree shake that code.
A problem i've noticed is that the version of d3 being used by react-compound-slider has some arrow functions in it which aren't transpiled. There may be other things that need transpiling too, but an arrrow function is where IE falls over for me. This makes react-compound-slider v3+ incompatible with IE 11. We've had to downgrade too 2.5.0 in order to use this library and remain compatible with IE.