Loading video...

Video Failed to Load

Go Home

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

85,456 views • 3 years ago •via X (Twitter)

10 Comments

Simon H's profile picture
Simon H3 years ago

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's profile picture
Simon H3 years ago

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's profile picture
Simon H3 years ago

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's profile picture
Simon H3 years ago

Check out the blog post for more info:

Hunter Johnston's profile picture
Hunter Johnston3 years ago

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

JYC 🦋's profile picture
JYC 🦋3 years ago

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

Fabian B.'s profile picture
Fabian B.3 years ago

One of the things I love about @nuxt_js 3 💚

Thomas G Lopes 🦋's profile picture
Thomas G Lopes 🦋3 years ago

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's profile picture
Richard Simpson / Moro3 years ago

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

Simon H's profile picture
Simon H3 years ago

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

Related Videos