Open Mark12870 opened 4 years ago
Maybe, but probably not.
My experience with other (UI) libraries is that their dependency trees are so intertwined that they not much gets shaken out. In addition, webpack and rollup both rely on ES module import/export:
https://webpack.js.org/guides/tree-shaking/
Paperjs was developed before the widespread adoption of ES modules, and uses a direct import (include) mechanism of its own. Look at src/paper.js.
I looked (briefly) at how to support tree shaking in the library, but quickly realized the above, and opted to create a version of the library that did not include modules I did not need (like the Event system). I know there is probably a better way to accomplish this, and suspect the authors will let us know.
Well, it would be pitty to not implement it. It is all about making the library with modules in mind and don't import everywhere everything.
We are discussing this for after v1.0 is released. This will require a modernisation of the full code-base and the way the releases are built, which is is a huge undertaking.
Description
Make the library tree-shakable. https://webpack.js.org/guides/tree-shaking/ It would help to reduce package size while not using all features.