perf(build): port webpack production build optimizations from Codeberg PR #108 - #2061
Open
SudoThijn wants to merge 1 commit into
Open
perf(build): port webpack production build optimizations from Codeberg PR #108#2061SudoThijn wants to merge 1 commit into
SudoThijn wants to merge 1 commit into
Conversation
Applies the same production build changes previously done on the development branch: minify with esbuild instead of Terser (native Go minifier, no Node worker overhead), drop source maps and the in-memory webpack cache in production, and split shared vendor deps into dedicated chunks via splitChunks instead of duplicating them per entry. Since entries are no longer self-contained after splitting, add ScriptManifestLoader (+ unit tests) to enqueue every initial chunk for an entry from the build-emitted js/openregister-entrypoints.json manifest, falling back to the legacy single script if the manifest is absent. Switch all script-loading call sites (main index, admin settings, files sidebar, mail sidebar) to it. Also fixes a pre-existing bug that made production builds fail outright: the '@nextcloud/dialogs' webpack alias was missing the '$' exact-match suffix used by every other alias in this file, so subpath imports like '@nextcloud/dialogs/style.css' were rewritten to a literal path instead of resolving through the package's exports map. Baseline vs after (production npm run build): ~52s -> ~21s build time, ~8.3GiB -> ~2.24GiB peak RAM, js/ output 92M/58 files -> 17M/15 files.
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ❌ | ||||
| composer | ❌ | ✅ 147/147 | |||
| npm | ✅ | ✅ 525/525 | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-07-24 11:21 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm run buildperformance work from Codeberg PR #108 (originally landed againstdevelopment) ontohotfix/performance/main. Skips theIntegrationDashboardWidget.phphunk — that file belongs to an integration-dashboard feature that only exists ondevelopmentand hasn't merged tomainyet, so it comes along naturally on the next merge.@nextcloud/vue, pinia, the localnextcloud-vuesource, …) into a dedicatedopenregister-vendorchunk viasplitChunks, instead of duplicating them into every entry.ScriptManifestLoader(+ unit tests): since entries are no longer self-contained after splitting, this reads the build-emittedjs/openregister-entrypoints.jsonmanifest and enqueues every initial chunk for an entry, falling back to the legacy single script if the manifest is missing (dev builds, older builds). Wired up intemplates/index.php,templates/settings/admin.php,FilesSidebarListener, andMailAppScriptListener.@nextcloud/dialogswebpack alias was missing the$exact-match suffix used by every other alias in this file, so subpath imports like@nextcloud/dialogs/style.cssgot rewritten to a nonexistent literal path instead of resolving through the package'sexportsmap — this made production builds fail outright onmainbefore this PR. Confirmed pre-existing (unrelated to this change).Baseline vs. after (production
npm run build)js/output