Artwork

内容由Wes Bos and Scott Tolinski - Full Stack JavaScript Web Developers提供。所有播客内容(包括剧集、图形和播客描述)均由 Wes Bos and Scott Tolinski - Full Stack JavaScript Web Developers 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal
Player FM -播客应用
使用Player FM应用程序离线!

From React To SvelteKit

55:27
 
分享
 

Manage episode 302863358 series 1469447
内容由Wes Bos and Scott Tolinski - Full Stack JavaScript Web Developers提供。所有播客内容(包括剧集、图形和播客描述)均由 Wes Bos and Scott Tolinski - Full Stack JavaScript Web Developers 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal

In this episode of Syntax, Scott talks with Wes about moving Level Up Tutorials from React to SvelteKit — 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 prismic.io/syntax.

Sentry - Sponsor

If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s 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 Sentry.io and using the coupon code TASTYTREAT during sign up.

Cloudinary - Sponsor

Cloudinary is the best way to manage images and videos in the cloud. Edit and transform for any use case, from performance to personalization, using Cloudinary’s APIs, SDKs, widgets, and integrations.

Show Notes

07:28 - Thoughts

  • Apples to oranges, so unfortunately, no super legit ability to compare.
    • SvelteKit isn’t 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 → SvelteKit
      • HLS starts grabbing chunks immediately, so it’s 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’t 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}
  • becomes

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’t think about memoizing, or worrying about too many renders down the line, just never needed to
  • Overall developer experience
    • It’s honestly a joy to work in and I don’t want to go back
  • Making a library
  • Creating a sitemap was extremely easy, because of server-side routes. file.returnformat.ts ie sitemap.xml.ts
  • CSS without a css-in-js library for scoping is a dream. CSS props are now 100% via CSS variables using the https://svelte.dev/docs#style_props
  • Animations are all done with Svelte’s internal animations lib

32:45 - Hosting

  • adapter-node
  • Hosted on render.com as a straight-up node process $7/m for more than enough RAM and CPU,
  • Lots of other options for static, Vercel, workers whatever, I like having just a straight-up node app you can host anywhere

35:50 - Things to do

  • Admin tools

37:00 - Challenges

  • ESM is not always smooth sailin
    • Import has from ‘lodash/has’ didn’t working in dev, but import has from ‘lodash/has.js’ didn’t work in prod.
      • Solution was to use lodash.has as the dependency
      • Apollo included all React as a dep unless you import from @core
  • TS is great, but there was once where I wanted to define the entire props ts object for a spread prop, but was not possible
  • Drag animations

Cloudinary

42:46 - Wes’ questions

  • What about the ecosystem?
  • What about forms + DOM data?
  • Serverless functions?
  • Do you always bind to state? Or just access directly?
formData = writable({ title: "yo" }) {$formData.title} Links ××× SIIIIICK ××× PIIIICKS ××× Shameless Plugs Tweet us your tasty treats!
  continue reading

761集单集

Artwork

From React To SvelteKit

Syntax - Tasty Web Development Treats

4,057 subscribers

published

icon分享
 
Manage episode 302863358 series 1469447
内容由Wes Bos and Scott Tolinski - Full Stack JavaScript Web Developers提供。所有播客内容(包括剧集、图形和播客描述)均由 Wes Bos and Scott Tolinski - Full Stack JavaScript Web Developers 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal

In this episode of Syntax, Scott talks with Wes about moving Level Up Tutorials from React to SvelteKit — 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 prismic.io/syntax.

Sentry - Sponsor

If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s 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 Sentry.io and using the coupon code TASTYTREAT during sign up.

Cloudinary - Sponsor

Cloudinary is the best way to manage images and videos in the cloud. Edit and transform for any use case, from performance to personalization, using Cloudinary’s APIs, SDKs, widgets, and integrations.

Show Notes

07:28 - Thoughts

  • Apples to oranges, so unfortunately, no super legit ability to compare.
    • SvelteKit isn’t 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 → SvelteKit
      • HLS starts grabbing chunks immediately, so it’s 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’t 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}
  • becomes

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’t think about memoizing, or worrying about too many renders down the line, just never needed to
  • Overall developer experience
    • It’s honestly a joy to work in and I don’t want to go back
  • Making a library
  • Creating a sitemap was extremely easy, because of server-side routes. file.returnformat.ts ie sitemap.xml.ts
  • CSS without a css-in-js library for scoping is a dream. CSS props are now 100% via CSS variables using the https://svelte.dev/docs#style_props
  • Animations are all done with Svelte’s internal animations lib

32:45 - Hosting

  • adapter-node
  • Hosted on render.com as a straight-up node process $7/m for more than enough RAM and CPU,
  • Lots of other options for static, Vercel, workers whatever, I like having just a straight-up node app you can host anywhere

35:50 - Things to do

  • Admin tools

37:00 - Challenges

  • ESM is not always smooth sailin
    • Import has from ‘lodash/has’ didn’t working in dev, but import has from ‘lodash/has.js’ didn’t work in prod.
      • Solution was to use lodash.has as the dependency
      • Apollo included all React as a dep unless you import from @core
  • TS is great, but there was once where I wanted to define the entire props ts object for a spread prop, but was not possible
  • Drag animations

Cloudinary

42:46 - Wes’ questions

  • What about the ecosystem?
  • What about forms + DOM data?
  • Serverless functions?
  • Do you always bind to state? Or just access directly?
formData = writable({ title: "yo" }) {$formData.title} Links ××× SIIIIICK ××× PIIIICKS ××× Shameless Plugs Tweet us your tasty treats!
  continue reading

761集单集

All episodes

×
 
Loading …

欢迎使用Player FM

Player FM正在网上搜索高质量的播客,以便您现在享受。它是最好的播客应用程序,适用于安卓、iPhone和网络。注册以跨设备同步订阅。

 

快速参考指南