Open travis opened 2 years ago
We've been looking into this a bit more on our end, and @inrupt/oidc-client seems to be a large contributor to the package size.
Thanks for reaching out!
In one of our packages, some dev dependencies were mixed with the actual dependencies, which caused some package size issues. However, as @ianconsolata pointed out, one of the biggest contributor to our package size is @inrupt/oidc-client
, which is a fork of a pre-existing library we are maintaining for the time being. We are actively looking at replacing it with a rewritten OIDC client, which is a large chunk of work, so I don't have a precise timeline for it. I'll keep this issue updated as we go.
Search terms you've used
package, size, rollup
Impacted package
Which packages do you think might be impacted by the bug ?
Bug description
When we use this package as a dependency it adds ~100k (after minification and gzipping) to the size of the parent.
We suspect this is related somehow to the fact that this package is 3.39MB unpacked according to NPM:
https://www.npmjs.com/package/@inrupt/solid-client-authn-browser
We first discovered this while trying to debug failing Next.js builds and have an open ticket there:
https://github.com/vercel/next.js/issues/35602
We've tracked this down to some combination of
swrlit
,@inrupt/solid-client
and@inrupt/solid-client-authn-browser
and strongly suspect the issue is with one of the Inrupt libraries. Including@inrupt/solid-client
bloats the minified/gzipped CJS package by ~90kB (but not the ESM package!) and including@inrupt/solid-client-authn-browser
bloats both the CJS and ESM minified/gzipped packages by ~100kB.To Reproduce
src/index.ts
and uncommentimport "@inrupt/solid-client-authn-browser"
npm install
npm run build && npm run size
Expected result
Minified/gzipped package size should be under 10kB
Actual result
Minified/gzipped package size is 102.78 kB
Environment
Additional information
This is a very strange issue - I tried fiddling with the rollup build a bit but didn't have any luck. The Next.js build issue is non-deterministic but seems related to the weight of this dependency. Have been working on debugging this for several days and have tried many things - happy to chat in higher bandwidth if that would be helpful!