SvelteKit 3 已发布
SvelteKit 3

原始链接: https://svelte.dev/blog/sveltekit-3-is-here

SvelteKit 3.0 现已推出,带来更强的类型安全性、更简洁的代码库以及多项 enhancements。现有项目可通过以下命令自动迁移: `npx sv migrate sveltekit-3 --tasks all --confirm` 新项目可以使用 `sv create` 创建。主要变化包括:将配置迁移到 `vite.config.ts`、用 `#lib` 取代 `$lib` 别名、升级环境变量、减少服务工作线程样板代码,以及改进错误处理。迁移指南介绍了主要的不兼容变更。 用于安全、高效且类型安全的客户端—服务器通信的远程函数尚未准备就绪,仍是团队的首要任务。目前,这些函数需要 Async Svelte 和实验性标志才能使用。 Svelte Summit 将于 11 月 19日至20日在斯洛文尼亚卢布尔雅那举行,庆祝 Svelte 成立十周年。

Hacker News 最新 | 历史 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 SvelteKit 3 已发布 (svelte.dev) 28 分 由 sampsn 发布 2 小时前 | 隐藏 | 历史 | 收藏 | 2 条评论 帮助 blakeashleyjr 20 分钟前 | 下一页 [–] 过去几年里,SvelteKit 对我来说一直是令人耳目一新的存在。我因为工作不得不使用 Next.js,但更喜欢 SvelteKit。很期待试用这个版本! 回复 sharktheone 2 小时前 | 上一页 [–] 还在等待远程函数正式可用 :/ 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请加入 YC | 联系我们 搜索:
相关文章

原文

Version 3.0 of SvelteKit, the official application framework for Svelte, is now available.

If you’ve used earlier versions of SvelteKit, everything will feel very familiar — it’s the same framework with a little more polish, a little more type safety, and a little less junk. We’ve made migration as seamless as we can with the sv migrate command...

npx sv migrate sveltekit-3 --tasks all --confirm

...which will automatically migrate as much of your codebase as possible, and generate a TODO list for everything else. (If you’re agentically inclined, your robot friends will make short work of it.)

To create a new app, run sv create:

As with any major version bump there are a handful of breaking changes to be aware of, which are covered in the migration guide (or, more briefly, in the recent release candidate announcement).

Quick highlights:

  • configuration now lives in vite.config.ts instead of svelte.config.js
  • the $lib alias is now #lib, making use of standard subpath imports
  • environment variables are more powerful and easier to use
  • service workers are less boilerplatey
  • error handling is improved across the board

Are remote functions ready yet?

Remote functions are a set of utilities for secure, efficient, type-safe client-server communication. You’ve likely seen some version of this idea in other frameworks, but we think you’re going to prefer this one.

Using them requires Async Svelte, which for now requires an experimental flag. Bear with us.

Join us in Ljubljana next month

Svelte Summit is taking place on November 19-20 in the lovely town of Ljubljana, Slovenia. Among other things it will be a celebration of Svelte’s 10th birthday, and we’d love to share some cake with you.

联系我们 contact @ memedata.com