Use correct build from vis-timeline
PascalHonegger opened this issue · 3 comments
Is your feature request related to a problem? Please describe.
I just found this project and noticed something about the way you're importing vis-timeline
and vis-network
. According to the documentation of vis-timeline you aren't supposed to import directly from "vis-timeline"
.
Describe the solution you'd like
Given that this is an Angular library which will be built using webpack, I would assume an import from "vis-timeline/esnext"
. I did this in my project and had no problems, but you probably have to install all peerDependencies from vis-timeline like hammerjs.
Describe alternatives you've considered
Maybe it would also make sense to import from "vis-timeline/peer"
, but I'm not sure about that. Using this would potentially make the change less risky / breaking.
Additional context
This should overall reduce the bundle size, to what extend I'm not sure (measuring is certainly required). This would probably count as a breaking change according to semver and therefore require a major release.
Thanks for the quick fix! I also tested this locally a few days ago to measure potential bundle size improvements. Using /esnext improved bundle size but also made the bundle non-ie11-compatible, while /peer changed close to nothing in terms of bundle size but still worked. For example, running build:docs followed by npm test gave eslint errors - just something to consider :)
thanks for the hint. I think you then need to build es5 within your Angular App to get it working.