Skip to content

Conversation

@st3iny
Copy link
Member

@st3iny st3iny commented Aug 17, 2023

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.

Before After
grafik grafik

Checklist

@st3iny st3iny self-assigned this Aug 17, 2023
@st3iny st3iny changed the title Login less custom bundle perf(login): create a custom bundle for login Aug 17, 2023
@st3iny st3iny requested review from a team, artonge, icewind1991, skjnldsv and susnux and removed request for a team, icewind1991 and skjnldsv August 21, 2023 11:42
@st3iny st3iny added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Aug 21, 2023
@st3iny st3iny modified the milestones: Nextcloud 29, Nextcloud 28 Aug 21, 2023
@st3iny st3iny force-pushed the login-less-custom-bundle branch from 87916e6 to b5f19a0 Compare August 21, 2023 11:48
@st3iny st3iny marked this pull request as ready for review August 21, 2023 11:48
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane

Comment on lines +47 to +56
const standaloneEntries = {
entry: modulesToBuild({
core: {
login_standalone: path.join(__dirname, 'core/src', 'login.js'),
},
}),
}
Copy link
Member

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 😁

Copy link
Member Author

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.

@st3iny
Copy link
Member Author

st3iny commented Sep 26, 2023

Again, drone failure is unrelated and caused by failing DNS resolutions.

fatal: unable to access 'https://github.com/nextcloud/server.git/': Could not resolve host: github.com

@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
@ChristophWurst
Copy link
Member

rebase & merge?

@skjnldsv skjnldsv added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Feb 23, 2024
@icewind1991 icewind1991 force-pushed the login-less-custom-bundle branch from b8b74fa to 43b0896 Compare March 6, 2024 10:45
@icewind1991
Copy link
Member

/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]>
@nextcloud-command nextcloud-command force-pushed the login-less-custom-bundle branch from 43b0896 to fd8a165 Compare March 6, 2024 12:35
@skjnldsv
Copy link
Member

skjnldsv commented Mar 6, 2024

Cypress failure is related

TypeError: Cannot read properties of undefined (reading 'rules')
    at webpackConfig (/home/runner/actions-runner/_work/server/server/cypress.config.ts:119:19)

This was referenced Mar 12, 2024
This was referenced Mar 20, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
This was referenced Jul 30, 2024
@Altahrim Altahrim mentioned this pull request Aug 5, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 6, 2024
@skjnldsv skjnldsv marked this pull request as draft November 15, 2024 13:08
@blizzz blizzz modified the milestones: Nextcloud 31, Nextcloud 32 Jan 29, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
@st3iny st3iny closed this Oct 6, 2025
@github-project-automation github-project-automation bot moved this from 🏗️ In progress to ☑️ Done in 💌 📅 👥 Groupware team Oct 6, 2025
@st3iny st3iny deleted the login-less-custom-bundle branch October 6, 2025 11:49
@st3iny st3iny removed this from the Nextcloud 33 milestone Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ☑️ Done

Development

Successfully merging this pull request may close these issues.

7 participants