Skip to content

feat!: migrate adapter to SvelteKit 3 (beta) - #20

Merged
ivanbarlog merged 1 commit into
mainfrom
feat/sveltekit-3-migration
Sep 30, 2026
Merged

ivanbarlog merged 1 commit into
mainfrom
feat/sveltekit-3-migration

Conversation

@ivanbarlog

Copy link
Copy Markdown
Contributor

Summary

Migrates the adapter to SvelteKit 3, targeting v3 only (drops SvelteKit 2 support). Ships as a beta for testing against expense-ease.

Changesets beta pre-mode is active (.changeset/pre.json), so the Version Packages PR will compute a -beta.N version. With the pending minor (SK3 migration) + patch (keep-active) changesets, this resolves to 0.9.0-beta.0 under the beta dist-tag.

Adapter changes

  • Replace the removed builder.generateManifest + "SERVER"/"MANIFEST" string-substitution flow with builder.generateServerInstance(...). The emitted module exports a ready server object, so the node/bun handler & stream entries now import { server } from "SERVER" and call server.init(...) / server.respond(...) instead of constructing the deprecated Server class.
  • Read paths.base from the flattened builder.config.paths.base (builder.config.kit was removed).
  • Replace deprecated builder.mkdirp / builder.rimraf with node:fs.
  • Rework server instrumentation to the new flow: createInstrumentationInitializer(...) → include initializer in the bundle → per-entrypoint builder.instrument(...).
  • Bump @sveltejs/kit peer dependency to ^3.0.0; pin dev dep to 3.0.0-next.31.

Examples

  • Move config out of svelte.config.js (unsupported in v3) into the sveltekit({...}) Vite plugin; delete the svelte.config.js files.
  • Replace deprecated json() with Response.json(...).

Verification

  • bun run check (oxfmt + oxlint): 0 warnings, 0 errors
  • bun test: 75 pass, 0 fail (47 AWS-gated integration tests skipped)
  • bun --bun run build.ts: succeeds
  • tsc --noEmit: passes against the real v3 types

Follow-ups before/after beta

  • Peer-dep warning: ^3.0.0 does not match -next prereleases under semver, so consumers on a v3 prerelease see a benign peer warning during install.
  • Instrumentation is untested end-to-end (expense-ease uses no instrumentation.server.*); validate on a real deploy if a consumer enables it.
  • Sourcemap/stack-trace mapping in CloudWatch should be validated once expense-ease runs on the beta (build-time re-bundle with sourcemap: "linked").
  • Exit beta pre-mode (changeset pre exit) before cutting the stable 0.9.0.

Target SvelteKit 3 only; drop SvelteKit 2 support.

- Replace removed builder.generateManifest + "SERVER"/"MANIFEST"
  substitution with builder.generateServerInstance; node/bun handler and
  stream entries now import { server } from "SERVER" and call
  server.init/server.respond instead of constructing the deprecated Server.
- Read paths.base from flattened builder.config.paths.base
  (builder.config.kit removed).
- Replace deprecated builder.mkdirp/builder.rimraf with node:fs.
- Rework instrumentation to createInstrumentationInitializer + bundled
  initializer + per-entrypoint builder.instrument.
- Bump @sveltejs/kit peer dependency to ^3.0.0.
- Update examples to SvelteKit 3: move config from svelte.config.js into the
  sveltekit() Vite plugin and replace deprecated json() with Response.json().
@ivanbarlog
ivanbarlog force-pushed the feat/sveltekit-3-migration branch from 7b131f8 to beee072 Compare September 30, 2026 20:24
@ivanbarlog
ivanbarlog merged commit e1001b4 into main Sep 30, 2026
4 checks passed
@ivanbarlog
ivanbarlog deleted the feat/sveltekit-3-migration branch September 30, 2026 20:26
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