Svelte is a compiler-based UI framework that shifts work from runtime to build time, producing minimal JavaScript with no virtual DOM. Svelte 5 introduces runes for explicit, fine-grained reactivity. SvelteKit is the full-stack framework built on Svelte, providing file-based routing, server-side rendering, and deployment adapters.
When to use: Full-stack web apps, static sites, progressive enhancement, SSR/SSG, projects needing small bundle sizes, migration from Svelte 4 to 5.
When NOT to use: React/Vue ecosystem lock-in, projects requiring extensive third-party component libraries only available for other frameworks, teams with no Svelte experience on tight deadlines.
Svelte 5 和 SvelteKit 框架模式。涵蓋符文($state、$driven、$effect、$props、$bindable、$inspect)、片段、細粒度反應性、元件組合和事件處理。 SvelteKit 的覆蓋範圍包括基於檔案的路由、伺服器和通用載入函數、表單操作、掛鉤、適配器和錯誤處理。包括 Svelte 4 到 5 遷移指南(儲存到符文、on:event 到 onevent、插槽到片段)。 在建置 Svelte 5 元件、設定 SvelteKit 路由、實作表單操作、從 Svelte 4 遷移或偵錯反應性問題時使用。 來源:oakoss/agent-skills。