onebeyond / react-form-builder

React Form Builder
http://guidesmiths-react-form-builder.s3-website.eu-central-1.amazonaws.com/
MIT License
31 stars 11 forks source link

Reducing the bundle size #94

Open ardguezsoc opened 3 years ago

ardguezsoc commented 3 years ago

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

The current bundle of the package is really big so it would be interesting to find ways to reduce it.

Describe the solution you'd like

We would like to find ways that can help us to reduce the size of the bundle (coding optimisation, better approach to solutions, removing redundancy)

kuhlaid commented 2 years ago

Hi @ardguezsoc, what do you mean by bundle? The size of the repo if downloaded?

ardguezsoc commented 2 years ago

Hi @kuhlaid nowadays we are using multiple external libraries to get cool components like react-phone and the react-date-picker. So i was talking about some ways to reduce the size in the way of finding lighter libraries that could replace this one. And I was talking more about the bundle that we are using although we are using rollup to make the build(and this is an interesting approach) of the library im not sure 100% if the configuration stablished is the right one i dont know if we could do something better to avoid this huge bundle size. For example : one approach was defining as dependencies a lot of libraries as you can see in the package.json. But im not sure if we could do something else 😞 .

matyasjay commented 7 months ago

Necropost, but still relevant: In general it is a good idea to review the import patterns of large fingerprint libs (react-phone ~~ 9.5MB) and utilise async instead of ES module import. Also, general practices like tree-shake, deadcode cleanup can help as well. i can work out a proposal of necessary steps if this is still on the roadmap.