graphql-normalizr icon indicating copy to clipboard operation
graphql-normalizr copied to clipboard

Separating 'addRequiredFields' and 'parse' functions for smaller bundles

Open fatmirsukaliq opened this issue 4 years ago • 1 comments

Hi there,

Great job on creating this library, we love it.

I'm submitting a PR that exports addRequiredFields and parse functions separately.

We are using only the normalize function from your library and not the addRequiredFields and parse, but since they are both returned by GraphQLNormalizr constructor, webpack includes those 2 functions as well, along with graphql dependencies, resulting in a large bundle size and unused dead code.

We are using Webpack with Terser for minifying and after after splitting the above mentioned functions, we saved around 9kb gzipped and 36kb parsed on bundle size.

We also updated the documentation and the tests!

fatmirsukaliq avatar Oct 01 '19 15:10 fatmirsukaliq

Can we merge it?

ianberdin avatar Jul 30 '21 00:07 ianberdin