SvelteKit is my mistress

Fireship · Intermediate ·🌐 Frontend Engineering ·3y ago

Key Takeaways

This video introduces SvelteKit version 1.0 and compares it to other frameworks like Next.js for building fullstack web applications

Full Transcript

it is December 15 2022 and you're watching the code report after what felt like a lifetime of waiting spelled kit officially hit version 1.0 yesterday which is a full stack framework for the world's most loved UI Library when I tried spell for the first time over three years ago it left me extremely titillated it had an Innovative compiler elegant reactivity and we just had so much fun together as the years went on I continued working with react and angular but truth be told I would often close my eyes and pretend that they were actually spell I was web developmentally frustrated but luckily just in time for Christmas we've achieved a glorious climax that makes it possible to use felt in a server-rendered application let's take a look at some code and see if it lives up to all of these innuendos spelled kit is very similar to other JavaScript meta Frameworks Like nextjs Remix and nuxt like next js13 it uses file system routing but made a somewhat controversial decision of using reserved names to represent different types of UI like page layout loading and error in addition any file that has significance to the framework is prefixed with a plus sign there's been a lot of discussion around this approach and not everybody likes it because you end up with tons of files in the project with the exact same name which can lead to migraines if you expand all the directories in your editor on the other hand though these conventions keep your project clear and consistent page.spelt contains a component that will be server rendered when you navigate to that route after the initial page load it will hydrate and then the client-side router takes over from there this is what we call SSR and I think it's the most sensible default however in spelled kit you can mix and match other rendering strategies like you can pre-render static HTML for Jam stack style websites or if no server is required you can use client rendering to do everything in the browser or on the flip side if you don't want any JavaScript at all you can render everything on the server like a traditional multi-page application what's awesome though is that you can choose the best rendering strategy for a page with a simple configuration option you're not locked into just one rendering Paradigm that's awesome but the other big thing you'll want to know about the developer experience is how data fetching works every page.svelt file can have a matching page.js or TS file that exports a load function the return value from this function will automatically be made available in the page.spilt file via this data variable it's incredibly simple and also provides end-to-end type safety the load function can run both server side and client-side however if you want to limit it to just the server you can do that by adding server to the file name and speaking of server I love spell Kit's convention for building apis you create a server.js file then export functions named as HTTP verbs like get post patch and so on that's nice but here's where things get really cool in many applications you need to fetch data at multiple levels like you might have user data at the root than a dashboard with an order then some comments below it fetching all this data is complex and people have come up with all kinds of complex State Management libraries that try to Wrangle the complexity in spell kit you can do nested routing with layouts that can share UI with their children and also fetch data that's accessible by the children but what's special about svelte is that it has built-in stores the page store gives you access to all the data on the current page and can be subscribed to with reactive updates from anywhere in the application by putting a dollar sign in front of it angular has actually been doing stuff like this for years with its async pipe and I can tell you from experience that patterns like this eliminate tons of complexity when it comes to State Management now it's also important to know that when fetching data you can have error and loading files that represent the UI for those special States this pattern is basically identical to nextjs version 13. in addition spell kit has form actions which allow you to Define functions on the server that handle form submissions at this point pretty much every modern framework has stolen this feature from remix which itself got the idea from the way every other PHP framework has worked since the beginning of time and another piece of bonus news is that spelled kit is also getting a library very similar to next auth for user authentication Rich Harris the creator of spelled and spell kit works at versel and the team from next auth developed this Library which is awesome because that means it's getting world-class tools proven to work at the largest scale overall spelled kit is a genre defining Masterpiece if you want to penetrate deeper into this topic stay tuned for a full uncensored tutorial on Beyond fireship this has been the code report thanks for watching and I will see you in the next one

Original Description

SvelteKit just hit version 1.0 and provides an awesome set of tools for building fullstack web applications. Let's take a first look at its features and compare it to other frameworks like Next.js and Nuxt. #webdevelopment #javascript #TheCodeReport 💬 Chat with Me on Discord https://discord.gg/fireship 🔗 Resources - SvelteKit announcement https://svelte.dev/blog/announcing-sveltekit-1.0 - SvelteKit Docs https://kit.svelte.dev/ - Svelte in 100 Seconds https://youtu.be/rv3Yq-B8qp4 - Subscribe to Beyond Fireship for the Full Tutorial https://www.youtube.com/channel/UC2Xd-TjJByJyK2w1zNwY0zQ 🔥 Get More Content - Upgrade to PRO Upgrade at https://fireship.io/pro Use code YT25 for 25% off PRO access 🎨 My Editor Settings - Atom One Dark - vscode-icons - Fira Code Font 🔖 Topics Covered - SvelteKit vs Next.js - SvelteKit vs Nuxt - Svelte vs React - Build SSR apps with Svelte
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Fireship · Fireship · 0 of 60

← Previous Next →
1 Angular 4 Development and Production Environments with Firebase
Angular 4 Development and Production Environments with Firebase
Fireship
2 OAuth with Angular and Firebase Tutorial
OAuth with Angular and Firebase Tutorial
Fireship
3 Anonymous Authentication with Angular and Firebase - Lazy Registration
Anonymous Authentication with Angular and Firebase - Lazy Registration
Fireship
4 Angular Router Guards for Firebase Users
Angular Router Guards for Firebase Users
Fireship
5 Angular Firebase CRUD App with NoSQL Database Tutorial
Angular Firebase CRUD App with NoSQL Database Tutorial
Fireship
6 Upload Files from Angular to Firebase Storage
Upload Files from Angular to Firebase Storage
Fireship
7 How to Deploy an Angular App to Firebase Hosting
How to Deploy an Angular App to Firebase Hosting
Fireship
8 Sharing Data between Components in Angular
Sharing Data between Components in Angular
Fireship
9 Loading Spinners for Asynchronous Firebase Data
Loading Spinners for Asynchronous Firebase Data
Fireship
10 Angular 4 Transactional Email with Google Firebase Cloud Functions
Angular 4 Transactional Email with Google Firebase Cloud Functions
Fireship
11 Firebase Database Rules Tutorial
Firebase Database Rules Tutorial
Fireship
12 Autocomplete Search with Angular4 and Firebase
Autocomplete Search with Angular4 and Firebase
Fireship
13 Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Fireship
14 Angular Drag-and-Drop File Uploads to Firebase Storage
Angular Drag-and-Drop File Uploads to Firebase Storage
Fireship
15 Text Translation with Firebase Cloud Functions onWrite and Angular 4
Text Translation with Firebase Cloud Functions onWrite and Angular 4
Fireship
16 Custom Usernames with Firebase Authentication
Custom Usernames with Firebase Authentication
Fireship
17 Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Fireship
18 Simple Pagination with Firebase and Angular 4
Simple Pagination with Firebase and Angular 4
Fireship
19 How to Connect Firebase Users to their Data - 3 Methods
How to Connect Firebase Users to their Data - 3 Methods
Fireship
20 Add Toast Message Notifications to your Angular App
Add Toast Message Notifications to your Angular App
Fireship
21 Facebook-Inspired Reactions System with Angular and Firebase
Facebook-Inspired Reactions System with Angular and Firebase
Fireship
22 Learn NgModule in Angular with Examples
Learn NgModule in Angular with Examples
Fireship
23 Lazy Loading Components in Angular 4
Lazy Loading Components in Angular 4
Fireship
24 Stripe Checkout Payments with Angular and Firebase - Part 1
Stripe Checkout Payments with Angular and Firebase - Part 1
Fireship
25 Process Stripe Payments with Firebase Cloud Functions - Part 2
Process Stripe Payments with Firebase Cloud Functions - Part 2
Fireship
26 Selling Digital Content in Angular with Stripe Payments - Part 3
Selling Digital Content in Angular with Stripe Payments - Part 3
Fireship
27 Angular 4 Full Text Search with Algolia - Part 1
Angular 4 Full Text Search with Algolia - Part 1
Fireship
28 Algolia with Firebase Cloud Functions - Part 2
Algolia with Firebase Cloud Functions - Part 2
Fireship
29 Firebase Phone Authentication in Angular 4
Firebase Phone Authentication in Angular 4
Fireship
30 Top 7 RxJS Concepts for Angular Developers
Top 7 RxJS Concepts for Angular Developers
Fireship
31 Learn Angular Animations with 5 Examples
Learn Angular Animations with 5 Examples
Fireship
32 Advanced Firebase Data Filtering (Multi-Property)
Advanced Firebase Data Filtering (Multi-Property)
Fireship
33 Realtime Maps with Mapbox + Firebase + Angular
Realtime Maps with Mapbox + Firebase + Angular
Fireship
34 Angular Reactive Forms with Firebase Database Backend
Angular Reactive Forms with Firebase Database Backend
Fireship
35 Send Push Notifications in Angular with Firebase Cloud Messaging
Send Push Notifications in Angular with Firebase Cloud Messaging
Fireship
36 Top 7 Ways to Debug Angular 4 Apps
Top 7 Ways to Debug Angular 4 Apps
Fireship
37 Infinite Scroll with Angular and Firebase
Infinite Scroll with Angular and Firebase
Fireship
38 Use TypeScript with Firebase Cloud Functions
Use TypeScript with Firebase Cloud Functions
Fireship
39 Realtime Graphs and Charts with Plotly and Firebase
Realtime Graphs and Charts with Plotly and Firebase
Fireship
40 Role-Based User Permissions in Firebase
Role-Based User Permissions in Firebase
Fireship
41 User Presence System in Realtime - Online, Offline, Away
User Presence System in Realtime - Online, Offline, Away
Fireship
42 Location-based Queries with GeoFire and Angular Google Maps
Location-based Queries with GeoFire and Angular Google Maps
Fireship
43 Angular ngrx Redux Quick Start Tutorial
Angular ngrx Redux Quick Start Tutorial
Fireship
44 Angular Ngrx Effects with Firebase Database
Angular Ngrx Effects with Firebase Database
Fireship
45 Progressive Web Apps with Angular
Progressive Web Apps with Angular
Fireship
46 Angular Ngrx with Firebase Google OAuth User Authentication
Angular Ngrx with Firebase Google OAuth User Authentication
Fireship
47 RxJS Quick Start with Practical Examples
RxJS Quick Start with Practical Examples
Fireship
48 Send SMS Text Messages with Twilio and Firebase
Send SMS Text Messages with Twilio and Firebase
Fireship
49 Firebase Database Performance Profiling
Firebase Database Performance Profiling
Fireship
50 Native Desktop Apps with Angular and Electron
Native Desktop Apps with Angular and Electron
Fireship
51 Subscription Payments with Stripe, Angular, and Firebase
Subscription Payments with Stripe, Angular, and Firebase
Fireship
52 Firestore with AngularFire5 Quick Start Tutorial
Firestore with AngularFire5 Quick Start Tutorial
Fireship
53 Angular HTTP Client Quick Start Tutorial
Angular HTTP Client Quick Start Tutorial
Fireship
54 Google Sign-In with Firestore Custom User Data
Google Sign-In with Firestore Custom User Data
Fireship
55 Star Review System from Scratch with Firestore + Angular
Star Review System from Scratch with Firestore + Angular
Fireship
56 Angular Chatbot with Dialogflow (API.ai)
Angular Chatbot with Dialogflow (API.ai)
Fireship
57 Learn @ngrx/entity and Feature Modules
Learn @ngrx/entity and Feature Modules
Fireship
58 Infinite Scroll Pagination with Firestore
Infinite Scroll Pagination with Firestore
Fireship
59 Faster Firestore via Data Aggregation
Faster Firestore via Data Aggregation
Fireship
60 Contentful - CMS for Angular Progressive Web Apps
Contentful - CMS for Angular Progressive Web Apps
Fireship

Related Reads

📰
Inside the Wayfair Frontend SDE-2 Interview: A Complete Breakdown
Learn how to prepare for a Frontend SDE-2 interview at Wayfair, including online assessments, machine coding, and system design.
Medium · Programming
📰
I Spent Two Years Maintaining a React SPA. HTMX Rebuilt It in a Week
Learn how HTMX rebuilt a React SPA in a week, replacing 2 years of maintenance work, and discover the benefits of this alternative approach
Medium · Programming
📰
The 5 Levels of Front End Engineering (And Where Most Developers Get Stuck)
Learn the 5 levels of front end engineering to improve your skills and avoid getting stuck in a career rut
Medium · Programming
📰
Browser-Based PDF Editing with Vue 3 and pdf-lib
Learn to build a browser-based PDF editor using Vue 3 and pdf-lib, enabling users to edit PDFs directly in the browser
Dev.to · sunshey
Up next
How to Use Semrush Keyword Magic Tool with ChatGPT to Make Money
Grow with Will - SEO, Sales & Entrepreneurship
Watch →