Skip to content

Commit

Permalink
perf(login): create a custom bundle for login
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
st3iny committed Aug 21, 2023
1 parent a4f3088 commit b5f19a0
Show file tree
Hide file tree
Showing 26 changed files with 878 additions and 221 deletions.
4 changes: 2 additions & 2 deletions core/Listener/BeforeTemplateRenderedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public function handle(Event $event): void {

if ($event instanceof BeforeLoginTemplateRenderedEvent) {
// todo: make login work without these
Util::addScript('core', 'common');
Util::addScript('core', 'main');
//Util::addScript('core', 'common');
//Util::addScript('core', 'main');
}

if ($event instanceof BeforeTemplateRenderedEvent) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Julius Härtl <jus@bitgrid.net>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Richard Steinmetz <richard@steinmetz.cloud>
*
* @license AGPL-3.0-or-later
*
Expand All @@ -25,8 +26,7 @@

import Vue from 'vue'

// eslint-disable-next-line no-unused-vars
import OC from './OC/index.js' // TODO: Not needed but L10n breaks if removed
import './main.js'
import LoginView from './views/Login.vue'
import Nextcloud from './mixins/Nextcloud.js'

Expand Down
2 changes: 1 addition & 1 deletion core/templates/login.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php /** @var \OCP\IL10N $l */ ?>
<?php
script('core', 'login');
script('core', 'login_standalone');
?>

<div>
Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions dist/core-login.js

This file was deleted.

168 changes: 0 additions & 168 deletions dist/core-login.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion dist/core-login.js.map

This file was deleted.

3 changes: 3 additions & 0 deletions dist/core-login_standalone.js

Large diffs are not rendered by default.

Loading

0 comments on commit b5f19a0

Please sign in to comment.