Member-only story

🔺 SvelteKit 1.8 Release: Elevating the Web Development Experience

Tom Smykowski
4 min readMar 24, 2023

--

Have you grown weary of the boring and tedious web development experience? Look no further than SvelteKit! This innovative framework has revolutionized the way developers construct web applications, and with its most recent advancements, it’s better than ever. So, without further ado, let’s explore the most recent alterations and discover how SvelteKit can augment your web development involvement!

🎏 Streaming Non-Essential Data

SvelteKit’s load functions are now more efficient with the addition of the ability to stream non-essential data. Previously, the page won’t start rendering unless all the data required is ready to be displayed. This would lead to slowdowns when some of the data took longer to load.

In Sveltekit 1.8, you can use the nested promise feature to resolve this issue. With this feature, SvelteKit can start rendering the page before all the data is loaded, and stream the rest of the data to the page once it is available.

To use this feature, developers can return an object that includes a nested promise. SvelteKit will await the top-level fetch call before rendering the page, but it will not wait for the nested promise to resolve. Instead, the page will render, and the promise will resolve as the request completes. Developers can use Svelte’s await block to show a loading state until the promise is resolved.

--

--

Tom Smykowski
Tom Smykowski

Written by Tom Smykowski

🚀 Senior/Lead Frontend Engineer | Angular · Vue.js · React | Design Systems, UI/UX | Looking for a new project! 📩 contact@tomasz-smykowski.com

No responses yet