perf(login): create a custom bundle for login#39942
Conversation
87916e6 to
b5f19a0
Compare
| const standaloneEntries = { | ||
| entry: modulesToBuild({ | ||
| core: { | ||
| login_standalone: path.join(__dirname, 'core/src', 'login.js'), | ||
| }, | ||
| }), | ||
| } |
There was a problem hiding this comment.
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.
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 <richard@steinmetz.cloud> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
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