feat: Migrate to SvelteKit 3 - #244
Draft
hhvrc wants to merge 5 commits into
Draft
Conversation
Ran `sv migrate sveltekit-3` and worked through the manual tasks it collected.
Config:
- `experimental.tracing` -> top-level `tracing.server`, and
`experimental.instrumentation` is gone (instrumentation.server.ts is picked
up automatically now)
- `vitePlugin.inspector` moves to the top level of the sveltekit() options
- `KitConfig` is no longer exported from `@sveltejs/kit`; take `Config` from
`@sveltejs/kit/vite` instead
- tsconfig extends `$app/tsconfig`, mirrors the new `#lib` subpath imports in
`paths` (svelte-check resolves .svelte imports itself and only understands
tsconfig paths, not package.json imports) and keeps type-checking the
config, plugin and e2e sources
Paths:
- `Path` no longer carries a leading slash, so pathname literals, breadcrumb
and sidebar entries drop it
- `prefixBase()` still takes a union-typed pathname, which `resolve()` cannot
(it is generic over a single literal path), and derives the base path from
PUBLIC_SITE_URL the same way vite.config.ts does — `resolve()` returns a
path relative to the page being rendered, which cannot be compared against
page.url.pathname nor back the absolute URLs in the sitemap and canonical
tags
Environment, hooks and navigation:
- `$env/static|dynamic/*` -> `$app/env/*` through the generated src/env.ts;
the previously dynamic variables keep an empty-string fallback, which every
consumer treats exactly like the old `undefined`
- `handleError` discriminates on `kind`, so expected app and framework errors
(404s and friends, which SvelteKit 3 also routes through the hook) log at
warn instead of drowning real defects in telemetry
- `replaceState()` -> shallow `goto()`, `keepFocus`/`noScroll` -> `reset`
- parameter matchers consolidated into src/params.ts
Also fixes three bugs the type checker surfaced on the way:
- the logo asset is `logo.svg`, not `Logo.svg`, so the social preview image
and the welcome screen preload were 404ing
- public-routes.ts cast its computed paths to `Path`, which hid the
leading-slash change from the compiler — sitemap.xml and llms.txt would
have emitted `https://home/`-style URLs
- redirectLegacyHashRoute() was handed `resolve('')`, yielding the
protocol-relative `//home`
`pnpm run check` passes `--tsgo`, which svelte-check only honours when TypeScript 7 is installed under the `@typescript/native` npm alias — otherwise it aborts with "requires TypeScript 7 to be installed in the workspace". It was resolving only because pnpm hoists the alias out of the packages/svelte-core workspace package, so any lockfile change that dropped it there silently broke type-checking here. Declare it locally, matching the version svelte-core pins. TypeScript itself stays on 6: @sveltejs/kit 3, svelte-check and typescript-eslint all cap their `typescript` peer below 7.
The (app) auth gate sent the interrupted destination to /login as `next`, but nothing ever read that parameter: the login flow and the (auth) layout both go through gotoQueryRedirectOrFallback(), which reads REDIRECT_QUERY_PARAM. Signing back in after a session expired therefore always landed on /home. Use the constant on both sides so the two halves cannot drift again.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
openshock-app-dev | 8e69b0a | Aug 20 2026, 02:15 PM |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
All seven conflicts were the same kind: develop reached the same result in SvelteKit 2 spelling while this branch had already migrated it. - `asset()`/`resolve()` arguments keep this branch's slashless form; the substance of develop's `Logo.svg` -> `logo.svg` casing fix is already here. - `#lib/...js` imports keep this branch's subpath form over `$lib`. - develop's redirect-after-reauth fix is the same change as f609688. - pnpm-lock.yaml follows package.json in dropping formsnap and sveltekit-superforms from the root importer; packages/svelte-core keeps both.
package.json keeps this branch's prerelease pins for `@sveltejs/kit` and both adapters, plus its `#lib` imports map, and takes develop's other bumps — vite-plugin-svelte, svelte, svelte-check, svelte-sonner and pnpm 11.22.0. pnpm-lock.yaml is regenerated from this branch's copy so the SvelteKit 3 prereleases stay pinned. Regenerating left a stale svelte 5.56.8 beside 5.56.9, which is the duplicate that makes every snippet fail to type-check against a `Snippet` prop; `pnpm dedupe` collapses it, and the `dedupe --check` step this merge brings in from develop guards it going forward. The submodule points at svelte-core's own feature/svelte-kit-3 rather than its master, and .gitmodules now records that branch, so `git submodule update --remote` tracks the migration branch here instead of pulling master back in.
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.
No description provided.