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。