kirjs / react-highcharts

React wrapper for Highcharts library
http://kirjs.github.io/react-highcharts/
MIT License
1.26k stars 233 forks source link

Optimization: Don't bundle prop-types/create-react-app #345

Closed ephys closed 6 years ago

ephys commented 7 years ago

I was wondering why my Stats bundle was so massive in production, and the reason seems (in part) to be that the dist version of react-highcharts bundles the prop-types and create-react-app packages. Given that nor react nor highcharts are, I assume this is an oversight?

Also, they're duplicated - along with common code - in ReactHighcharts, ReactHighstock, ReactHighmaps, and RedrawOnPrint. Which results in shipping a lot of duplicated code if we need to use more than one.

Fixing the prop-types problem is simple, but create-react-app would either require declaring it as a dependency or rewriting your classes & transpiling them using babel.

For the duplicated common code, I am unsure how it would be done.

I can write a PR to optimize this library as much as I can if you're interested.

ilyjs commented 6 years ago

16 release, I removed all dependencies in ReactHighcharts, ReactHighstock, ReactHighmaps and used UglifyJsPlugin for Minification code. Thanks for your feedback.