Skip to main content
View on YouTube to comment and like!

Syntax Video

Svelte with TypeScript - Course Drop Party

Chapter 1 00:00

Transcript

okay I'm seeing that we are live and I'm seeing that we have a green four transfer rate so unfortunately I think let me um post a link into the last video sorry folks there was a major Network outage or something I have no idea what happened something happened uh apart from the course this week and um I am working on getting us all back and up and running here so yeah if you have arrived at the new stream then thank you if not I'll be posting a link to the old stream in just one second here um yeah so okay okay let me just jump back in music jump back in well we only have three people in so far thanks for being here oh 13. people are they're trickling him okay I think

I think maybe people are figuring out we got smart folks yeah we do yeah okay I'll post this in the comments here okay good call okay sorry folks uh big technical difficulties here hopefully everything is um much better for you in the new stream that is a huge bummer for us because we just send out a link with all of the previous show notes but I'm seeing green on my end so let me know if um if everybody is uh seeing a better stream now or not I'm seeing some some green so all right okay so before we got news that was choppy I was explaining that this course was initially going to be svelte ansvelt kit but because I got sick I had to stop halfway through um and so the first half of it is going live today the second half is going live oh man hopefully

early uh two weeks from now depending on when I can talk for long periods of time without coughing that would be ideal and uh but you know I should say that a lot of the stuff in in svelt kit for typescript felt kit handles a lot of it for you so it's mostly like learning where to look for things where with svelte there's a lot of like interesting um tidbits in terms of how you type different it's felt technology so um that's the the new course is just spelled as a UI language done so through race felt kit project but it's just svelte and we we talk mostly about things like um typing props optional props events custom events we get into Dom element stuff Dom events actions uh complex State typing and basically the stuff that you're going to be using day to day with svelte and typescript beautiful overview amazing um okay let's take one step back real quick now that we have a handful of people here um the way that this event will go is

I'm gonna ask God a handful of questions just to get the gist of what this course is why he built it how he built it what's interesting about it why you should care or not care um and then from that we'll move into a lot like audience q a so if you have questions about this course about level of tutorials about us about anything pop them in the chat we will have a formal allocated time after I ask Scott the a handful of random questions and we'll get to those later so if yeah if you have something as we're talking pop it in maybe we'll address it as we go if not we'll touch on it at the end um yeah let's get into it so my first question for you is just going to be can you give us a little bit of overview of the course and what it's about you basically already did that is there anything else you wanted to add just generally about this course um no but I do want to emphasize again that this is just part one so I know we had initially advertised as being the whole thing so no you know it's it's a in in my opinion svelton typescript play

really nicely together and there are some things that just like in svelte or compared to reactor other front-end Frameworks a lot of the times uh the approach ends up being more simple than you might expect so with this course you're gonna really understand exactly um the the core foundational skills so that svelte is not the problem if you're working in a svelte in typescript context because typescript if you haven't picked it up um in a real capacity yet can be one of those things that gets frustrating to learn over time so the big goal for this course was to focus on this felt stuff specifically in terms of you'll always know where to go to type things in svelte and um less worry about some of the complex elements of typescript so that way we can dive in and that way you can know everything you'll want to know about how to apply your your typescript learning to spelled without necessarily being a typescript pro or anything like that but

eventually we do get into some more complex things as they're needed and again um you know half the time or I won't maybe not half the time maybe like 90 of the time that you end up having issues with typescript after understanding where to go for everything it's because of typescript not because of the combination of typescript and svelte and that's nice because you can just to focus in on getting better at typescript in that that way cool nice um so most of us know that you love spell let's take a moment to hear a little bit more about why you like spell why other people shed and then maybe the same for typescript yeah I like spelled because it helps us um it helps us write complex user interfaces in a more concise faster easier way and I like it um for so many reasons beyond the technical impressiveness of it but again I think the biggest killer feature for me it's felt is just how easy it makes writing your components and likewise that really

passes through into how it interacts with typescript um because svelte is simple it doesn't require a lot of complex type situations I mean there's a react spell or there's a react typescript cheat sheet that's like an entire website somebody may have to make an entire website as a svelton react cheat sheet and I was like trying to do that first felt as like an accompaniment to this course and I was like yeah it's really not that big um so it's much more simple to learn especially if you're newer to typescript um as far as typescript goes why do I like typescript you know um we refactored our website into typescript and um which is hard to do to refactor a big website that's existence typescript but the one thing that I'm most appreciative of about with typescript is just how how well it finds the little little things that wouldn't even constitute as bugs but potential bugs and potential issues in your code and it it lets you know

with a big red warning hey you can't do this um but if you tried to run the same code in the browser the browser would say oh yeah you can do this it might work fine or it might might not throw an error it might just like have unexpected results but with typescript you know ahead of time what the potential issues in your sidearm it's not going to identify every bug in your code base but I definitely find potential bugs and when we rewrote our application into typescript um it just felt so much more solid said I always knew where everything was I always knew what everything was supposed to be but it also uncovered you know 20 little UI issues that wouldn't have been uncovered without it or somebody having to email us saying hey this thing is a little weird here you have not a number being shown instead of an actual number okay that's the kind of thing typescript's gonna help you with right nice yeah and like you said it sounds like they they play really well together yeah it's a co-pilot any other reasons why you decide to put

this course together right now yeah you know it um I have a you know a big plan for svelte content this year I love svelte uh no uh no surprise there but after getting this felt kit 1.0 site or um course out like the big concern for me was like what are the the next tools that people are going to need to be like prose felt developers and typescripts definitely you know high up if not the the next highest thing in order on that list you know there's Advanced use cases for spell kit as well that you know course topics that I'm actively outlining right now but if somebody's looking to become a better svelte and spell kit developer having typescript knowledge in that regard in my opinion is something that is is probably needed at this stage in the game in terms of being able to write large complex applications good yeah so you're thinking about the audience as the users but they need to become successful using these tools yeah

cool um all right let's get into kind of what's in the course what what are we going to be doing what are we building what are we learning what's happening in there yeah so this is the outline of part one of the course Again part two is going to contain a lot of other stuff as well in regards to spell kit but you're going to be understanding you know what what's up with JS doc versus typescript syntax and how we can use that knowledge to read both of them uh because the svelt kit maintainers and uh creators prefer the JS doc style syntax so what you end up seeing is a lot of JSF JS doc style documentation however that's not like the syntax that a lot of other people are using so um I would say most people probably end up using typescript syntax in general and and spell kit makes it really easy to do that so we use typescript syntax in this course but I wanted you to have an understanding of how to understand and read both of them too if you want to prefer to work in one or the other you should be able to take the same lessons

out of this course we talk about the things that you do every single day in typescript and spelled so whether that's props events um we get into some coolers felt apis like uh context and custom events we talk a lot about svelte actions and even typing custom events from actions which is one of those things that feels complex until you really know what to do so what's cool about asphalt is that it utilizes the Dom so much that we get access to a lot of the types that you might need from the Dom we get access to everything else from svelte where needed and we talk a lot about where to hunt and how to find and how to read typescript type code so that way when you import your types or whatever you're not having to you know bang your head against the wall to try to figure out how to use these things in your code base but you can make educated uh guesses and decisions on what to use when and where and where to find that information so if you could think of like a Basics felt topic we have covered

it in a a quick example to show you how to type it in typescript and oftentimes we're building that component to to do the types for it for instance like one of the examples is we build a click outside action so when you click outside of something like you'd frequently have this like as a pop-up window on your website right the window pops up you click away from it it should close that window so we built that functionality in svelte from scratch while we're typing it so we're not just taking code that already exists in applying types to it we're writing code from scratch as well as taking code that already exists in adding types to it talking about how those all work together beautiful very cool um what's part two going to look like that's a mystery no part two is um going to be so so the way this this course works is that if you took the svelte kit course that we have on the site

um we're using basically that same code base now I've modified it I've improved it I've made it look a little bit nicer for CSS wise but it's that same code base and so part one is a lot of building up foundational skills and then what part two is going to be is going to be taking this exact code base that we have here and converting the entire thing to typescript with me along the way as we're doing individual small lessons on various aspects of this felt kit apis like interacting with the server data interacting um with maybe locals or all kinds of things that you're going to have to need to do in a real world's felt Kit app and we already have the app here so much so that it's the same app that we we built in the last fault kit tutorial but everything in here is a JS file so things like this have no types at all associated with it and we'll be talking about what are the the proper ways to do types for an entire project converting along the way recommend people take

course they don't have to if they have spell kit knowledge if you can build a site using the version one apis of Kit you don't need to take the course but if if you want to have that foundational skill or whatever then that's cool too again we're just going to be really focusing on like what are the things that you even like what we did at the version one course what are the things that you're going to need every single day that you're working in svelte and typescript so that way you don't get hung up in your own work which is the worst you know I gotta now instead of making something I'm having to go Google how to do it um any other experience you want people to have before coming into this course you should at least have um like Basics felt and get knowledge to be able to clone a repository this isn't a absolute beginner's course considering typescript's not necessarily a beginner's topic and since it's already building on like skills that exist within svelte so you should at least have an understanding of kind of where

things go inside of svelte but then also have the ability to get a spell kitsight up and running if you have that then you should be good to go on the typescript side of things because we talk a lot about Basics we talk about versions we talk about where to look for things and what it means to type something cool um so you touched a little bit already on the benefits of knowing spell and typescript it sounds like it just they worked so well together and makes you a better developer are there any other any other benefits real world applications anything around these technologies that aren't obvious we talked in the course we talk more than just about like here's the thing how do you type the thing right um because typing the thing can get you there but it won't make your code what's called type safe in in terms of like um what's always a number should remain a number unless it's become something else it's transformed to something else so that thing is typed as a number that

way if we tried to apply things that are not towards numbers to it the code's going to complain right but there are situations where you can get into especially if you don't know any better where typescript's happy typescript says there's no there's no issues with your code your code is fine but the code is still not safe so we talk a lot about how to write types so that it not only satisfies typescript and makes typescript happy but also protects you from potential issues that could arise if perhaps you're typing in a different way so we we talk a lot about strategy in addition to just how to do it well it sounds like there there probably is a growing demand for developers who have typescript and spell experience yeah yeah I think I'd say so especially as is felt you know spell kit has recently hit version 1.0 as we all know and it was a a big monumentous thing because now people can release things on sveelkid and not feel like it's built on Shaky

Ground and I think that's going to continue to drive spell kit adoption and with that comes typescript because um one of the big things we saw in especially the state of JS this year but pretty much Trends through every single year um since since really typescript hit the scene it it's adoption rate just continues to grow and grow and grow people that you talk to say you know I'll never build another application without typescript because of how productive it makes me and honestly I was I wasn't necessarily on the fence but um I definitely was a I'll wait and see because there were several competing versions of the same type of thing we'll say wait wait and see which one wins out right once it became clear that typescript was the the standard that everybody's kind of going off of I went I went into typescript hard and I'm of this exact same mind I I cannot go back to coding without it it's too essential and part of my workflow now so well now I'm curious to hear what our audiences think if they've tried spelled

with typescript they've messed around in typescript at all I mean I'm sure a lot of them are really curious about learning more that's why they're here um but yeah just knowing that it's like it's growing a popularity both of these Technologies um here's to see what what people have to say if they have any experience in there um awesome so to kind of wrap it all up who do you recommend this course for and why oh yeah you know I recommend it for anybody who's interested in building applications with svelte specifically if you're not like a typescript pro um I mean you could be experienced with typescript still get this take this course and get a lot out of it absolutely because we're showing you where to go for things right we're giving you a bit of a roadmap but even if you don't have that experience we talk a lot about as we go situations where svelt's going to save your butt and um or typescript's going to save your butt and so because of that I think this is a good course for anybody who might even be skeptical on typescript but whose

interest in this felt because maybe this will illuminate and maybe this will click for you why this thing actually is helping us and also how it's not really adding on that much to our actual code because when we take a look at some of our typescript code um you're really not doing a whole lot to your application there's not a ton of buy-in because svelte already ships typescript for you um you can just drop in types directly inside of a lang.ts in your script and you're basically good to go so you know it'll show you just how little tooling will need to be set up for this for you to really take off and experiment with typescript amazing anything else about the course you want to talk about before we reach into the audience q a no but I do again once again just because people arrive at this different times I do want to emphasize part two is

coming very soon I'm working hard at Hardaway at it I just have to uh uh finish recording so yeah yeah yeah it's impressive that you you even able to do this one with your your sicknesses I know I was edit I was editing this one from the couch I got my little mug of tea I'm sitting there trying to edit it really quick and yeah oh yeah oh I've heard that's hard Jeremy little kids you got running around there oh yeah yeah my daughter just coughs right in your face and you're just like up I know what I'm doing next week I'm gonna be sick literally only time I spent with children this year or I guess it was last year I got sick nice I hung out with them two days and I got sick

all right if you guys have any questions pop them in we'll look back to see what people are saying in the chat um and then we'll answer them as we go let's see yep okay people are answering a little bit around if they're using typescript and spelled um seems like a lot of people already use typescript and they're coming into this course hoping to get a little bit more experience as felt that's what I'm learning here um Josh Allen asked so this is a semi-spell tutorial semi-type script tutorial yeah yeah you know what it's not going to it's not going to turn you into a typescript pro certainly that's not its intention we do have a typescript course on level up that you can always take that's going to be a bit more typescript heavy Focus but we do use some complex types in some situations in here where you'll get experience um with generic patterns so one of the more complicated things inside of types

and typescript or that especially people new to types uh you experiment experience is not understanding these these angled brackets and what the heck they're doing here and how that works and how that plays into things and especially when you get into complex situations where the code itself you know can feel more complex and so you're already maybe stressed out from the code you're writing and maybe being uncertain of what you're writing there only to have like extra characters and extra stuff thrown in so we we are definitely having an emphasis on teaching you those aspects of it but by no means are you going to walk out of it being like Oh I can write typescript for anything so it's more of a um it's more of a tutorial instead of being a semi-swelt semi-type script tutorial it's more of a tutorial on the blending of the two cool that's exactly what Josh Allen eventually said well obviously the blood name too isn't Josh Allen a football player oh

I I feel like Josh Allen is a football player um football fans out there unfortunately all of them football teams that I follow are bad so I cannot tell you about good players uh the quarterback for the bills for the bills that's what I would have guessed yeah I know the bill hey this is it is it's the Super Bowl this weekend it is yeah wild if we just got you know on FL super quarterback on here oh yeah hey I told you I was at a party this is zarya an aside for everybody yeah um I was at a party for for like a kid's birthday party and one of the kids who attended that was Russell Wilson's uh child from the Denver Broncos because that child goes to the same school elementary school I think it's a kindergarten maybe as the the little girl whose birthday this was and Russell Wilson wasn't there it was like his bodyguards and stuff were there uh there

was like a bodyguard and a babysitter or a date whatever they have for a nanny was there but Russell Wilson's kid was there playing it was like pretty fun to know that um you know we're at social events that you're just like oh that's like a local celebrities uh I guess these National celebrities uh child what's up not wild was everyone like a kid's famous everyone was like that's kid that kid's famous yeah every everyone's kind of in his bodyguard like you know I mean Russell Wilson's probably huge massive his bodyguard was like maybe the largest person I've ever seen and he's just sitting on a little chair in the lobby waiting for the kid I was just like so he they really like stuck out just by his pure size yeah sheer size of the man yeah I mean I I went to my my little cousins I'm not sure I owned my little cousin grad party she just casually um babysits for Kyle Rudolph which is like a she's no longer with the Vikings but oh he is Vikings tight end and you're just in there like he's huge like huge I'm like okay you're

at my cousin's house it's just weird and like their kids were there and everything just very very cool um yeah okay anyway some of the Avalanche used to live like walk like on the other side of the park from us so whenever we walked over there I always be looking for yeah I know nazim qadri and Nathan McKinnon lived over there so I'm always like looking for Nathan McKinnon because I knew he had a specific type of dog like I gotta find his dog [Music] now I want to know if anybody else has any uh any experiences with professional yeah athletes just roaming around just hanging out that's fun yeah that's very fun okay um what else do we have going on in here do you get into any organization patterns suggestions with type interfaces interface utility files yeah we talk a little bit about that I I talk um a bit about when to poll your types out of a file versus where to Define them like sometimes we're defining them

in the file or sometimes we're defining them in a extra file and want to talk about that we mostly just use straight up interfaces again we're not getting too complex the most complex thing that we're doing typewise is passing things in as a generic into uh like uh any one of these types so like being able to specify what types of writable is for to say so that's like honestly the most complex type stuff we're getting into Beyond strategy in terms of like if you write it this way it will um save your butt if you write it this way it will not you know I think there's Maybe yeah something that's good there's um we talk about maybe not in this file let me let me look around we we have like one specific moment where we're talking specifically about strategy in terms of you will see this suggested on many different stack Overflow posts saying how to do it and you will also see this suggested and here's why I recommend

this one here's why I recommend this strategy for these following reasons uh but it will work either way this one's just going to give you this added protection here but we don't like I said the complexity of the types that we're writing yeah this might be one of the more complex types we're writing right here and that's really not that complex for a typescript pro but for a beginner in typescript you might not know what this is being read as without us talking through it

there you go which question were you just answering it was Pat uh pets um okay okay and Pat um the um Carolina Hurricanes are definitely going to win tonight because I can't stand the Rangers he's my hockey buddy yet

Justin looks like he has a question right there ready to read it yes please is this a sorry okay Justin asked is this a fairly pure setup with felt kit and typescript Via CLI or are you integrating a package like trpc as well super pure there's no dependencies outside of what comes in to spell kit by default as far as I know I'm pretty sure um I didn't install any in this course the only dependencies that would have been installed extra outside of this would have been from the last course but no I yeah I think it just felt pre-process which we don't even use in this course so it's super pure we're not like and and I want to stress too that again for part two is when we're getting getting into some of the stuff that might um mesh with that question a little bit more because in that that's when we're talking about data coming in and out and things like that and we're going to keep it very spelled focused in that regard

um in the past we've definitely gotten burned by adding on small little things here and there to make the course maybe like what the common Stacks are that people are using and then one thing in that stack changes and the whole course is ruined rather than you know know this we're worrying about something that just hit version one that's not going to change here so yeah we want we want to keep it real uh we want to be like we want this course to be the most like uh specific place you can go to learn about svelte and typescript and svelt kit and typescript together just like the react cheat sheet for typescript is the place many people would go for that as well it's a good segue into this question from jed23 if I what's the biggest difference between using typescript with spell versus react um yeah in react because of the nature of hooks in general in react I I found typing things in react to be a little interesting

um the part two of this course when we talk about data coming in from the server is going to help there so much because one of the things that typescript does really well with svelte is that it integrates the server side of your your data all the way to the client side so everything is always kind of talking to each other everything knows what the correct type of it all is and those aspects of it get really really super nice um but we we don't get too much into that into the part one of this necessarily but in in react World between hooks between loading data um just in general with the virtual Dom um not being accessed to the Dom types that you typically might have there's a lot of things that I think react has more gotchas and svelt maybe has a little bit more of because felt is a bit more um bespoke in its authoring so to say um svelte sveltez is is a little magical

they say I guess is the the way that people might have heard that um and by being magical it has kind of unique ways of doing things so we we want to talk what are what are the ways that we actually have to handle this um subscribable store of data um those are the things that get more complex in this felt but by all means I think just like with everything in svelte World it all feels lighter it all feels like less code essentially lighter and less code all sounds really nice um I'm seeing a couple other fun comments just on oh yeah yeah Josh Allen from Michigan shout out to Michigan I'm from here I had somebody asked me to do that at a parent you know like kids parties and there's like a parent like oh where are you from I was like all right I'm from here yeah I love that I mean I knew I knew of that being from Minnesota we saw we saw that

um cool does are there any other questions I'm not seeing any that we met and hopefully we didn't miss any up higher um well everyone might be thinking about a last question I'm going to drop a few links in the chat um just because you guys joined we're going to give you the opportunity to win a free month of level up Pro all you have to do is just give us your email and we won't use it for anything unless you say we can when if you say we can that all we're going to do is send you like an email every week or something but you don't have to choose that um but yeah just put your email in there and you'll one random person will be selected to win a full a full month of level up Pro which is enough time to go through like all this felt stuff for sure um additionally here's the course guys and gals

um and then finally I always like to add this because if you're not in our Discord then you're missing out um those are the three links that are important fill out that Google form to win go check out the course and then join us in Discord to hang out and talk yeah we talk about a lot of stuff Beyond code we talk about video games and sports and also code all those things sometimes go yeah yeah absolutely are there any other questions

I don't see any coming in I don't either so yeah Again part two on its way it's gonna be a great great uh accompaniment to this course especially if you are looking to build full stack applications in svelte yeah yeah thanks for being here well we'll hang on for like a second just in case there people are typing their questions um but thank you for being here thank you for hanging in while we uh we flipped around to a new stream we always like to keep you guys on your toes oh yeah that's exactly why that's what it is absolutely Tech difficulties every time if there's anything I should be good at it's live streaming yeah uh I'll get it together one of these days that's for sure it's fun you know it runs it reminds me of early covet when everyone who never used technology he was trying to figure out technology oh yeah totally I know it's just OBS is a lot of buttons so a lot of buttons

um awesome thanks everyone I hope you have you haven't maybe you'll watch the Super Bowl maybe not um I'm just gonna eat food and pretend to watch the game yeah yeah because I'm always mad that the Vikings don't make it you know well you're gonna be mad for an awful long time I know I know yeah we have a like a Bud Light from 2016 one can of Bud Light that has like the Minnesota Vikings logo on it we're waiting until we win the Super Bowl so very delicious Bud Light oh gosh good luck it might be poisoned by then yeah all right everyone thank you so much hope you check out the the course bye thank you

Quote it with credit and a link. Quoting Syntax