Skip to content

chore(deps): vite 8 (Rolldown) - #11

Merged
pergerch merged 1 commit into
devfrom
chore/vite-8
Oct 29, 2026
Merged

pergerch merged 1 commit into
devfrom
chore/vite-8

Conversation

@pergerch

Copy link
Copy Markdown
Member

Summary

Vite 6.4.5 → 8.3.5 for the library, the site and the map0-check build. Rolldown and Oxc replace Rollup and esbuild, so esbuild leaves the dependency graph. Vitest 5 runs on Vite 8 unchanged.

 packages/ui/vite.config.ts, site/vite.config.ts, packages/check/vite.config.ts
-  build.rollupOptions                      # deprecated alias in Vite 8
+  build.rolldownOptions
+    output.comments: { legal: true }       # ui + site: keep the licence headers (see below)
 scripts/check-size.mjs
-  static edges minus every file the chunk also import()s
+  static edges as matched (`import(` never matched the pattern anyway)
 pnpm-workspace.yaml
-  allowBuilds.esbuild

Three things Rolldown does differently, in the code comments and in docs/09 §5:

  • Licence headers. Vite 8 drops legal comments whenever it minifies (comments.legal = !minify). That stripped 34 of 35 @license headers (Lit ×12, DOMPurify, jsPDF). output.comments.legal brings them back, as esbuild kept them. The cost is 0.3 KB of the page tier. Drop the two lines if the THIRD-PARTY-NOTICES file is enough.
  • Size script. Rolldown merges print into the engine chunk, which then imports MapLibre statically and via import(). check-size.mjs discarded static edges to files that were also dynamic targets, so the whole map tier showed up as "deferred". On the Vite 6 dist the fix changes nothing (0 tier changes).
  • No hoisting. Rolldown does not hoist transitive imports (hoistTransitiveImports is "not implemented yet"), so the configurator entry no longer imports MapLibre at all. The flat entry keys (02a7600) and the copyMaplibreDist guard stay. The guard still fires under Rolldown: a chunks/ subfolder fails the build with the intended message.

Chunk layout, packages/ui/dist (hash-normalised):

-map0.js (0.8 KB facade) → index-* (Lit + element) + extends-* (schema)
+map0.js (element, 17 KB) + decorate-* / query-* (Lit) + public-* (schema)
-index-* ×8, print-*, template-*         # print + template merged into the core chunk
+src-* ×3, esm-* ×2, lib-*, dist-*       # index modules named after their directory
+signals-*, rolldown-runtime-*           # CJS interop helpers (geotiff, ogc-client)
+basemaps-*, bbox-*, vector-*            # 50-byte facades for the INEFFECTIVE_DYNAMIC_IMPORT targets

Every named feature chunk (popup, measure, print-dialog, add-layer-dialog, file-import, jspdf, purify, …) keeps its name. In dist-site the HTML file list is identical, assets/ is still flat, and no Ace worker or mode file is emitted. Each page has 8 modulepreload hints instead of 5.

Evidence

pnpm size, KB gzip:

tier Vite 6 Vite 8
page load (budget 40) 35.3 34.1
+ first map 477.8 475.3
+ on demand 602.3 580.3
map in view 513.2 509.4

Run locally on this branch (Windows on ARM), all green:

  • pnpm typecheck, pnpm test (377, Vitest 5.0.5 on Vite 8), pnpm build
  • pnpm smoke 80/80, pnpm visual 12/12 (win32 baselines; CI compares against linux)
  • pnpm size, pnpm build:site
  • map0-check tarball: built, packed and verified. The bundle went from 100.6 to 103.5 KB because the unminified output now carries // module comments. It still contains the same 18 modules, no MapLibre and no jsPDF.
  • Release path: pnpm build:npm (same 36 third-party notices), e2e/verify-tarball.mjs 8/8, e2e/verify-types.mjs 11/11
  • e2e/verify-demos.mjs against the Vite 8 dev server: 50/50
  • Every /assets reference in the built HTML and every relative import or preload path in the chunks resolves (622 refs, 0 missing).
  • In the browser, dev (pnpm dev) and the build (pnpm serve):
    • vector tiles: 3,460 building + 20 water features through MapLibre's worker
    • GeoJSON: 101 clusters, 61 U-Bahn, 3 areas, 1 inline feature
    • COG: ortho, DEM hillshade + 7-step ramp, classified raster
    • built configurator: mounts from assets/configurator-index-*.js
    • playground: Ace without a worker, gutter marks for JSON and config errors, Ctrl-F
    • no failed requests, empty console

Merge Danger

Door: two-way. It is one commit: reverting it and running pnpm install restores Vite 6.

Blast Radius: bundle layout.

map0-viewer's dist/ gets different chunk names and four more files. Consumers who deploy "the folder" are unaffected, but anyone who lists chunk files by name (a CSP hash list, a CDN preload) has to follow along. The next release ships this layout. CI runs visual on linux baselines, which were not run locally (Docker image not pulled).

🤖 Generated with Claude Code

Vite 6.4.5 -> 8.3.5 for the library, the site and the map0-check build.
Rolldown and Oxc replace Rollup and esbuild. esbuild leaves the
dependency graph, so its allowBuilds entry goes too. Vitest 5 runs on
Vite 8 as it is.

- build.rollupOptions -> build.rolldownOptions (the old name is a
  deprecated alias).
- Vite 8 strips legal comments whenever it minifies. The library and the
  site set output.comments.legal, so the licence headers of Lit,
  DOMPurify and jsPDF stay in the chunks, as they did with esbuild.
- scripts/check-size.mjs dropped a static edge when the same chunk also
  import()ed the same file. Rolldown merges print into the engine chunk,
  which imports MapLibre both ways, and the whole map tier was reported
  as deferred. The filter is gone; on the Vite 6 dist it changes nothing.
- Rolldown does not hoist transitive imports, so the configurator entry
  no longer imports MapLibre at all. copyMaplibreDist still fails a
  misplaced chunk (tried with a chunks/ subfolder), and the site keeps
  its flat entry keys. docs/09 section 5 says what else changed: no
  entry facade, index chunks named after their directory (src-, esm-,
  lib-, dist-), 50-byte facades for ineffective dynamic imports.

Page tier 35.3 -> 34.1 KB gzip (33.8 without the licence headers),
first map 477.8 -> 475.3 KB, on demand 602.3 -> 580.3 KB.
@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://brave-mud-0c9fbf503-11.westeurope.7.azurestaticapps.net

@pergerch
pergerch merged commit 6f1fd19 into dev Oct 29, 2026
3 checks passed
@pergerch
pergerch deleted the chore/vite-8 branch October 29, 2026 20:19
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