Find a way to reduce the 556KB minified version
yes.
Related:
auth0/lock#66 auth0/lock#102
610 ko for login widget in production , wouch !!!
Any news here ? Auth0 lock represents 50% of my front-end JS :-(
By the way, I'm using jQuery, does anyone here knows if there is a way to avoid the double download of sizzle ?
is it possible to modularize the lock into lock core + bunch of optional modules? with bundled-all module as well as for me, for some projects I don't need social identity providers at all
We are working on the modularization @moravcik suggests. You'll be able to bundle the Lock without the support for the connections you don't need (social, enterprise, etc.) and also without the CSS.
Having that said, the Lock is intended to be a drop in solution for our customers. It has a lot of features that you may not need and supports extensive customization. For that reason, we recommend users to build their own UI when they want to keep the resources of their web sites as small as possible.
I just ran into this. Auth0 is 50% of my front-end app right now as well. :/
Suggestion: Load as much as possible lazily rather than up-front. Most web applications that are going to use the drop-in widget won't be popping it up to the user immediately, though some JavaScript on the page may require the API be available during startup. By only pulling in the basic JS up front and lazily downloading the UI later would allow the user's application to be available immediately and at worst they get a small spinner if they get the auth pop-up too quickly after page load.
We just ran into this as well, however the CDN minified version is ~155k. Using browserify with a require('auth0-lock') gets me the 556kb version. We're sticking with the CDN for now.
Any idea how the CDN version is built?
Hi @NiXXeD and @jzaefferer,
The script in the CDN is built with the grunt task that is published in this repo. It uses browserify to make the bundle and uglify to minify it. The script is bigger than the ~155k that are actually transferred because the response is compressed with gzip. You can configure your web server to do the same.
Turns out the non-gzipped size (which is a lot easier to compare here) is 729kb. So the CDN build is even worse.
some ideas
I think it will help to know where is the size going, like having a graph.. for instance which dependency is bigger. I just tried to remove underscore and I think the result doesn't worth the hassle:
auth0-lock.min.js:692Kauth0-lock.min.js.gz:148K
what can we do to figure where is the space going?
The inlined css does takes a big chunk of this:
lib/css/main.min.css:182Klib/css/main.min.css.gz:33K
Is there a way to write this css better? is there something we can remove from there?
I would put focus on Lock10 at this point
I would put focus on Lock10 at this point
Is there any way to track that? I found a v10 label, but its not in use, and there are no milestones.
Any news here?
I want to use Auth0-Lock (v10.0.2) with my Aurelia application. I'm not using React at all but including auth0-lock from NPM installs React as a dependency. When analyzing the size of my minified application I get this result:
react: 672.58 KB (21.4%)
auth0-lock: 470.15 KB (15.0%)
auth0-js: 72.42 KB (2.30%)
If I understand correctly, the minified output from auth0 is 1215 KB (excluding React dependency results in a 542 KB auth0 package). That is LARGE. The CDN file is "only" 670 KB in a minified version. It includes the React dep so how come my NPM installed auth0-lock weighs in at a massive 1 215 KB?
At the moment I'm only using a very simple embedded login form with one social media connector. Can I create this buttom myself and install some bare minimum auth0 package without UI?
yes https://github.com/auth0/auth0.js
+1 for modularising lock. We are only using the most basic username/password login/reset features. 500kb is crazy and like many businesses, we don't have the time to roll our own lighter weight alternative.

any news? Because this module is really huge.
It could have something like a light version, because is not everybody that needs all of the features.
@jvbianchi not yet. Lots to figure it out still.. 😅
Is there another issue blocking this issue?