DEV Community

Discussion on: Using Apache ECharts with React and TypeScript

Collapse
 
raymolla7 profile image
raymolla7 • Edited

This is great, thank you for writing this.

I am wondering how do you get tree shaking working with the above? (Minimal Option Type in TypeScript)

I found this documentation here: echarts.apache.org/en/tutorial.htm...

but I am having trouble incorporating it into your React-ECharts.tsx

Collapse
 
maneetgoyal profile image
Maneet Goyal • Edited

Didn't try it yet @raymolla7 . But thanks for pointing out that link. Seems like tree shaking can be useful in our case too.

Collapse
 
raymolla7 profile image
raymolla7

Ok let me know if you can figure out a way to incorporate it. I tried for a bit but I had no luck :(

The bundle size of ECharts is quite large and can be drastically reduced if we use the "Minimal Option Type in TypeScript" listed in the bottom of the link

Thread Thread
 
maneetgoyal profile image
Maneet Goyal

@raymolla7 If you were still looking for some info, I hope this helps: dev.to/maneetgoyal/using-apache-ec...

Thread Thread
 
raymolla7 profile image
raymolla7

this is incredibly helpful! Thank you so much for this well written article Maneet!