You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deps: migrate kit from v2 to v3 and sveltejs/adapter-vercel v6 to v7 #4192
Activity
[-]deps: migrate kit from v2 to v3[/-][+]deps: migrate kit from v2 to v3 and sveltejs/adapter-vercel v6 to v7[/+]KATO-Hiro commentedon Oct 21, 2026
SvelteKit 3 移行のまとめ
SvelteKit 2.70.3 → 3.1.0、adapter-vercel 6.3.4 → 7.0.1 への移行の要点(2026-10-21 時点)。
作業の記録は plan.md、調査の詳細は survey.md にある。
いまの状況
$lib→#lib$features・@→#features#4192)なぜ移行したか
主な決定
package.jsonのimports(#lib・#features)にした。Kit 3 で alias は非推奨。sv migrateはコピーで試して一部だけ採用し、alias の置換は自前の codemod(codemod_subpath_imports.py)で行った。知っておきたい Kit 3 の挙動
fail(400)は HTTP 400 で返る(Kit 2 は 200)。$app/storesは使うと実行時に例外になるので、$app/stateを使う。$app/environmentは$app/envに変わった。resolve()に渡せるのは実在する route だけ。/始まりは route ID として扱われ、group も含めて書く。redirect()は外部の URL へは throw する。server/ディレクトリと*.server.*のファイルは、client から import できない(features/*/server/も対象)。svelte.config.jsは使えず、置くとエラーになる。設定はvite.config.tsのsveltekit()に書く。$libはどこに書いてもエラーになる。ただしvi.mock('$features/...')だけはエラーにならず、黙って無視される。.js、runes モジュールが.svelte.js。E2E では#libが解決できないので相対 import にする。根拠になったコードと、Kit 2 との比較の結果は survey.md と plan.md(Phase 2〜4)にある。
開発環境での注意
CONFIRM_API_URLが無いため(fix: drop bwrap setuid, unmask /proc for bubblewrap sandbox #4061)。/tasks/[task_id]が 500 になる。firewall が Google Apps Script への通信を通さないため。残りタスク
PR B:
別 PR(計画あり):
別 PR(計画はまだ無い):
/tasks/[task_id]が、タグの取得に失敗すると 500 になる/tasks/gradeとタグの編集、問題集の作成)TaskTableBodyCell.svelteが別の feature(votes)を import しているTabsの非推奨の props、Superforms のposted出典
$libが#libになった経緯: issue #16182、PR #16360 ほか(survey.md の「Kit 3 が$libを#libに変えた理由」)Merge pull request #4193 from AtCoder-NoviSteps/#4192