Lädt...

🔧 Announcing Storyblok Svelte SDK v5: now fully compatible with Svelte 5


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

We're thrilled to announce the release of storyblok-svelte v5, a complete refactoring of our dedicated SDK built specifically for Svelte 5 and its runes system.

This new version takes full advantage of Svelte's latest innovations to provide you with the most powerful, developer-friendly tools to integrate your Storyblok content into your Svelte applications.

Embracing the future with Svelte 5

Svelte always stood out for its compiler-focused approach that delivers exceptional performance with minimal runtime overhead.

With the introduction of runes, the framework took another leap forward into simplicity and power.

As passionate supporters of the Svelte ecosystem, we've completely rebuilt our SDK to embrace these innovations, ensuring that Storyblok users can take full advantage of these new features, while maintaining compatibility with previous versions.

Let's see what's changed!

Cleaner component integration

Working with Storyblok components in Svelte 5 is now more elegant than ever:

<!-- Before (Svelte 4) -->
<script>
  export let blok;
</script>

<!-- After (Svelte 5) -->
<script>
 let { blok } = $props();
</script>

This simplified syntax makes your components more concise while fully leveraging Svelte 5's reactive system.

Enhanced Rich Text rendering

Our rich text renderer is now fully compatible with Svelte 5's reactivity system:

<script>
  import { renderRichText } from '@storyblok/svelte';
  let { blok } = $props();

  // Automatically updates when content changes
  let richTextContent = $derived(renderRichText(blok.content));
</script>

Rich text content now updates seamlessly when edited in the Visual Editor without any extra code.

Seamless Visual Editor experience

The integration with Storyblok's Visual Editor is smoother than ever with our improved storyblokEditable action.

<script>
  import { storyblokEditable } from '@storyblok/svelte';
  let { blok } = $props();
</script>

<div use:storyblokEditable={blok} class="feature">
  <h2>{blok.headline}</h2>
  <p>{blok.text}</p>
</div>

This ensures your components are properly highlighted while you edit your content.

Improved error messages

The new error messages will help you solve issues within your integration faster.

Component "feature" not found. Please register it in storyblokInit:
storyblokInit({
  accessToken: "<your-token>",
  components: {
    "feature": YourComponent
  }
})

Instead of generic messages, you'll now receive helpful guidance on how to fix problems.

Improved TypeScript support

For TypeScript users, we've enhanced our type definitions for better autocomplete and error checking.

import type { SbBlokData } from '@storyblok/svelte';

interface FeatureBlok extends SbBlokData {
  headline: string;
  text: string;
  image: {
    filename: string;
    alt: string;
  };
}

// Type-safe blok access
let { blok } = $props<{ blok: FeatureBlok }>();

Getting Started with v5

Ready to upgrade? Here's how to get started:

npm install @storyblok/svelte@latest

Then update your initialization code:

import { storyblokInit, apiPlugin } from '@storyblok/svelte';
import Feature from '$lib/Feature.svelte';
import Grid from '$lib/Grid.svelte';

storyblokInit({
  accessToken: 'YOUR_TOKEN',
  use: [apiPlugin],
  components: {
    feature: Feature,
    grid: Grid
  }
});

For components, update your scripts to use the new Svelte 5 syntax:

<script>
  import { storyblokEditable } from '@storyblok/svelte';
  let { blok } = $props();
</script>

<article use:storyblokEditable={blok}>
  <h2>{blok.headline}</h2>
  <div class="content">{blok.content}</div>
</article>

Learn by example

We've created a comprehensive SvelteKit playground that demonstrates all the new features in action.

Check out our GitHub repository to see the example code and learn best practices for building with Storyblok and SvelteKit.

Looking forward

This release reassures our commitment to provide first-class support for modern web frameworks.

We believe that Svelte's approach to building web applications aligns perfectly with Storyblok's mission to make content management more efficient and enjoyable.

We're excited to see what you build with this new version of our SDK, and we're already working on more features to improve your Storyblok + Svelte experience.

For more information, check out our official documentation or join our Discord community to share your feedback and questions.

Happy building!

...

🔧 Announcing Storyblok Svelte SDK v5: now fully compatible with Svelte 5


📈 95.84 Punkte
🔧 Programmierung

🔧 Integrating SvelteKit with Storyblok (Using Svelte 5)


📈 34.13 Punkte
🔧 Programmierung

🔧 Storyblok/Svelte v3.0.0. is here 🎉


📈 34.13 Punkte
🔧 Programmierung

🔧 Announcing Official Storyblok Richtext Support in our Frontend SDKs


📈 31.21 Punkte
🔧 Programmierung

🔧 Announcing a Storyblok Loader for the Astro Content Layer API


📈 31.21 Punkte
🔧 Programmierung

🔧 Announcing Live Preview for Storyblok’s Astro Integration


📈 31.21 Punkte
🔧 Programmierung

🔧 🚀 Fresh Storyblok SDK releases, plus new Canada and Australia regions 🌍


📈 30.42 Punkte
🔧 Programmierung

📰 Microsoft Edge Stable Now Fully Compatible with Apple Silicon


📈 29.44 Punkte
📰 IT Security Nachrichten

🪟 SteelSeries controllers are now fully compatible with Fortnite


📈 29.44 Punkte
🪟 Windows Tipps

🪟 SteelSeries controllers are now fully compatible with Fortnite


📈 29.44 Punkte
🪟 Windows Tipps

🔧 Difference between "min SDK version", "target SDK version" and "compile SDK" version?


📈 27.79 Punkte
🔧 Programmierung

🔧 Difference between "min SDK version", "target SDK version" and "compile SDK" version?


📈 27.79 Punkte
🔧 Programmierung

🔧 From Svelte 4 to Svelte 5: Understanding Slots (default and named)


📈 25.92 Punkte
🔧 Programmierung

🔧 Svelte + Manifest = Giving Svelte a proper backend with 7 lines of code 🧡🦚


📈 25.92 Punkte
🔧 Programmierung

🔧 Svelte Series-2: How to install Svelte


📈 25.92 Punkte
🔧 Programmierung

🔧 Understanding Svelte: Setting Up Your Project and Mastering .svelte Files


📈 25.92 Punkte
🔧 Programmierung

🔧 kbar-svelte-mini - ctrl+k menu for your Svelte website


📈 25.92 Punkte
🔧 Programmierung

🔧 Spice Up Your Svelte App with Sound Interactions using svelte-sound 😎


📈 25.92 Punkte
🔧 Programmierung

🕵️ Medium CVE-2021-29261: Svelte Svelte


📈 25.92 Punkte
🕵️ Sicherheitslücken

🔧 From Svelte 4 to Svelte 5: Understanding Slots (default and named)


📈 25.92 Punkte
🔧 Programmierung

🐧 What USB WiFi dongle that are fully linux compatible, zero trouble?


📈 25.43 Punkte
🐧 Linux Tipps

🐧 Canon Pixma MG2522 is fully compatible with Zorin OS


📈 25.43 Punkte
🐧 Linux Tipps

📰 Ask Slashdot: Could Linux Ever Become Fully Compatible With Windows and Mac Software?


📈 25.43 Punkte
📰 IT Security Nachrichten

🎥 Fully Open, Fully Sovereign mobile devices


📈 23.41 Punkte
🎥 IT Security Video

🎥 Fully Open, Fully Sovereign mobile devices - deutsche Übersetzung


📈 23.41 Punkte
🎥 IT Security Video

🔧 Build Svelte AI Chat with Vercel's AI sdk


📈 22.22 Punkte
🔧 Programmierung

🔧 Announcing Minder Cloud: A fully managed software security platform for open source communities


📈 21.76 Punkte
🔧 Programmierung

📰 Announcing Android’s updateable, fully integrated ML inference stack


📈 21.76 Punkte
🤖 Android Tipps

📰 Announcing Nearby Connections 2.0: fully offline, high bandwidth peer to peer device communication


📈 21.76 Punkte
🤖 Android Tipps

🔧 Storyblok unveils new PHP packages in collaboration with SensioLabs


📈 21.16 Punkte
🔧 Programmierung

🔧 BitcoinQuizFlow: AI-Powered Quiz Generation with Storyblok


📈 21.16 Punkte
🔧 Programmierung

🔧 Astro-Storyblok Previews Site with Netlify's Branch Deploys Feature


📈 21.16 Punkte
🔧 Programmierung