正在加载视频...

视频加载失败

Type safety without writing the types yourself? This is now possible for all methods and variables with special meaning to SvelteKit!

85,413 次观看 • 3 年前 •via X (Twitter)

10 条评论

Simon H 的头像
Simon H3 年前

This all started with @shuding_ sharing his work of auto-typings for Next.js. It got us inspired to see what this could look like for SvelteKit. I prototyped this and we immediately felt an improvement in productivity and DX.

Simon H 的头像
Simon H3 年前

While this is super convenient, this isn't just about that. It's also about correctness: I forgot or got some types mixed up more than once - the computer never will.

Simon H 的头像
Simon H3 年前

This is in line with Svelte's major insight that by writing code in a declarative way we can get the machine to do the bulk of the work for us, correctly and efficiently.

Simon H 的头像
Simon H3 年前

Check out the blog post for more info:

Hunter Johnston 的头像
Hunter Johnston3 年前

As usual, you and your team's work is incredible and appreciated!

JYC 🦋 的头像
JYC 🦋3 年前

Hyped!!! I guess that we have some homework to do over the weekend now 😅 +page.gql 😉

Fabian B. 的头像
Fabian B.3 年前

One of the things I love about @nuxt_js 3 💚

Thomas G Lopes 🦋 的头像
Thomas G Lopes 🦋3 年前

This is amazing! Great work 🎉 Would be perfect to have typescript syntax working on template as well for full type-safety everywhere in Svelte. Fingers crossed!

Richard Simpson / Moro 的头像
Richard Simpson / Moro3 年前

wait wait wait wait wait. How in the world does that export validation work 👀👀

Simon H 的头像
Simon H3 年前

It's part of the typescript plugin. It looks at the TS AST to check the top level exports and adds a custom error message if there's an invalid one

相关视频