Skip to content

Svelte 5, with the Vite 8 toolchain it needs (supersedes #226) - #230

Merged
xuelink merged 1 commit into
mainfrom
claude/svelte-5
Sep 24, 2026
Merged

xuelink merged 1 commit into
mainfrom
claude/svelte-5

Conversation

@xuelink

@xuelink xuelink commented Sep 24, 2026

Copy link
Copy Markdown
Member

Step 1 of the Svelte 5 move: the toolchain changes and only what the upgrade itself breaks is fixed. Svelte 5 runs the existing Svelte 4 components as they are; the runes rewrite follows in its own PR.

What changes

  • Packages: svelte 5.57, vite 8.3, @sveltejs/vite-plugin-svelte 7, vitest 5 (supersedes Bump @vitest/mocker and vitest #226), svelte-check 4, mdsvex 0.12, prettier 3 + prettier-plugin-svelte 4, eslint-plugin-svelte 2.46, @types/node 22. Sass pinned at 1.77.6, the last release before the mixed-declarations warning. Unused @neoconfetti/svelte removed.
  • Node 22 in CI and the deploy (Vitest 5 requires it; Node 20 is out of support).
  • mdsvex over .md only. It used to process every .svelte file for the four legal pages written as markdown; under Svelte 5 it broke SvelteKit's generated root.svelte. Those four are .md now.
  • Blog HTML via svelte/server's render(). Svelte 5 components have no .render(); without this, reading times, TOC headings, app chips and RSS bodies went empty on a green build.
  • Word counts treat tags as spaces, since Svelte 5 emits less whitespace between tags. 20 posts now read a minute longer.
  • CSS: three closed lists keep their last hairline (the global .rows rule now outweighs Svelte 5's lighter scoped selectors), and the kinds-map pills use a class instead of a:has(.icon), which Svelte 5 drops.
  • image-transmutation removed. It crashes on Node 22/24, left every original image unchanged, and only added 464 unreferenced webp/avif files (~20 MB).
  • Self-closing non-void tags written out in full.

Checked

  • CI replayed in a clean copy under Node 22: install, npm run check (0 errors), build (1371 pages).
  • Against a build of main: every page has the same element tree, visible text, head and JSON-LD, except the reading-time figures; sitemap has the same 1370 URLs; RSS has the same 103 items and word count.
  • Computed styles of every element compared with main on 20 page types, at 1280 and 390 px, light and dark: identical to within 0.01 px.
  • In the browser: hydration on Svelte 5, the compare picker (?vs= and clicks), vocabulary test, meaning quiz, blog post, legal pages, nested 404.

🤖 Generated with Claude Code

Svelte 5 runs Svelte 4 components as they are, so this moves the toolchain
and fixes only what the upgrade itself breaks. The runes rewrite comes next,
separately.

- svelte 5.57, vite 8.3, @sveltejs/vite-plugin-svelte 7, vitest 5,
  svelte-check 4, mdsvex 0.12, prettier 3 with prettier-plugin-svelte 4,
  eslint-plugin-svelte 2.46, @types/node 22. Sass is pinned at 1.77.6:
  Vite 8 wants 1.70 or later, and 1.77.7 onwards warns about declarations
  after nested rules. @neoconfetti/svelte was never imported; it goes.
- CI and the deploy run on Node 22. Vitest 5 requires it, and Node 20 left
  support in April.
- mdsvex runs over .md files only. It used to run over every .svelte file
  for the four legal pages written as markdown inside a component, and under
  Svelte 5 it rewrote SvelteKit's generated root.svelte into markup that no
  longer compiles. Those four are .md files now.
- Blog post HTML comes from render() in svelte/server: Svelte 5 components
  have no render() of their own, and the old guard turned that into empty
  reading times, headings, app chips and RSS bodies with a green build.
- Word counts turn tags into spaces. Svelte 5 leaves less whitespace between
  tags, and stripping them outright glued words together. Twenty posts now
  read a minute longer, the counts being closer to the text.
- CSS, from a computed-style diff of main against this branch: Svelte 5's
  scoped selectors weigh less, so the global .rows rule took the last
  hairline off three closed lists (the compare picker, the check rows, the
  plans limits); and Svelte 5 leaves a:has(.icon) out of the CSS, so the
  kinds-map pills get a class instead.
- The image-transmutation postbuild goes. It crashes on Node 22 and 24, left
  every original image byte for byte as it was, and added 464 webp/avif
  files (about 20 MB) that no page uses.
- Self-closing non-void tags written out in full, as Svelte 5 asks.

Checked against a build of main: all 1371 pages have the same element tree,
visible text, head and JSON-LD, apart from those reading times; the sitemap
lists the same 1370 URLs; the RSS feed has the same 103 items and words.
Computed styles match on 20 page types at 1280 and 390 px, light and dark,
to within 0.01 px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xuelink
xuelink merged commit e43334d into main Sep 24, 2026
1 check passed
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