-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The current (unminified, uncompressed) UMD bundle size is 85kb, which isn't bad to begin with. 20kb of that is earcut which is essential, but another 16kb (18% of total bundle size) is for d3-interpolate and the d3-color dep that comes with it. All of the color definitions etc. end up in the bundle as well 😞
This is because we heavily use this function https://github.com/d3/d3-interpolate/blob/master/src/value.js which allows for interpolation of all kinds of things, including color, and the way it's written the color, string etc. stuff can't be tree-shaken. We only need to interpolate numbers and arrays (of numbers) so could probably just write our own version of https://github.com/d3/d3-interpolate/blob/master/src/number.js combined with https://github.com/d3/d3-interpolate/blob/master/src/array.js. It would probably increase performance too since it removes an unnecessary type check for every interpolation. @luucvanderzee thoughts?