From 731cdb8d76b116703df4a8e1193418307f9eb963 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 18 May 2026 22:19:21 +0200 Subject: [PATCH 1/3] chore(config): use ES2020 for typescript modules This allows us to use async imports Signed-off-by: Max --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index b2f1898573..23aa24f0ec 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ "sourceMap": false, "noImplicitAny": false, "moduleResolution": "node", - "module": "es6", + "module": "es2020", "target": "es5", "jsx": "react", "allowJs": true From 60a910b76f09e75cf8bc469a77b255240612b7e1 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 18 May 2026 22:22:22 +0200 Subject: [PATCH 2/3] chore(import): use async import for showError `buildInCode` is imported from `viewer.js` which is loaded in a lot of places. So let us keep it small (100k instead of 700k). Signed-off-by: Max --- src/services/builtInCode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/builtInCode.ts b/src/services/builtInCode.ts index 30aaf69efa..12a042a862 100644 --- a/src/services/builtInCode.ts +++ b/src/services/builtInCode.ts @@ -6,7 +6,6 @@ import { generateUrl } from '@nextcloud/router' import { getCapabilities, capabilitiesService } from './capabilities' import axios from '@nextcloud/axios' -import { showError } from '@nextcloud/dialogs' const wopiUrl = getCapabilities()?.config?.wopi_url const isConfigured = wopiUrl !== '' @@ -23,6 +22,7 @@ const autoSetupBuiltInCodeServerIfNeeded = async () => { if (result?.data?.capabilities) { capabilitiesService.setCapabilities(result?.data?.capabilities) } else { + const { showError } = await import('@nextcloud/dialogs') showError('Could not autoconfigure built-in CODE server, click to open the admin settings for further details: ' + result?.data?.message, { onClick: () => { window.location.href = generateUrl('settings/admin/richdocuments') From fdc26d6f07f01771150dd3131843b633ed4da074 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 18 May 2026 22:24:08 +0200 Subject: [PATCH 3/3] chore(import): from @nextcloud/vue functions The corresponding chunks are much smaller than NcRichText. Reduces `references` file size from 1M to < 500k. Signed-off-by: Max --- src/reference.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reference.js b/src/reference.js index 8c27527ae5..474ca39ea4 100644 --- a/src/reference.js +++ b/src/reference.js @@ -8,7 +8,7 @@ import './init-shared.js' import Vue from 'vue' import { translate as t } from '@nextcloud/l10n' -import { registerCustomPickerElement, NcCustomPickerRenderResult } from '@nextcloud/vue/dist/Components/NcRichText.js' +import { registerCustomPickerElement, NcCustomPickerRenderResult } from '@nextcloud/vue/dist/Functions/registerReference.js' import DocumentTargetPicker from './view/DocumentTargetPicker.vue'