amcharts / amcharts5

The newest, fastest, and most advanced amCharts charting library for JavaScript and TypeScript apps.
317 stars 90 forks source link

Add explicit d3 dependencies? #1567

Open JackRobards opened 2 weeks ago

JackRobards commented 2 weeks ago

Question Would it be possible to add explicit d3-shape, d3-force, and d3-hierarchy dependencies to the package.json file for amCharts5?

From what I can tell, all of these are already used in the repository and pulled in via other d3 dependencies. These 3 packages are directly imported and used in a few places in the codebase (e.g. here). Also, d3-shape and d3-hierarchy are already including @types packages in the package.json as well, just not the packages themselves.

I ran into an issue with a bundler where it complains that these packages aren't directly included. I can ignore it or patch the package.json on my side, but it would be nice if it could be updated in the root project unless you all have a strong reason you'd prefer not to.

Environment (if applicable)

Latest amCharts@5 version.

Also using TypeScript, Vite, and ESM.

Additional context

I believe the error is related to #1265 (and some of the other related issues) but adding these 3 explicit dependencies should help in my case and would be simpler than fully implementing ESM for the project. Since the dependencies are directly used, adding them to the package.json would be a good idea in opinion at least!

martynasma commented 2 weeks ago

That makes sense. We'll add it in the next version.