-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundle size optimizations. #739
Conversation
Replace lodash's each, assign, filter by native functions. Add rollup-plugin-visualizer.
You can't just swap out date-fns with dayjs. They both have different templating. Can't expect users to adjust their formats? |
Can't we use es6 tree-shaking in stead? |
I only checked the parse format, which in both cases seem to accept ISO 8601 format by default. Hence the replacement. Will give tree-shaking a try tomorrow. |
Yeah it's a build issue with poi/webpack egoist/poi#327 Well it should work with webpack 4. And we use the latest version of poi which uses webpack 4. So it as to be an issue with poi, or a config thing |
I'm not familiar with poi/bili, but |
@xaksis ? |
hmm, curious. We do use bili for bundling which uses rollup internally. My memory is a bit fuzzy but this might be happening because of an issue with vue-rollup - egoist/bili#221 where we had to use inline bundling for esm file. |
On another note, I think we can also replace lodash.foreach, lodash.filter, & lodash.assign with their es6 counterparts now and reduce the bundle size further. 🙏 edit: my bad, didn't notice that you already did this for lodash specific functions! Could you please resolve the conflicts so I can push this out next weekend? Thank you @Herz3h! |
Fixed conflicts |
v2.21.6 contains these changes. |
Replace date-fns by dayjs to reduce bundle size.
Replace lodash's each, assign, filter by native functions.
Add rollup-plugin-visualizer.
Before:
After: