DEV Community

Cover image for Storyblok/Svelte - now with TypeScript support 🎉
Josefine Schfr for Storyblok

Posted on

5 3

Storyblok/Svelte - now with TypeScript support 🎉

We are super excited to announce that over the last couple of days, we put our heads together to improve our Svelte SDK. We added TypeScript to the library to make sure you’ll get an even better experience working with our Svelte SDK 🎉

➡️ Want to check out how to connect Storyblok to your SvelteKit project right away? Follow this 5 minute tutorial.

➡️ Curious to see the TS support in action? This way, please: Storyblok Svelte & TS SDK Demo.

Now, when using storyblok/svelte in your own project, you get auto-completion, static typing & warnings in case something doesn’t add up (even if you are not using TypeScript yourself! 👀)


Check it out yourself:

animation of the suggestions you get for different parameters on the storyblokinit function

In main.ts we can now get suggestions for the different parameters of the storyblokInit() and will get an error in case you are adding the components in an incorrect format.

animation of adding lang=

Adding the lang=“ts” to your .svelte files gives your static typing and will suggest all the methods available for different functions.

Animation of adding TypeScript to the grid.svelte and getting errors when failing to pass the block attribute

Even if you forget to pass on the {blok} attribute, you will get a friendly reminder.

Stay tuned - we are planning to roll out TypeScript support for all our other SDKs as well 🎉

By the way, if you are looking for some guidance on how to integrate TypesSript in your Svelte project, check out this article in their docs.

And of course, we are curious to know what you think! Let us know how you like it and what would make it even better! ⬇️

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (2)

Collapse
 
alexjoverm profile image
Alex Jover

It love the final result 😍

Collapse
 
josefine profile image
Josefine Schfr

Me too! Thank you so much for your support on this, Alex 🙌

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay