Auth0.js: Reduce Bundle Size

Created on 25 May 2019  Â·  18Comments  Â·  Source: auth0/auth0.js

Is there a way to reduce or only import specific modules? Currently auth0.js has the biggest footprint in my vendor bundle and it seems a bit excessive?

image

Most helpful comment

Hey! Why is the bundle size of auth0-spa-js as big as the old one now?

https://bundlephobia.com/result?p=@auth0/auth0[email protected]

All 18 comments

We just release the beta of the new SDK for Single Page Applications. Check it out, it's pretty small!
https://community.auth0.com/t/new-javascript-sdk-for-single-page-applications-in-beta/25087
image

As for Auth0.js, it is big because it supports everything that Auth0 itself supports and it wasn't built with tree shaking in mind, since there was no such thing at the time.

Awesome thanks, when do you expect it will be ready for production?

Thanks @luisrudge, had a quick look, one question tho, how do we read the access_token using this new sdk?

Also is there anyway to check manually in local storage etc if a user is authenticated. The old sdk had isLoggedIn flag?

Awesome thanks, when do you expect it will be ready for production?

We don't have an ETA for the production release, we actually rely on feedback from the community to make sure it attends what the community is asking 😬

Thanks @luisrudge, had a quick look, one question tho, how do we read the access_token using this new sdk?

Also is there anyway to check manually in local storage etc if a user is authenticated. The old sdk had isLoggedIn flag?

Can you please ask this in the community forum? This way, other people interested in the new SDK will be able to chime in as well. Thanks!

@luisrudge so I have been trying for the past 10 min to log on the community forum and just cant get in.

I cant get past this screen:
image

Giving up now

@wpitallo I pinged the community team about this. Give us a moment to figure this out. Thanks for the patience.

Hey @wpitallo, I have sent an activation email to your primary email account. When you receive the email please follow the link and you should be set! However please let me know if you have any questions on this front!

Thanks very much

On Mon, 27 May 2019, 17:06 JimCMorrison, notifications@github.com wrote:

Hey @wpitallo https://github.com/wpitallo, I have sent an activation
email to your primary email account. When you receive the email please
follow the link and you should be set! However please let me know if you
have any questions on this front!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/auth0/auth0.js/issues/945?email_source=notifications&email_token=AC5GCH7OXAX7CUUGOKIY7G3PXP2H7A5CNFSM4HPVOQJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWKAYRY#issuecomment-496241735,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC5GCH4WP72LCUYH6LT6B3TPXP2H7ANCNFSM4HPVOQJA
.

Screenshot 2019-05-29 at 16 09 36

+1 this dep is huuuuuggeeee...

@luisrudge so is this dep https://github.com/auth0/auth0-spa-js backwards compatiable with the old?

@shavo007 no. The migration guide is expected to land when we release the final v1.0.0. But, if the only thing you used was webAuth.authorize, then the migration is super easy.

@luisrudge What feedback do you need from the community in order to progress with the release?

@isaachinman we're looking for all kinds of feedback 😬

  • is the API what you'd expect?
  • does it solve all your requirements?
  • if not, what's missing?

Hi @luisrudge has this moved? Getting this when following the link:
image

https://community.auth0.com/t/new-javascript-sdk-for-single-page-applications-in-beta/25087

@wpitallo it did, but we already launched it: https://github.com/auth0/auth0-spa-js

Hey! Why is the bundle size of auth0-spa-js as big as the old one now?

https://bundlephobia.com/result?p=@auth0/auth0[email protected]

I also noticed that is still too big. In the screenshot, it is a nextjs bundle example
v9.16.4
https://bundlephobia.com/package/[email protected]

image

If I try to build a project locally I get a dependency loop as a warning
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

csvn picture csvn  Â·  4Comments

danii-nebot picture danii-nebot  Â·  4Comments

andreasvirkus picture andreasvirkus  Â·  7Comments

beno picture beno  Â·  3Comments

peterblazejewicz picture peterblazejewicz  Â·  3Comments