-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
perf(login): create a custom bundle for login #39942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
87916e6 to
b5f19a0
Compare
ChristophWurst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane
| const standaloneEntries = { | ||
| entry: modulesToBuild({ | ||
| core: { | ||
| login_standalone: path.join(__dirname, 'core/src', 'login.js'), | ||
| }, | ||
| }), | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not super fond of splitting the config even more, but I guess that's the only way to avoid core-common 🤔
To be fair, since we're logging in, the core-common will be fetched after log in anyway 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the splitting is a bit ugly 🙈
To be fair the main problem with js bundles is the time spent parsing not the fetching itself as they are mostly cached by the browser anyway. The core-common bundle contains every dependency bundled from node_modules, most of which was parsed for no reason on the login page.
2e489ef to
b8b74fa
Compare
|
Again, drone failure is unrelated and caused by failing DNS resolutions.
|
|
rebase & merge? |
b8b74fa to
43b0896
Compare
|
/compile amend |
This bundle doesn't depend on core-common.js and thus improves performance of the login page's frontend. Signed-off-by: Richard Steinmetz <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
43b0896 to
fd8a165
Compare
|
Cypress failure is related |
Summary
The standalone bundle imports src/main.js to setup all globals. Unfortunately, the login page doesn't work without globals as they are required by various bits (e.g. theming).
I tested this with theming (custom background, logo and color) and twofactor authentication.
This PR reduces the size of transferred and parsed javascript bundles to around ~50%. Together with Robin's PR the login page loads significantly faster.
Checklist