Skip to content

perf(admin): turn code splitting on so date-fns locales and other dynamic imports load on demand - #938

Merged
rubenvdlinde merged 2 commits into
developmentfrom
cloud/b-versioniq-help-admin-shell-split
Nov 30, 2026
Merged

rubenvdlinde merged 2 commits into
developmentfrom
cloud/b-versioniq-help-admin-shell-split

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What

Turns code splitting on in vite.config.ts. @nextcloud/vite-config switches it off for a single-entry app, so every dynamic import was inlined into js/versioniq-main.mjs.

Why

PERF-HANDOFF item (help-integriq-1, 29 Nov): adopting CnAdminSettingsShell (#883) grew the admin page's one script from 771 kB to 3.3 MB. Re-measured today on development (@conduction/nextcloud-vue 2.270.0), source-map attributed:

  • date-fns 579 kB: 531 locale modules. @nextcloud/vue's NcDateTimePicker (reached through NcActionInput) loads each locale with import(), and with splitting off all 531 were inlined.
  • library board-look sheet 307 kB, @nextcloud/dialogs 290 kB, @nextcloud/vue 288 kB, nc-vue nl.json 219 kB, webdav 147 kB, @vuepic/vue-datepicker 135 kB.

Numbers (production build, same commit, only this flag differs)

before after
scripts loaded by the page up front (entry + its static imports) 3,339,805 B in 1 file 2,077,209 B in 19 files (-38%)
all js/*.mjs 3,339,805 B 3,528,108 B (the rest loads on demand)

Lazy chunks and their CSS resolve through window.OC.filePath('versioniq', ...) (vite-config's renderBuiltUrl), so they load from the app's own path.

Scope

Yesterday's branch also turned the tab panels into async components; that part conflicted with the board-name changes on development and is left out, so this PR is the one config flag.

Checks

  • Merged development in (no rebase)
  • hydra scripts/diff-check.sh --base origin/development: GREEN, 1 file changed
  • npm run build: OK
  • npm run lint: 0 new; the 1 error is inherited (intentionally broken fixture tests/unit/Service/Advisory/fixtures/bundled/broken/vendor/composer/installed.json)
  • vitest run: 3523/3523 tests pass; HistoryPanel.sbom.spec.ts fails to load (.css extension) on development as well (vitest uses its own vitest.config.ts)
  • composer check:strict: not run. composer install timed out through the cloud proxy; this PR touches no PHP
  • Live check: admin page renders and the date pickers open (lazy chunk loads). Not measured on the reference stack

Assisted-by: ClaudeCode:claude-opus-5-5


Generated by Claude Code

…[skip ci]

@nextcloud/vite-config turns code splitting off for a single entry, so the admin page loaded all of @conduction/nextcloud-vue in one 3.3 MB file. With codeSplitting on and the panels of every tab but Apps as async components, the page loads 1.87 MB statically.

Assisted-by: ClaudeCode:claude-opus-5-5
…niq-help-admin-shell-split

# Conflicts:
#	src/App.navigation.spec.ts
#	src/App.vue
@rubenvdlinde
rubenvdlinde merged commit 0ba07cb into development Nov 30, 2026
5 of 9 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/versioniq @ 9bb4cb2

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ❌
phpstan ✅
phpmetrics ✅
eslint ❌
stylelint ❌
build ✅
composer ✅ ✅ 58/58
npm ✅ ✅ 529/529
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ❌
Newman ⏭️
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-30 13:54 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant