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>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
st3iny authored and nextcloud-command committed Mar 6, 2024
1 parent 782f808 commit fd8a165
Show file tree
Hide file tree
Showing 33 changed files with 1,326 additions and 175 deletions.
4 changes: 1 addition & 3 deletions core/Listener/BeforeTemplateRenderedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @copyright 2022 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Richard Steinmetz <richard@steinmetz.cloud>
*
* @license GNU AGPL version 3 or any later version
*
Expand Down Expand Up @@ -51,9 +52,6 @@ public function handle(Event $event): void {
\OC_Util::addStyle('server', null, true);

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

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
1 change: 1 addition & 0 deletions dist/615-615.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions dist/662-662.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>
*
* @author Ferdinand Thiessen <opensource@fthiessen.de>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
1 change: 1 addition & 0 deletions dist/662-662.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

Loading

0 comments on commit fd8a165

Please sign in to comment.