Open mcmxcdev opened 2 years ago
As a side note, we don't even use @frontegg/admin-portal
at all in our application. I expect it to be tree-shaked away and not blow up the bundle.
Hey, @mcmxcdev this should be done if you upgrade to the latest version.
Meanwhile, we are using @frontegg/nextjs
v6.7.4 and although things have improved a lot, @frontegg/nextjs
is still the 2nd largest dependency right after next
:
I want to extend on this. Recently, we have been investigating our next.js bundle size and discovered that @frontegg/nestjs
blows up our individual pages WAY out of proportion.
Our first load JS
baseline is around 83 kB; with a simple Frontegg import (e.g., the useAuthUserOrNull
hook), the size blows up to almost 450 kB (437 kB first load JS
)[using the bundle analyzer].
Especially the size of https://www.npmjs.com/package/@frontegg/redux-store seems to be quite horrible (600kB parsed size on the server, 330kB parsed size on the client)
Are there any plans to reduce the size of https://www.npmjs.com/package/@frontegg/redux-store? The npm page also lists the unpacked size as 2.2 MB, which is insane.
As a paying customer, it would be great to see some improvements soon. Otherwise, we might consider switching to a product offering acceptable bundle sizes.
Thanks for your help!
Describe the bug
@frontegg/nextjs
depends on@frontegg/admin-portal
and@frontegg/redux-store
(which is required by@frontegg/react-hooks
) libraries, which are both huge in size.When using
@next/bundle-analyzer
, these are the findings:@frontegg/admin-portal
is reported with a size of 3.66 MB@frontegg/redux-store
is reported with a size of 500 KBThese sizes are unacceptable in modern web development and should be brought down as much as possible. This bloat is bad for users with metered internet connections, slows down builds and can be avoided.
Expected behavior Bring down the bundle size of frontegg libraries to an acceptable level.
Screenshots