feat!: migrate to rolldown based vite v8#864
Conversation
d072736 to
0724064
Compare
| // Remove unneeded whitespace | ||
| options?.minify ? minifyPlugin() : undefined, |
There was a problem hiding this comment.
Does it disable minification in build for libs by default now?
There was a problem hiding this comment.
It was disabled by default before but now we drop the useless plugin anymore.
Minification is done by OXC now not esbuild
ShGKme
left a comment
There was a problem hiding this comment.
Looks good, but haven't tested it in any app/lib yet.
|
rebased.
|
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.1 to 8.0.3. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/create-vite@8.0.3/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 8.0.3 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
…build.license` Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
|
Reverted the revert - DTS is now building. |
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
|
Tested with nc-dialog (library) and firstrunwizard (app). |
|
@susnux Anything changed except the rebase and deps update? |
|
Change I did:
|
I understand splitting into common and vendor chunks for apps with simple frequent releases when there is a new app code released with the same vendors (to keep large vendors in the cache). But in Nextcloud apps, it is always a new version with a new cache buster. Why do we need to split vendors, adding new chunks? Or I misunderstood the config completely, because |
The first splits dependencies by entry point, so if you e.g. only visit a public share you do not need all dependencies only needed by the entry point of the internal view.
then there is a common chunk with libA and a vendor1 chunk with libB and a vendor2 chunk with libC. In small apps where I tested this are enough dependencies so that it makes sense to split this. In general it depends on what you want to optimize. |
I understand it, but I don't understand the vendor split. For the networking, there is no difference in loading JS originally from |
|
| . | Before | After |
|---|---|---|
| Files | 1 entry | 1 entry + 8 chunks |
| Disk size | 594 kB |
> 2 MB |
| Page loaded | 594 kB |
809 kB |
@nextcloud/vite-config@2
- Single
594 kbentry
./js/user_retention-admin-settings.mjs.license 2.73 kB
./css/user_retention-admin-settings.css 0.09 kB │ gzip: 0.10 kB
./css/admin-settings-Cjhfk-fy.chunk.css 45.69 kB │ gzip: 7.55 kB
./js/user_retention-admin-settings.mjs 594.73 kB │ gzip: 163.09 kB │ map: 2,676.97 kB
@nextcloud/vite-config@3
- Entry:
10 kB - Chunks: up to
864 kB,2 MB+ total - Actually page loaded:
809 kB(with CSS same as old config with Webpack + Babel)
/css/user_retention-admin-settings.css 0.18 kB │ gzip: 0.14 kB
/css/admin-settings--vV92daA.chunk.css 0.44 kB │ gzip: 0.22 kB
/css/vendor~admin-settings-BqBSWqoH.chunk.css 26.22 kB │ gzip: 3.99 kB
/css/vendor~FilePicker-C1yRZfLt~index-BJkYK_Oe.chunk.css 30.96 kB │ gzip: 3.84 kB
/css/common-I3ZZVE8T.chunk.css 39.65 kB │ gzip: 6.50 kB
/css/vendor~index-HT1ZTE-Z.chunk.css 45.46 kB │ gzip: 5.68 kB
/js/rolldown-runtime-C3-KjVy0.chunk.mjs 1.48 kB │ gzip: 0.69 kB
/js/PublicAuthPrompt-7_GNN76e-DmrG4AVb.chunk.mjs 5.52 kB │ gzip: 2.08 kB │ map: 9.62 kB
/js/user_retention-admin-settings.mjs 10.76 kB │ gzip: 2.52 kB │ map: 13.71 kB
/js/ConflictPicker-CWBf0soh-CyiMEr7q.chunk.mjs 17.49 kB │ gzip: 4.27 kB │ map: 32.23 kB
/js/vendor~admin-settings-B-6Q0ZUI.chunk.mjs 193.26 kB │ gzip: 49.53 kB │ map: 709.13 kB
/js/vendor~FilePicker-C1yRZfLt~index-CYBCBbZR.chunk.mjs 317.18 kB │ gzip: 80.75 kB │ map: 584.37 kB
/js/vendor~index-BdxHDF4C.chunk.mjs 401.05 kB │ gzip: 85.98 kB │ map: 734.86 kB
/js/vendor~admin-settings-CGd9E00O.chunk.mjs 416.01 kB │ gzip: 69.95 kB │ map: 614.73 kB
/js/common-rs8Bd76p.chunk.mjs 864.47 kB │ gzip: 206.31 kB │ map: 5,011.72 kB
@nextcloud/vite-config@3 without the additional config for manual chunks
- Entry:
507 kB - Chunks:
700 kB - Actually page loaded:
780 kB
/css/user_retention-admin-settings.css 0.14 kB │ gzip: 0.13 kB
/css/NcLoadingIcon-CInLzPtA-B0phDUdw.chunk.css 0.25 kB │ gzip: 0.17 kB
/css/NcColorPicker-BHbQNmtc.chunk.css 5.01 kB │ gzip: 1.19 kB
/css/NcTextField-B8gkru0a.chunk.css 7.60 kB │ gzip: 1.44 kB
/css/FilePicker-C1yRZfLt-HdUoIA99.chunk.css 18.87 kB │ gzip: 2.66 kB
/css/NcDateTimePicker-Cl_qB34Y.chunk.css 40.32 kB │ gzip: 5.25 kB
/css/admin-settings-CKv01SmK.chunk.css 44.55 kB │ gzip: 7.27 kB
/js/NcLoadingIcon-CInLzPtA-Cr29V4HP.chunk.mjs 0.98 kB │ gzip: 0.60 kB │ map: 3.34 kB
/js/PublicAuthPrompt-7_GNN76e-Zf6BHRI3.chunk.mjs 3.23 kB │ gzip: 1.59 kB │ map: 9.47 kB
/js/NcTextField-jYX7dnJT.chunk.mjs 4.90 kB │ gzip: 1.94 kB │ map: 16.59 kB
/js/ConflictPicker-CWBf0soh-rpe0FLbL.chunk.mjs 9.15 kB │ gzip: 3.19 kB │ map: 31.70 kB
/js/_plugin-vue_export-helper-1tPrXgE0-Dr7WrFpn.chunk.mjs 9.66 kB │ gzip: 3.63 kB │ map: 55.71 kB
/js/preview-BIbJGxXF-D9fUaAqf.chunk.mjs 15.74 kB │ gzip: 6.27 kB │ map: 2,921.85 kB
/js/NcColorPicker-D6w4bgux.chunk.mjs 37.67 kB │ gzip: 12.16 kB │ map: 135.70 kB
/js/FilePicker-C1yRZfLt-CUJQ7FKR.chunk.mjs 161.48 kB │ gzip: 50.79 kB │ map: 440.06 kB
/js/NcDateTimePicker-DZR4ffoS.chunk.mjs 190.19 kB │ gzip: 53.30 kB │ map: 727.28 kB
/js/legacy-BoqDmOCa-BZnhVdKy.chunk.mjs 270.46 kB │ gzip: 80.93 kB │ map: 1,460.17 kB
/js/user_retention-admin-settings.mjs 507.77 kB │ gzip: 129.28 kB │ map: 1,802.04 kB
```## user_retenti
|
Would be also interesting to test in an app with several entries and tons of entries |
Notifications
Not so different
BeforeAfter |
|
Hm maybe a bit too optimized for one testing app. If > entrypoints currently my best universal config (to at least reduce some very small chunks caused by plugins): codeSplitting: {
groups: [
{ name: 'vendor', test: /(^\0|node_modules)/, entriesAware: true, entriesAwareMergeThreshold: 20_000 },
],
}, |
Could you elaborate this part? Why do we need some specific config for dependencies in the build? |
Its the hope that dependencies are side-effect free. |
=\ |
|
Logged it here: rolldown/rolldown#9450 |
I don't understand why it even tries to split into chunks a single entry with no dynamic imports... Vite v7 (Rollup), as expected, converts a single entry without async chunks into a single output. |
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Reviewers: Best to review commit-by-commit
This migrates the config to a rolldown-vite (vite v8) compatible version.
Due to large changes in vite compared to rollup it made sense to break compatibility here,
e.g. license is now a built-in feature of rolldown. Similar to minify which is now built-in by OXC.
So this removed all legacy features and migrated to pure rolldown compatibility.
Also testes were removed due to uselessness and replaced with proper integration tests which really check apps can be built using this configuration.