Skip to content
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

Make apexcharts Treehsakable #3014

Closed
DavidMarquezF opened this issue Feb 26, 2022 · 5 comments
Closed

Make apexcharts Treehsakable #3014

DavidMarquezF opened this issue Feb 26, 2022 · 5 comments
Labels

Comments

@DavidMarquezF
Copy link
Contributor

Summary

As of now, apexcharts is huge compared to other libraries when only wanting to use a few characteristics. This will be a big roadblock in the long run because it will mean that any addition or improvement to the library will just make it bigger and bigger: it is not scalable. I know that the charts are not the main part taking up space, but the zoom, panning and dragging are (I think you mentioned about 40% in #567). In a lot of use cases this is not even needed and therefore it doesn't make sense to let it bloat up the bundle. Moreover I think some refactoring could be done to improve size (see https://codeclimate.com/github/apexcharts/apexcharts.js).

Indeed this may be a big task but I believe it is one of the major requirements to have more people adopting the lib, since it is one the most flexible and pretty libraries out there but this issue is a major drawback.

As an example, Chartjs, one of the major js charting libraries, made the library tree-shakable in v3 (see this issue where they discuss how they should it). I do see a lot of similarities on how this lib is used by a user and Chartjs so maybe we can use how they did it as a source of inspiration. They offer both the treeshakable version and the full version, which means that users could still use cdn without a problem.

This doesn't necessarily mean that we have to make the complete library tree-shakable right of the bat. This can be done progressively, by first attacking the main sources of bloat like the dragging, zoom and panning and then moving to the smaller ones.

Intended Use Case

Reduce bundle size when possible, making the library faster for a lot of users.

@DavidMarquezF DavidMarquezF added the feature-request New feature or request label Feb 26, 2022
@maggie44
Copy link

Adding a +1 and linking to ECharts as another example of an approach encouraging manual imports of required components to reduce bundle size.

https://github.com/ecomfe/vue-echarts#npm--esm

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@DavidMarquezF
Copy link
Contributor Author

.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@MickL
Copy link

MickL commented Nov 25, 2023

Why has this been closed? Apexcharts is not treeshakable and therefor it is kinda useless. Please reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants