Skip to content

Move to SvelteKit 3 - #43

Merged
vivecuervo7 merged 9 commits into
kit-3-idiomsfrom
kit-3-upgrade
Nov 7, 2026
Merged

vivecuervo7 merged 9 commits into
kit-3-idiomsfrom
kit-3-upgrade

Conversation

@vivecuervo7

@vivecuervo7 vivecuervo7 commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

What

Moves Docent to SvelteKit 3.1 and adapter-node 6.

  • $lib imports become #lib/….js subpath imports declared in package.json, since Kit 3 no longer generates the alias. The tests now resolve them the same way, so vitest.config.ts loses its own alias.
  • The round matcher moves from src/params/round.ts to a single src/params.ts using defineParams.
  • The Handle type comes from its new @sveltejs/kit/hooks entry point.
  • json() becomes Response.json() in every route, hooks.server.ts and /mcp, as Kit 3 deprecates the helper.
  • ThreadTriage's goto uses replace and reset: false in place of replaceState, noScroll and keepFocus.
  • Requests that change something but carry no body are marked as JSON (sendWithoutBody), since Kit 3's CSRF check refuses them otherwise once built: adapter-node takes the server to be https, so the page's http Origin never matches.
  • npm test syncs SvelteKit first, as the tsconfig now extends the generated $app/tsconfig.
  • tsconfig.json extends $app/tsconfig; Node 22.17 or later is required.

Why

The first step of the SvelteKit idiom pass: everything after it (remote functions, hooks, error boundaries) is written against Kit 3, so it's done once rather than twice.

How

The official sv migrate sveltekit-3 tasks were run one at a time, one commit each, so each step can be reviewed on its own; the tool's manual-task list was then worked through by hand.

Checked on this branch: a fresh npm ci with npm scripts off followed by npm test (54 passing), npm run check, a production build served with a copy of the data, vite dev, the start page, a four-round PR's tabs and round switch, a slice, Settings, Stats and Getting started in a browser, a ?thread= deep link, and /mcp (initialize, tools/list, foreign-Host 403). Bodiless changes were checked against a production build from a browser.

🤖 Generated with Claude Code

vivecuervo7 and others added 8 commits November 8, 2026 07:24
…$app/tsconfig

SvelteKit 3 needs Node 22.17 or later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tests resolve #lib through package.json too, so they no longer need an alias of their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SvelteKit 3 deprecates its json() helper and folds goto's noScroll and keepFocus into reset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…em through

SvelteKit 3 refuses a POST or DELETE with no content type whose Origin isn't its own, and adapter-node takes the server to be https, so deleting a review, stopping a generation or agent review, removing a persona, reviewer or provider, and resetting or running Stats' analysis were all refused once built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tsconfig now extends $app/tsconfig, which only exists once SvelteKit has synced, and npm skips the prepare script where scripts are turned off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vivecuervo7 vivecuervo7 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Low] The PR body says the ParamMatcher type moved to @sveltejs/kit/params, but the matcher was replaced.

web/src/params.ts uses defineParams and imports no ParamMatcher; src/params/round.ts is deleted. The description should say the matcher was rewritten with defineParams.

Comment thread web/package.json Resolved
Comment thread web/tsconfig.json Resolved
@vivecuervo7

Copy link
Copy Markdown
Owner Author

On the review body: the description now says the round matcher was rewritten with defineParams rather than that ParamMatcher moved, and it also covers the two fixes above (02ca538, 36a78b7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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