diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2024-02-06 14:54:39 +0100 |
---|---|---|
committer | Richard Steinmetz <richard@steinmetz.cloud> | 2024-02-07 11:15:06 +0100 |
commit | dd4e05773d0e6aa9b976cbe50849548d1f9c9ad1 (patch) | |
tree | 3a4b2c630a4ec57fe4a2edcdfd07cb8b21db8f84 /core/src | |
parent | 840e8fcb772f15e815b043c43678fa64512213e6 (diff) | |
download | nextcloud-server-dd4e05773d0e6aa9b976cbe50849548d1f9c9ad1.tar.gz nextcloud-server-dd4e05773d0e6aa9b976cbe50849548d1f9c9ad1.zip |
chore(perf): prevent unnecessary bundling of caniuse-lite
It does not support tree shaking as they are still building a cjs
bundle. However, they bundle certain futures to separate smaller modules
which we can take advantage of.
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/views/UnsupportedBrowser.vue | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/core/src/views/UnsupportedBrowser.vue b/core/src/views/UnsupportedBrowser.vue index f9125fa9958..fbd26a66946 100644 --- a/core/src/views/UnsupportedBrowser.vue +++ b/core/src/views/UnsupportedBrowser.vue @@ -2,6 +2,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 - @@ -53,6 +54,8 @@ import { translate as t, translatePlural as n } from '@nextcloud/l10n' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js' import Web from 'vue-material-design-icons/Web.vue' +// eslint-disable-next-line n/no-extraneous-import +import { agents } from 'caniuse-lite/dist/unpacker/agents.js' import { browserStorageKey } from '../utils/RedirectUnsupportedBrowsers.js' import { supportedBrowsers } from '../services/BrowsersListService.js' @@ -69,12 +72,6 @@ export default { NcEmptyContent, }, - data() { - return { - agents: {}, - } - }, - computed: { isMobile() { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) @@ -109,12 +106,12 @@ export default { }) return Object.keys(list).map(id => { - if (!this.agents[id]?.browser) { + if (!agents[id]?.browser) { return null } const version = list[id] - const name = this.agents[id]?.browser + const name = agents[id]?.browser return this.t('core', '{name} version {version} and above', { name, version, }) @@ -122,13 +119,6 @@ export default { }, }, - async beforeMount() { - // Dynamic load big list of user agents - // eslint-disable-next-line n/no-extraneous-import - const { agents } = await import('caniuse-lite') - this.agents = agents - }, - methods: { t, n, |