Reduce package size
jakezatecky opened this issue · 0 comments
According to Bundlephobia, d3-funnel is currently sized at 331.3 KB, which is astonishingly high. Although large package size usually affects mobile devices more adversely than desktop computers, and although funnels rendered by this library will most likely be consumed by desktop computers, this is still a number we should bring into line.
Around 70% of that size has been attributed to various D3 imports, many of which are not even used in the library itself. Much of the file size can be alleviated by using targeted imports on required D3 functions rather than using import { ... } from 'd3';
. Further optimizations could be naturally made in the codebase itself, but reducing dependency size is the easiest and most impactful way to overall decrease the impact this library will have on the web.
The various D3 dependencies could further be made into peerDependencies, though that might be an annoying requirement for anyone using the library.