You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your suggestion related to an experience? Please describe.
When we did a bundle analysis in our React app which we use @asgardeo/auth-react for auth purposes, It outputs the following result.
@asgardeo/auth-react is consuming +500KB which is bigger than the next biggest chunk in our app.
For the comparison, MUI core is under 100KB, React + React-DOM is ~126KB
So IMO +500KB for auth library is an unusually large bundle size.
Describe the improvement
IMHO, We might be packing the resources that @asgardeo/auth-react probably not used in the runtime, So if we can do proper Tree shaking we might able to reduce the bundle size by large amount.
The text was updated successfully, but these errors were encountered:
The reason for this "unusual" large bundle size is that the web worker storage implementation can not be treeshaked, as what will be used by the web worker in the runtime cannot be determined in the build time.
As per the offline ad-hoc conversations we had, there are several ways to address this concern.
Package the web worker implementation as an npm package to be optionally installed, since the SDK's default token storage strategy is session storage.
Provide an option (a build-time argument) to select web worker implementation to be included in the final bundle.
The following are some of the alternative methods I could come up with.
Load the web worker implementation from remote CDN.
Re use the code between main thread client and web worker client using a library such as webworkify [1].
Is your suggestion related to an experience? Please describe.
When we did a bundle analysis in our React app which we use
@asgardeo/auth-react
for auth purposes, It outputs the following result.@asgardeo/auth-react
is consuming +500KB which is bigger than the next biggest chunk in our app.For the comparison, MUI core is under 100KB, React + React-DOM is ~126KB
So IMO +500KB for auth library is an unusually large bundle size.
Describe the improvement
IMHO, We might be packing the resources that
@asgardeo/auth-react
probably not used in the runtime, So if we can do proper Tree shaking we might able to reduce the bundle size by large amount.The text was updated successfully, but these errors were encountered: