In this episode of Syntax, Scott talks with Wes about moving Level Up Tutorials from React to SvelteKit \\u2014 why he did it, how, benefits, things to watch out for, and more!
Prismic - Sponsor
Prismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you like. Make corresponding Slices in Prismic. Start building pages dynamically in minutes. Get started at\\xa0prismic.io/syntax.
Sentry - Sponsor
If you want to know what\\u2019s happening with your code, track errors and monitor performance with Sentry. Sentry\\u2019s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting\\xa0Sentry.io\\xa0and using the coupon code TASTYTREAT during sign up.
Cloudinary - Sponsor
Cloudinary\\xa0is the best way to manage images and videos in the cloud. Edit and transform for any use case, from performance to personalization, using Cloudinary\\u2019s APIs, SDKs, widgets, and integrations.
Show Notes
07:28 - Thoughts
Apples to oranges, so unfortunately, no super legit ability to compare.
SvelteKit isn\\u2019t analogous with a custom React setup that uses CSR
SSR is usually going to be faster - we can ship less JS
Some big things changed beyond React \\u2192 SvelteKit
HLS starts grabbing chunks immediately, so it\\u2019s hard to get accurate load time and transfer.
Whole conversion took a couple of months.
Hardest part was making UI choices and changes, straight up converting components one by one wasn\\u2019t actually that tough
16:14 - Converting React components to Svelte
useState becomes just a straight-up variable
Graphql calls were hooks now just imported generated functions
Remove extranous fragments
Convert {things && } to {#if thing}{/if}
\\xa0becomes\\xa0
24:06 - Spark joys
State
Our checkout flow became way more transparent, way easier with Svelte stores
Render flow
Was never something we needed to really think about. Didn\\u2019t think about memoizing, or worrying about too many renders down the line, just never needed to
Overall developer experience
It\\u2019s honestly a joy to work in and I don\\u2019t want to go back
Making a library
Package dir, new SvelteKit project,\\xa0svelte-kit package