SvelteKit is my mistress
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Angular 4 Development and Production Environments with Firebase
Fireship
OAuth with Angular and Firebase Tutorial
Fireship
Anonymous Authentication with Angular and Firebase - Lazy Registration
Fireship
Angular Router Guards for Firebase Users
Fireship
Angular Firebase CRUD App with NoSQL Database Tutorial
Fireship
Upload Files from Angular to Firebase Storage
Fireship
How to Deploy an Angular App to Firebase Hosting
Fireship
Sharing Data between Components in Angular
Fireship
Loading Spinners for Asynchronous Firebase Data
Fireship
Angular 4 Transactional Email with Google Firebase Cloud Functions
Fireship
Firebase Database Rules Tutorial
Fireship
Autocomplete Search with Angular4 and Firebase
Fireship
Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Fireship
Angular Drag-and-Drop File Uploads to Firebase Storage
Fireship
Text Translation with Firebase Cloud Functions onWrite and Angular 4
Fireship
Custom Usernames with Firebase Authentication
Fireship
Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Fireship
Simple Pagination with Firebase and Angular 4
Fireship
How to Connect Firebase Users to their Data - 3 Methods
Fireship
Add Toast Message Notifications to your Angular App
Fireship
Facebook-Inspired Reactions System with Angular and Firebase
Fireship
Learn NgModule in Angular with Examples
Fireship
Lazy Loading Components in Angular 4
Fireship
Stripe Checkout Payments with Angular and Firebase - Part 1
Fireship
Process Stripe Payments with Firebase Cloud Functions - Part 2
Fireship
Selling Digital Content in Angular with Stripe Payments - Part 3
Fireship
Angular 4 Full Text Search with Algolia - Part 1
Fireship
Algolia with Firebase Cloud Functions - Part 2
Fireship
Firebase Phone Authentication in Angular 4
Fireship
Top 7 RxJS Concepts for Angular Developers
Fireship
Learn Angular Animations with 5 Examples
Fireship
Advanced Firebase Data Filtering (Multi-Property)
Fireship
Realtime Maps with Mapbox + Firebase + Angular
Fireship
Angular Reactive Forms with Firebase Database Backend
Fireship
Send Push Notifications in Angular with Firebase Cloud Messaging
Fireship
Top 7 Ways to Debug Angular 4 Apps
Fireship
Infinite Scroll with Angular and Firebase
Fireship
Use TypeScript with Firebase Cloud Functions
Fireship
Realtime Graphs and Charts with Plotly and Firebase
Fireship
Role-Based User Permissions in Firebase
Fireship
User Presence System in Realtime - Online, Offline, Away
Fireship
Location-based Queries with GeoFire and Angular Google Maps
Fireship
Angular ngrx Redux Quick Start Tutorial
Fireship
Angular Ngrx Effects with Firebase Database
Fireship
Progressive Web Apps with Angular
Fireship
Angular Ngrx with Firebase Google OAuth User Authentication
Fireship
RxJS Quick Start with Practical Examples
Fireship
Send SMS Text Messages with Twilio and Firebase
Fireship
Firebase Database Performance Profiling
Fireship
Native Desktop Apps with Angular and Electron
Fireship
Subscription Payments with Stripe, Angular, and Firebase
Fireship
Firestore with AngularFire5 Quick Start Tutorial
Fireship
Angular HTTP Client Quick Start Tutorial
Fireship
Google Sign-In with Firestore Custom User Data
Fireship
Star Review System from Scratch with Firestore + Angular
Fireship
Angular Chatbot with Dialogflow (API.ai)
Fireship
Learn @ngrx/entity and Feature Modules
Fireship
Infinite Scroll Pagination with Firestore
Fireship
Faster Firestore via Data Aggregation
Fireship
Contentful - CMS for Angular Progressive Web Apps
Fireship
Related Reads
📰
📰
📰
📰
Inside the Wayfair Frontend SDE-2 Interview: A Complete Breakdown
Medium · Programming
I Spent Two Years Maintaining a React SPA. HTMX Rebuilt It in a Week
Medium · Programming
The 5 Levels of Front End Engineering (And Where Most Developers Get Stuck)
Medium · Programming
Browser-Based PDF Editing with Vue 3 and pdf-lib
Dev.to · sunshey
🎓
Tutor Explanation
DeepCamp AI