prevwong / craft.js

🚀 A React Framework for building extensible drag and drop page editors
https://craft.js.org
MIT License
7.52k stars 725 forks source link

Reduce bundle size #207

Open timc1 opened 3 years ago

timc1 commented 3 years ago

Is your feature request related to a problem? Please describe.

Following up with https://github.com/prevwong/craft.js/discussions/168#discussioncomment-335528

Would be wonderful to have a standard way of ensuring that bundle size remain manageable with an infinite number of user components.

nicosh commented 3 years ago

I may be wrong but i think craft.js is made for build custom page editors with react, and how you will render these pages is up to you and out of the scope of craft.js. I think at the moment is hard to introduce a standar way to render pages and keep bundle size low without changes to the core of craft.js. For sure would be nice to have a feature for loading only used components, but as you can read in my other post, this feature maybe would be not enough for reducing bundle size since other factors comes in account, (how many dependecies a components have, how many css the component loads, your webpack configuration and so on...). In my case load only used components and have separated components for the editor and for the frontend helped me to reduce the finale bundle size.