<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jakub Gaborski on Medium]]></title>
        <description><![CDATA[Stories by Jakub Gaborski on Medium]]></description>
        <link>https://medium.com/@jakubgaborski?source=rss-da389511bf03------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GQ8qJQMBPMS8d1x4B9UFZQ.png</url>
            <title>Stories by Jakub Gaborski on Medium</title>
            <link>https://medium.com/@jakubgaborski?source=rss-da389511bf03------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 17:18:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jakubgaborski/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Migrating from Svelte 4 to Svelte 5: Our Experience and Lessons Learned]]></title>
            <link>https://medium.com/villa-plus-engineering/migrating-from-svelte-4-to-svelte-5-our-experience-and-lessons-learned-6d383947819b?source=rss-da389511bf03------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d383947819b</guid>
            <category><![CDATA[svelte]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[engineering-excellence]]></category>
            <dc:creator><![CDATA[Jakub Gaborski]]></dc:creator>
            <pubDate>Wed, 01 Oct 2025 09:29:05 GMT</pubDate>
            <atom:updated>2025-10-01T09:29:05.692Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>One of our main goals at Villa Plus is to continuously keep our technology stack maintainable, aligned with industry best practices, and up to date. Keeping our stack modern allows us to ensure the best possible performance, keeps technical debt to a minimum and allows us to equip our developers with the best tools to do their work effectively.</p><p>As part of this commitment, we recently migrated our frontend from Svelte 4 to Svelte 5 - and in this post, we’ll share why we made the decision to do so, how the migration went, and what we learned along the way.</p><h3><strong>Why We Migrated</strong></h3><p>Our main reasons for moving to Svelte 5 were:</p><ul><li><strong>Better performance with smaller bundles - </strong>Svelte 5 produces smaller builds in size, which means better performance and a smoother experience for our customers.</li><li><strong>A simplified but more powerful reactivity system -</strong> the new runes API makes state management clearer, more consistent and more predictable.</li><li><strong>Improved developer productivity - </strong>features such as slot snippets and a unified reactivity model in stores remove unnecessary complexity and speed up development.</li></ul><p>Taking these points into account, it was clear that the migration would benefit both our customers, through a better user experience, and our developers, through a more streamlined and productive framework.</p><h3><strong>How We Prepared</strong></h3><ul><li><strong>Analysing our codebase - </strong>Identifying components that relied heavily on stores, context, or custom reactivity.</li><li><strong>Reviewing dependencies - </strong>Making sure 3rd party libraries used in our applications were compatible with Svelte 5.</li><li><strong>Defining migration guidelines - </strong>One of the most important steps was creating clear rules for how we would approach Svelte 5’s new features and changes. We documented when to use runes, how to update the stores, and how to handle updated event syntax (e.g., on:click → onclick). We also defined when component variables should live in $state, how to work with bindable props, alternatives to the deprecated createEventDispatcher, and how to adapt our use of slots. Having these guidelines in place meant the whole team had a clear plan regarding the code changes required for the migration.</li><li><strong>Planning rollout - </strong>We started by creating a complete list of all the migration tasks that needed to be done. With this list in place, we <strong>prioritized components based on their impact</strong>, starting with those used by the largest number of our customers. The migration then proceeded incrementally according to this plan.</li></ul><h3><strong>The Migration Process</strong></h3><p>With a clear plan and guidelines in place, developers could ensure consistency and maintain high productivity. It was time to start the migration.</p><p>During the migration, we focused on several key areas while applying consistent patterns across the codebase:</p><ul><li><strong>Reactivity using runes API - </strong>Components previously relied on writable stores as well as Svelte 4 style reactive statements. In Svelte 5, these were replaced with $state, $derived, and $effect, simplifying the code and making reactivity more predictable. $state was consistently used for reactive variables that needed to trigger updates externally or be derived, while non-reactive variables were left unchanged.</li><li><strong>Event syntax updates - </strong>Events such as on:click were updated to the new onclick syntax consistently across all components.</li><li><strong>Bindable props - </strong>Where applicable, we used the $bindable prop tag.</li><li><strong>Slots - </strong>Slot usage was redesigned to use the snippets approach, including both default and named slots.</li><li><strong>Event dispatching - </strong>The deprecated createEventDispatcher was replaced by passing callback functions as props, simplifying communication between components.</li></ul><h3><strong>Challenges</strong></h3><ul><li><strong>Shared components</strong> - Components that were widely used across the application posed a significant challenge. Migrating them along with all their dependent clients at once was impractical. The solution was to create Svelte 5 versions that lived alongside Svelte 4 counterparts and incrementally update clients over time.</li><li><strong>Third-party library compatibility</strong> - Some dependencies were not yet compatible with Svelte 5. For these, we decided to treat switching to a new library as a separate task, leaving the dependent components on Svelte 4 for the time being.</li><li><strong>Reactivity adjustments</strong> - Developers needed to adapt to $state and $derived patterns and update reactive statements to match the new system. Initial learning and refactoring via code review feedback took some time but ultimately simplified the codebase.</li></ul><h3><strong>Lessons Learned</strong></h3><p>Despite these challenges, the migration went smoothly overall. Along the way, we identified several lessons that not only made this project successful but can also guide how we approach similar large-scale migrations in the future:</p><ul><li><strong>Clear guidelines are critical - </strong>Having rules in place for how to approach Svelte 5’s new features meant developers could work confidently and consistently, without confusion or wasted effort.</li><li><strong>Incremental progress works best - </strong>Migrating step by step made the process manageable, reduced risk, and allowed thorough testing along the way.</li><li><strong>Balance migration with ongoing work - </strong>By planning for unrelated features to continue in parallel, we avoided blocking other teams and kept business priorities moving forward.</li><li><strong>Be pragmatic with dependencies - </strong>When third-party libraries weren’t compatible, postponing updates and isolating related components was the more practical choice than forcing everything at once.</li></ul><h3><strong>Conclusion</strong></h3><p>Migrating our codebase to Svelte 5 was a large and challenging task. But thanks to a clear plan and easy-to-follow guidelines, every developer knew exactly what to do and how to approach their work. By carefully balancing the migration with ongoing feature development and enabling multiple developers to work in parallel, we carried out the migration effectively without disruption.</p><p>This experience reinforced for us the importance of planning, communication, and teamwork when tackling complex migrations - lessons we’ll take forward into future projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d383947819b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/villa-plus-engineering/migrating-from-svelte-4-to-svelte-5-our-experience-and-lessons-learned-6d383947819b">Migrating from Svelte 4 to Svelte 5: Our Experience and Lessons Learned</a> was originally published in <a href="https://medium.com/villa-plus-engineering">Villa Plus Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>