Skip to content

Commit fd8a165

Browse files
st3inynextcloud-command
authored andcommitted
perf(login): create a custom bundle for login
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>
1 parent 782f808 commit fd8a165

33 files changed

+1326
-175
lines changed

core/Listener/BeforeTemplateRenderedListener.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* @copyright 2022 John Molakvoæ <skjnldsv@protonmail.com>
77
*
88
* @author John Molakvoæ <skjnldsv@protonmail.com>
9+
* @author Richard Steinmetz <richard@steinmetz.cloud>
910
*
1011
* @license GNU AGPL version 3 or any later version
1112
*
@@ -51,9 +52,6 @@ public function handle(Event $event): void {
5152
\OC_Util::addStyle('server', null, true);
5253

5354
if ($event instanceof BeforeLoginTemplateRenderedEvent) {
54-
// todo: make login work without these
55-
Util::addScript('core', 'common');
56-
Util::addScript('core', 'main');
5755
Util::addTranslations('core');
5856
}
5957

core/src/login.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* @author John Molakvoæ <skjnldsv@protonmail.com>
66
* @author Julius Härtl <jus@bitgrid.net>
77
* @author Roeland Jago Douma <roeland@famdouma.nl>
8+
* @author Richard Steinmetz <richard@steinmetz.cloud>
89
*
910
* @license AGPL-3.0-or-later
1011
*
@@ -25,8 +26,7 @@
2526

2627
import Vue from 'vue'
2728

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

core/templates/login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php /** @var \OCP\IL10N $l */ ?>
22
<?php
3-
script('core', 'login');
3+
script('core', 'login_standalone');
44
?>
55

66
<div>

dist/615-615.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/662-662.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/662-662.js.LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>
3+
*
4+
* @author Ferdinand Thiessen <opensource@fthiessen.de>
5+
*
6+
* @license AGPL-3.0-or-later
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Affero General Public License as
10+
* published by the Free Software Foundation, either version 3 of the
11+
* License, or (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Affero General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Affero General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*
21+
*/

dist/662-662.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/759-759.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)