react-form-builder icon indicating copy to clipboard operation
react-form-builder copied to clipboard

Reducing the bundle size

Open ardguezsoc opened this issue 4 years ago • 3 comments

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)

ardguezsoc avatar Oct 05 '21 20:10 ardguezsoc

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

kuhlaid avatar Nov 17 '21 16:11 kuhlaid

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 😞 .

ardguezsoc avatar Nov 17 '21 17:11 ardguezsoc

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.

matyasjay avatar Mar 01 '24 08:03 matyasjay