Podcast Lookup

Code with CodingCat.dev: SvelteKit with Notion CMS and Cloudinary

CodingCat.dev Podcast

  • June 30, 2024
  • 1 h 38 min
  • Episode 3
Episode page
About this episodehttps://codingcat.dev/podcast/sveltekit-with-notion-cms-and-cloudinary

Transcript

From the publisher

This transcript comes from the podcast’s own feed, shown as the publisher wrote it.

Code with CodingCat.dev: SvelteKit with Notion CMS and Cloudinary

00:00—
  1. Welcome back perfect peeps to code with coding cat. I got it right this week. Yeah, I think we got to call them crazy cats or something, though. We're still working on that Alliterative. I know I feel like perfect peeps are still cool though. I don't know. Cool. Cool coding cat friends. Yeah, we'll, we'll work on it.

  2. I I also have to do our intro. Still, there's only so much time in the day. Exactly. So we haven't. Put it in the real. We we have a special guest with us today. Tomash, you you want to introduce yourself. Sure. Hi, good morning, afternoon, evening to to everyone. My name is Thomas.

  3. I work at Cloudinery and I do dev rail at Cloudinery and I'm just flattered to be to be here and hopefully I'll be useful in helping you doing some of this live coding. Are you do you do stuff with the MD program? Is that why I see you float around out there? I do nice, in fact, very soon, and this is me spoiling some of those beans that I'm not supposed to spoil, but there's going to be more stuff coming towards the MD program for for me that's. Exciting, I've been at.

  4. MD Very. Exciting since the beginning, so. Yes, So you will see the the updates hopefully finally soon. Very cool. That's that's exciting. Did you have you had crossover with Tessa then, right? Yes, we, I think we've worked together for about 2-3 years. I want to say. So very cool. Awesome.

  5. So I always like to start our Fridays off a little more casual. Brittany, how was Netlify this week? Because I always like to start. Our Fridays. I can't figure out where the echo is coming from. Oh, you know what? I think it's coming from my phone. No, it was playing on my phone. I'm like where is?

  6. This. Sometimes there's a million tabs, no one knows. Exactly. I think we decided here in like week seven was that I don't know. Week 7-8 time time is a nickname, but it's flurred together. It's like the Nestle Fight Diaries, isn't it? It's great, yeah. You got another post out I was pretty excited about. I did, yeah.

  7. I got a post out on quick this time. I I meant to meant to have this up and loaded, but we'll do it right now. It's fun getting all of the new technologies and getting to work with some of the new things. I love felt always, but I like getting to try out some of these new. Things.

  8. Wow you guys post a lot. I thought you were going to be like the second one, maybe Boom boom boom boom. Yeah, there's lots of post going out holy small all the time. So the little quick JavaScript framework, as you all might know, I was at Builder until like this week and May, May next week, we'll talk about where I'm headed.

  9. But hey. Princess here. So Brittany wrote up this sweet quick article. I think it's pretty cool. So if you haven't heard it quick, it's kind of a a new JavaScript framework that basically ships almost no JavaScript to the front end. And then once it's up there, it can load it. I don't know if you say progressively, that's probably not the right word, but. Asynchronously.

  10. Isn't that how it? I mean, as it as it needs it, let's say as it needs it. So yeah, cool post, Good job. Thank you. Thank you for showcasing it. Yeah. But basically my job. I've been writing a lot of blog posts. I've been starting my own stream. I've been doing like lots of different things.

  11. I can't even keep track anymore. I do too much. Salma asked me today if I if I got a break ever. And I'm just like, no. That's such a Bower. Oh Tamash, how was your week? Did you do anything fun at Cloudnary? Did you read any blog posts? No, so so you see, Cloudnary had their big company get together in a remote location and I wasn't there.

  12. So so it was a very quiet week. I also got a bit sick. So I just just all said news really. So it's you better skip the update from 55. But it's all good now. All good. Now you know I'm I'm back in action. So in case Tamash has to bail on excuse me, I've been sick all week too, so if I just cut out. It's just me.

  13. So Tamash you, you are kind of further into the time as as it were. So it's getting late where you are and I don't want to skip out in case you have to jet later on as we're coding and miss out on a a new training course you have going. You want to talk a little bit about this? Sure.

  14. So wow, you already loaded it up actually. So, so yeah, I, I run this portal website, you know, whatever you want to call it called jump stack or training. And I basically record courses about various jump stack technologies. So I think this is the, the course that I just recorded is course #14 and it's actually there in the first one. Create jump stack applications with Swell Kit. So again, all these courses are for free and then that's the latest edition.

  15. So I'm just using Swelt and contentful and then, you know, create a fun little app. I use a little bit of cloudy and then we just deploy the whole thing on Versal. So if anyone wants to get the basics, you know, learn the basics of Swelt kit, there's a little bit of Swelt in there as well. But obviously, you know, didn't spend a lot of time talking about Swelt.

  16. The assumption is that you kind of know what it is, but then you want to know, you know, how to integrate it with the content full and you know, how do you add like images and stuff? And one of the cool things that I added in this project and, and I talked about it in another podcast is shoppable video, right? Which is basically you have a video playing and then maybe, you know, it's a model walking down the down the street. And then, you know, they wear a, a bag, you know, dress the sunglass.

  17. And then you get this little bar in the video. And if you click the sunglass, then the video jumps to the second where the, the, the sunglass appears. And then, you know, just click it and it takes you to the product description page. So that's the in the yeah, we, we talked about it. In this video I'm in a link.

  18. Do you have to use the Cloudnary component to be able to do that? Yes. So you have to actually use the cloud in your video player because it has a configuration object which then you can configure to work with the so-called shoppable video. And then it also takes it also takes the the other image assets that you want to put into that sidebar from your cloud in your account.

  19. So the product images are also in your account. So it all kind of that's really. Cool, you know. Works very well together. I should have. I know there's a React component for this, but from this felt kit side, do you just use the native JavaScript component then? So to display the images I used the.

  20. We have this package called the URL generator, which is at cloud slash URL hyphen Gen., which is pretty much a framework agnostic JavaScript package because we don't obviously have a, you know, an SDK for swelt. But then of course that URL Jen works with any front end framework. So I use that. And then for the video player, that's like just a a drop in video player JS that you put in a script tag and then that's pretty much it.

  21. I think this might be a perfect segue. Oh. Just a second, I have to ask Tomas how you create so many courses? He does was sit down you. Yeah. You just make time sleep. No, it's, yeah, I look, it's I, I do come from a, a technical instructor background. So before I, I did Deborah, I did technical training courses for various companies. So teaching has always been something I've been doing and I just enjoy it so.

  22. OK. I just yeah, keep on doing it. I'm wondering because we're trying to create some courses for coding cat and it's just, it's so hard to find time. And I think the type that we're doing is more like instructional, like step by step through the basics of the beginning. And for me, spelt kit is changing all the time. So my intro to spelt kit course, I'm like, I'm waiting for like stability.

  23. I'm like I don't want to go back and re record these videos. I know that yeah, there's a disclaimer in the at the beginning of this this course that says, hey, this is beta. So, you know, just things may change, but then, yeah, yeah, there are some courses that are recorded maybe three years ago that probably not so. You don't worry.

  24. About probably they it would no 'cause you know, I I would then just re record. Well, I wouldn't re record the same stuff. I would record a new course using the sort of updated version of the tech. Yeah. But then again, if someone is, if someone's new, new to someone's new to all of this, then I think, you know, whether you use, I don't know, Gatsby 3 or whatever I was using. And now I think that version four or, you know, the, the fundamentals are still the same.

  25. Maybe the, you know, the syntax is a little bit different or you have to configure stuff differently. But the, the whole here's how you create a route, here's how you do this and that. That's pretty much, you know, the same. Gotcha. Yeah. And if anyone is interested too, Coding Cat allows authors to come on and we pay you for courses. So if if you want to come on, you get the full value for your course if you sell it on Coding Cat. So I have 14 courses to sell.

  26. How much would that be? It's all. It's all based. On watch time so. The 100% of what they watch, you get. So yeah, bring them over. We'd we'd happily take them on and I, I don't know, I I got to write this blog post. Maybe Brittany needs to, but we are now an official GitHub sponsorship so we got all approved.

  27. Yes. Maybe I should. Maybe I should bring that up. Let's see. Yeah, we're trying to work on getting sponsors, making this thing like official and. We got the cool heart button now that you can click and it talks all about like how we actually pay out people the views you get, what dollars that represents all of those fun things.

  28. And there's more to it than this, but this is kind of just for sponsored people to like, read into and get and. Get some analytics. Got a goal out there so we can like pay our people and as we get more sponsors, we'll move that goal up. So go click a tier if you love our stuff and especially if you want to come on and be an author. Check that out and let us know.

  29. DM us if you if you like building courses for sure. Or blog posts or anything. Literally. Yeah. Let us know for sure. All right, now it's time to transition. OK, I really. I had a good transition but now that we've kind of diverged. So tabash was talking about how how they use the cloud nary URL in in their set up.

  30. And so for coding cap, if y'all remember from the last time we were doing this yeah, now we're getting back into the this felt get notion, all that fun stuff. We have a notion page set up in the back end and when you load different items up to that. So for our streams or posts or whatever, I think we've been showing off our streams. So we'll look at that first.

  31. So when you load those, you can actually load any image. You can just copy paste, drag, whatever you want to do. And when you do that, it kind of looks like this. And so we, we dynamically create these images based off a Twitter handle. So when we, the way that we do that is we actually run a Google Cloud function through Firebase and every 5 minutes it goes and looks to see if we have anything that we need scheduled. So that's kind of the the first thing that happens out here. I see why I'm confused now.

  32. I was like following the live share, but this is just our code with coding cat coding base, right? It is our coding cat, yeah. Yeah. So this, this is our coding cat back end code, if you will. So this is in Firebase. And when we schedule this every 5 minutes, it has the opportunity to go take a look and see if we have anything that's in this scheduled area that needs an image. So it checks anything blank that needs an image. So for instance at.

  33. The bottom. This new podcast, I forget what Sean's is going to be on. Is this the view one? I'll just do I. Don't know, it's on my birthday though so we haven't decided if I'm going to be there or not. Right, I I remember that I doubt you'll be there, but I will be you shouldn't be don't know that's.

  34. My big That's my big birthday too, folks. Still be 29. Forever. For the rest of my life, I won't. Be 20 happy. So yeah, as we're walking through this, basically we have a bunch of pub Subs that come off of this. So what I did, I created a topic that it sends out right here. So you'll see a send topic.

  35. The topic ID is cloud nary create from notion. When that runs it then goes through and says, OK, go find this Twitter handle from the Twitter API. Grab the image of that user and try to generate a new cover URL. So when we take that cover URL we actually have all this crazy cloud nary stuff. So Tamash, this is probably very familiar for. You.

  36. We do a bunch of transformations on this and then the guest image overlay comes on and that's that little image on the bottom left corner and we generate that dynamically from Twitter so we always can have one offs. We had this kind of set for multiple authors, but it gets a little crazy on there.

  37. Similar to like long names like this one's covering up ABA. If it's a multiple one I go in figma and just mess around. So unfortunately we do some figma on those. So there's a couple things in there going on, but the main thing here is this nice cloud nary uploader upload. All we have to do with that is anything that takes in a URL, it can then upload to Cloudner itself.

  38. So what we're finding when we were doing Opengraph images and stuff, even though we can dynamically generate that image, it looks terrible when it goes through Opengraph. So what we actually do is take this generated URL and load a full image up to Cloudnary as if it were the whole image.

  39. And we actually write that based on the current slug for that that podcast. So that's kind of one of the first things that we had going on more recently. What we've added to this is another pub sub. So now I take and look at all of our different back ends that we have. So for posts or tutorials, whatever we're doing now, we can actually go into Notion and let's just take a look at like a post might be easier.

  40. So we can look at this test post right here. And let's say like I just went like this and copied something and I can paste it directly in Notion, which is an awesome flow because like you don't have to do anything uploading other places. When you get done with that, you click this little check box right here and it actually goes out. And every 5 minutes it now is reading for that check mark. And that's what this search does. So the promise all goes out for all of these different ones. When they all finish, it comes through and it actually does two different topic assignments through here. So when one gets done, it's going to go to PIX to cloud Nari.

  41. That PIX to cloud Nari is going to both change the cover URL. So again, it's using that upload cloud Nari from URL, which is awesome. I, I still, I've loved the fact that they do this 'cause I don't have to download a file stream, upload a bit file stream, like all that messiness, it's all taken care of through Cloudnary. So we actually take and download all of the Notion ones, which are these and they actually have timeouts on them. So you can only get these URLs for an hour every time, like every time they load.

  42. So for our static pages, that could break some of them. So that's why we push them all out to Cloudnary the other nice piece around that which we can get into the further we get into spell kit. But we also put a wrapper around all of our images using currently. So we'll have to figure this piece out.

  43. But currently we use Next JS's image component so that we get cool image like it only loads when it scrolls into view, It does all the the sizing dynamically and it also taps into our cloud and airy public ID too. Is that something that Cloud and Airy has a component or something for that we could use in spell kit?

  44. They do have a JavaScript one. Tomas, you want to, Tomas you want to talk about. Yeah, so right. So again, I'm a bit confused, but why you use next? Why you use Next GS? So sorry there's. Like you, are you rewriting? There's two sides, yeah. Current, so it's on next GS we're moving.

  45. And you rewrite that too, so OK, got it. So first of all, for for next year's, probably you you're already using this, but for next year's you can configure the image component with third party loaders. If you don't want to use, you know the Versailles CDN or whatever they use for your images, then you can just configure it to use cloud nary and and other providers.

  46. But specifically so, as I said, for for swelt, because we don't have an an officially supported SDK, you would have to use this sort of generic URL generator package, which essentially will only do one thing. It will create the final cloud in your URL for you based on, you know, the various transformations and optimizations and whatever you you throw at it. But it's not going to do the sort of like the lazy loading or or whatever.

  47. You would have to come up with the logic for that on your own. Yeah, and this this kind of gets back to, you know, every time we talk about Svelt, like there's a lot coming out now and people are making amazing packages, but that's where React is so much further ahead because there's so many of these packages out there already. So we could do the same thing where we create our our own Svelt image component.

  48. And maybe that's already in the works. Someone DM us if, if it is otherwise, like we can do all that stuff too because it's it's just JavaScript again at the end of the day. And it would be nice to have a, a component do that. But we are using the the cloud nary loader. And anytime we run into an image that is not using our media dot coding CAD dot dev CDN, we actually take and just load a normal loader.

  49. So it just loads the source. So we kind of cover both sides of that a little bit, OK. And so that's, that's probably a lot of, you know, kind of the long and short as far as the blocks go. Every single block gets its own pub sub. So its own function gets created for every block and then it does the patch update back to that block, which is awesome. I mean, we can replace whole pages in matter of seconds really so.

  50. So then do do you mind if I just have a quick question? So once you, so once you grab that image from Notion, you can upload it to cloud in there. Then I assume you and I don't know if you have this already or this is something that you're you're still working on, but then how do you display that image? Yep.

  51. So when it when it goes. So usually we're doing this during like the draft mode of a post. And if we want, we can take a look at all of this live. But usually what we're doing is we're kind of looking at a draft and on our Notion, we actually display the draft in how do I say this next, GS has a preview of preview data.

  52. And when you load that, it will actually preview our page with that data. And once we run Cloud Nari, we just refresh and then Cloud Nari is all of the images at that point. If we're in production and let's say we're updating a post and we want it to be immediately revalidated, we do have a revalidate endpoint now as well.

  53. So we can hit that specific post and it too will take off and just load our cloud narrowing images. OK? Does that make sense? Cool, yeah. All right, so that was kind of our notion tidbits for the day. And again, coding cat dot dev is completely open source. If you see something that makes more sense to you, feel free to throw APR in.

  54. I I was looking to see if I could find this felt image package and there's not one that's current Rodney that's popular in the felt world. Was working on one but I don't it's from 2021. I think so for in my course I well it's. It's not really like a full blown image component, but I did extract the cloud inner logic into image dot swelt file. It just reads, you know, like width and height and public ID and the basis that it does whatever it has to do. So it kind of, you know, extracted away, but it's still not like, you know, that's that's. That's actually a really great point because we were going to do some like what are they called the preview, like data pieces.

  55. So like cloud narrator, you can hit the endpoint and actually create like a blurred version of an image too. So there's. Like sharp guys. Cool things. Yeah, exactly. There's a lot of cool things with that cloud in our endpoint you can actually end up creating. So you can just bring like a 1K or less image in maybe bytes of an image to show like it's going to snap into view and then it actually appears so. Yeah.

  56. Could we set that up in our spell kit site right now? Yeah, we haven't we. So let's let's review where we've kind of ended up. Let me bring it up and we'll get there. So last time where we left off, we were actually adding in you or Daisy. We were fighting about atomic seasons. We were disgusting. We were disgusting.

  57. We were arguing. The thing she does to me after this, I'm telling you I'm gonna have to turn her in for abuse or something. Just kidding. We're we're totally friends. So. I don't know if you know, sorry. Let's just, I don't know if you know the TV series and then later film down Downton Abbey.

  58. Oh, I love Downton Abbey. OK, so if you if you look at the the film, so there's going to be a new one out soon. But if you look at the the one that came out maybe two years ago, there's a scene where this this older lady, someone, someone tells like, oh, you know, why could you just stop arguing? And she goes, well, I don't argue. I explain like that's all what you need to know. Was it the Dame Maggie?

  59. I, I think so. I like Maggie Smith. That's. Her name? Yeah. Oh, she's so good. Brilliant. It's a brilliant line. Sorry, yeah. No, it's all good. It's all good. So where we kind of left off, we we added Daisy UI and and we were having a discussion about how to add buttons, but do it in a like it's felt design component design system type of way.

  60. And Brittany was trying to delicately explain to me because I wasn't quite catching on what she was going for. It was messing me up with how classes on Daisy UI wouldn't accomplish everything we were trying to. But then I got it like later on. Thankfully, she. I I sent you a photo down there too.

  61. I just, I had to get it out. I wasn't explaining it very well, so that's not me. So I think what we're going to do today is actually try to implement that button and then we could probably go to images because the other part that we have is a list of podcasts. And the next step that we are going to do is when you click on a podcast, which this is probably broken. Yep.

  62. We were using a package called Notion to HTML, which actually expects public pages and we're actually doing all of ours private. So we actually will probably have to create a Notion to spelt type of package that will release out to people. It's to create like these image wrappers and things like that. So.

  63. And another thing we need to add is a NAV bar because us typing in the routes is going to get real annoying. Yeah, so let's let's work on those couple things. And Tamash, if if you're like, man, you're not getting to the cloud nary piece quick enough, feel free to drop off. You can always join us again too.

  64. Oh no, I'll get the I'll get the whip out and then make sure you get there. Cool. So I think with that said, Britt, do you want to do you want to drive or you want me to drive? How do you want to do this? Yeah, if I can find the code that we were talking about. I don't remember what I was doing. I know for a fact you discorded it to me. I know I'm like scrolling through all the discord since then there it is.

  65. OK so but I have to share my screen. So how do you want to do that? Are you following me or I'm following you? Share your screen. I can just share it directly in Stream Yard if you want, or I can just follow you around either way. Screen to share. There you go. Good. I'll zoom in for everyone.

  66. So we're still getting that error, but that error's fine, so we're going to just deal with that later. Yeah. So basically we're going to rip out this essentially. And where is our slug I'm? Trying to find the live. Share This is the piece that will end up taking out this page HTML we'll have to take out where it converts it right here, this Notion page OK.

  67. How do I stop? I block. Following you, I wonder. Oh, good question. I think if you click that you know the the same button that you clicked. I clicked a different button because I was. No, it's the one next to it. No, the one the one next to joined to the right. This one ah. Now, OK, maybe you don't.

  68. OK, I don't know. I thought it would give you the option to unfollow as well. But no, it's just got the two. You know what I so there's a request others too. Interesting. If you if you click that share button or the joined button it doesn't show stop following. Leave Access Focus. That's it.

  69. Well, if anyone's watching and you know how to stop following again. OK, so. Otherwise, for now I can just turn mine off if you want. So in this button file, I did this primary and I realized afterwards that primary was not a good thing to call that I should have just called it type. And we can change this to type TYPE and yeah, all this TypeScript stuff in here is going to really get me. What did I do down here?

  70. So down here button dash type. And we just need to do that, right? So that's kind of the basic version of it. And this no, this shouldn't be a boolean. This should be a pipes and we'll create the type type types equal to primary. What are all the types that we want to use secondary?

  71. Probably at least those for now. We could probably do more later I guess. And so when you were saying how would I do success and error the other day? So I mean, there's like, that's a good start. So those are the ones. And then TypeScript will now like only allow these four options and we'll show you an error if you're not using that for one of these types, so.

  72. The other great thing I was thinking about when we were talking about this, it hit me. I, I watched a, a podcast years ago on design systems and they actually put all of their analytics into this button component, which I thought was amazing. So we we can do that too. Yeah. The other thing with this that you can add is like now we can do like let size and we can give it the sizes and we'll create a type for sizes and those can be large, medium. And I mean, you can decide if you want to not use one of these, you can only use large and small, maybe to show this off.

  73. And then down here, you just add the button. Oh my goodness, button dash, dollar sign, curly brace size. And I've got to export it. You can put export in front of each of these, but I feel like it's repetitive. So I like to do this little export object instead. But that's kind of the gist of this.

  74. I mean, we can do the rest of it later if we want to move on. Yeah, that's pretty cool. So now in order to use that button, we actually call the buttons felt component. We could replace the one on our main page, right? Yeah, so we can save that file and go over to our main page in the home route. You know what would be nice as well? I'm sorry, I'm just thinking out loud. What would be nice as well is to set up defaults in the button so that if you just call the button as a component, it it kind of gets set up with us like a preset, you know, like a primary medium, for example, or whatever. And then for every other case where you want that to be different, then you would pass in the type and the size just probably makes life easier.

  75. That does. I don't know if primary is empty, so right choices, but you know something. That is, that's a fine default for a button component I would think. And then if. You change it, you would change it. That's a great call out. So on the home route, we can update this to have a script tag and we can import the button component from and we're going to use that dollar sign Lib slash components. I think you have to do the TS in the top to make it work. Yeah, I do.

  76. Well, I'm not using. I'm not using TypeScript in this. That's true. I don't, but yeah. Will it take in your typings now though? If you like, when you use button like this, does it know there's medium and large without TypeScript? Let's see. Type equal to or No. Did I call it type or types?

  77. Type, Type. OK, that works. Type equal to. Let's do something random.

  78. Yeah, because it's just the the JavaScript script tag. Which ones are allowed though? Oh, that. Sounds interesting. Well, let's see if we add Wang equals TS. Oops, TS does that do same thing? It's changing some things, but it's still not importing the types correctly. It should I I I remember that. That's interesting.

  79. Yeah, we'll have to check that out. That fixed that, but secondary. Oh, there, it's prompting it. So now we're. If I do accent, which we didn't add, it's gonna say that it's but it doesn't I guess. It says type types though. Type of types, but it doesn't bring in those types because we're not importing them into this file. So is that?

  80. If you take out the accent and just hit control space, does it? Does it give you those? Control space, give me something. Doesn't look like it. Oh yeah, there you go, in the very top secondary success. Oh Yep. Cool. So I mean we could do secondary there and whatever secondary is, it will change it right over. Here.

  81. Zoom that in a little bit. Cool. So I think we can use that everywhere we want a button now, yes, let me take it out of. I don't think we need it in our other routes. While I'm doing that, do you want to or I can look up either way, Daisy UI has a like a navigation and a layout and we can start to talk about how we can do a global layout in Svelkit.

  82. Sure. It's it's very funny because today was the first time I heard about Daisy UI so. Oh, really? And you just. I know. Yeah, I kind of missed that. I don't know. Scott Spence, who was in the chat a little earlier, loves to use Daisy UI with spell Kit all the time in his courses as well. And I mean, I really like the style of it and the ease of changing the themes and stuff.

  83. Yeah, because I'm a big fan for Tailwind and I, I, you know, I used it in many, many projects and it's just I, I don't know how I never heard of. This is like a nice free open source component library for that because Tailwind Labs is paid of course, but. I mean, yeah, they also have like a few free components I I think.

  84. But you know, what I really liked about this is I don't know if you remember, you know, how the, I think it's still structured the same way, but you know, getbootstrap.com or whatever, you know, the, the Bootstrap framework, Yep, they used to have this navigation are very similar to that, right?

  85. So the alert, the badge, the car, the carousel and, and all that. And this just uses that. So, you know, if you come from that background, this will look very familiar, which I kind of like, you know. It does, yeah. Actually it really does, because it's the atomic classes that Bootstrap has.

  86. It's very similar now. What did you say? We were looking for Alex like layouts and configuration. Yeah, I'd be. So they have specific like colors and things that they represent, like primary you just saw. As far as layout goes though, I think it would be cool to like we have our specific theme colors now and stuff. It would be cool to put the layout configuration at the top of Svelte Kit to show people how to use layouts. OK.

  87. Does that make sense? I hope. Sort of. So you want to configure it to use like our colors? Is that what you're talking about? Well, we can we can worry about the colors in a minute. Let's let's just talk about how like in spelt kit, you can give a layout for all of the pages and how that's done. Oh.

  88. OK, OK. When you create the layout spelt file. Yeah, so we did do that already. When we did our spelt add command, it created this and imported this app dot C CSS file which is just our tailwind imports here. So everything in this file is just the tailwind base components and utilities that get imported. And then that gets imported into this layout dot spout file. And to have that show up on the screen, you have to have this slot.

  89. So if we commented that slot out, nothing would show. And so this slot is actually where all of the children live at. So what I like to do is bring all of my things into here and do like a main wrapper around the slot. And so I would do a header component here that we haven't created, but like a header here and then create a header component header dot spelt.

  90. And we can just do a quick actually let me do NAV a fly times. How many routes do we have? Podcast just two. For now, yeah. Oh, Emma, it's not working. You notice that Code spaces isn't working in here, or Copilot's not working in here either. You probably because you're in mine and I don't have copilot, I think I don't know.

  91. Maybe. Hey, Hey, Trev, we need a home route home. We need a I'll do. I'm not even going to do the list items. I'm just going to leave it like this. And then we need a podcast. Plural route podcast. And I I think Daisy has the NAV configuration right. What do? You mean? Go check. Oh, so we could do a NAV?

  92. Yeah, I saw that earlier today when I was reviewing what Daisy UI can do. Slash header dot spelt. Yeah, I think it's just navbar at that point. So the way that like you described to me before the customization of those, would you do a navbar spelt component again for the like composability?

  93. I probably would eventually when we start getting more links and things in here, pull this out. Or if we put other things in our header like we have on coding cat where we have the avatar and the sign in and all that. I would break all that out to do a NAV component. Now with with svet is there any pre loading that occurs like in in next?

  94. So like it sees a link and it automatically loads that J sign in the background. There is, so yeah, we would want to do the prefet I think is what it's called. So now we have our thing up here, but I need to find out what was the Daisy UI now? It's just NAV bar. So class NAV bar. Yep.

  95. Hyphen bar. No all one word. Yep, you got it. OK. I just gave it some margin and took away all the padding. Why or gap? Why did it do that?

  96. That's interesting. Looks like they have some like buttons for their NAV. Let's see what else they. Have NAV or let's see. Oh, and then they have a menu, so there's a menu option. There's all kinds of stuff in. Here. Interesting. So you can do background neutral, background primary.

  97. For now we might want to just do primary to see like the color a little more. So what do you do Big? BG dash primary. Yep.

  98. Interesting. Yep, that color and those can be like buttons instead, so you can I. Think it's not color, it's text. So if you put class on those a tags, they can be class button and then do Well, I guess that's see that's the tricky part. Like now you would you'd have to figure out how far you go with using your button tags and stuff, so. So you want these to be buttons inside the? That's kind of weird, isn't it?

  99. Well, they're just classes as buttons. They're still a tags, so. I I know, but I mean you want those styled as buttons in the NAV bar. I mean, that's the way they suggested. I don't know if that's what we. Want they suggested? Well, that's that's the example they have so. Oh. They have a couple other examples. Where do you see the examples?

  100. Because I'm on their NAV bar page and I don't see that just. Open up the HTML inside of those. So if you Scroll down to one you like, just click. Oh, I see. When you hover over it, it's got it's just the accent, though, So they they match the button color with the background of this. And so you can have that hover style that I wouldn't do it that way, but OK, so spelt kit prefetch is how we do the next thing.

  101. And I'm going to felt. Oh, that didn't type felt kit and prefetch is what we want on these. I thought I selected both of those spots, but I didn't. And that's how you grab those links. So when you hover over these now it will call for that in the and I put these backwards. Oops. When you get a minute I'm I'm curious about how slot works.

  102. OK. What are you curious about? So like when I write Angular, we can do multiple router kind of inputs. So you could do like a in the middle if it's this route, display this. If it's that route, display something different in the footer. So like a marketing page, you might take the footer away and the header away and it's just one solid page. Whereas like a normal app page you would have all that stuff. Is that something that slots can handle or? That sounds more like a layout reset. So you would have one layout that has like the header and footer on it, and then you would have a reset layout that you would use for those routes that you'd wanted a different layout. Slots work.

  103. Just think of it as that's where all the children go for that layout. So everything, every route right now that we have, even podcast routes are going to go into the slot in this layout component right here. You can also have named slots, so you can give them a name and then in the component you want to use that slot or put that content in you just put type equal to the name of the slot.

  104. That would that would probably get me closer in my mind because you could do like a instead of doing a footer component directly on this layout page, you could do a slot called footer and like pass that in then. Yeah, that's cool. I think you could do it like that. Yep. Interesting. Sweet.

  105. OK so I got the NAV bar and stuff. Do you want to take back over and start doing some of the yeah configurations? Let's try it out. I love that the Daisy UI primary theme like kind of matches my VS Code theme. It does. Doesn't. It yeah, yeah, that really flows together. It's funny, on my one screen it looks very. Blue and they once said prefetch is so cool. Prefetch is very cool.

  106. Yeah, that is awesome. I'm kind of curious, can we show that off in local host what that looks like if I if I just go back home and. You can and you can see call it in the network panel, but you're not sharing, so I'm going to. Have to add me. There we go, and we'll probably need to get either a different view or just hide our faces.

  107. This right runtime paths maybe? Yeah, I don't look in this very often so I don't know where it's at, but usually when you hover over it you can see network requests being made. So if you clear your cache and stop and restart it. I would also track the and this is. This is how I have that set up like.

  108. Oh it's on hover. It pre caches, not. On oh, it's on hover. Let's do this. Did it do it? Yeah, there. You go, yeah, that's cool. I like that because it doesn't have to like load it. Can you do more aggressive style where if it's like showing or something it'll load it? I don't know, maybe. Just random questions from Alex, you know. Well, I'm going to get the docs up because there's, like I said, a lot that I still need to learn with felt kit too. There's more advanced stuff so that would be nice. All right, so it sounds like I'm hoping that you were still updating.

  109. Yes. OK, sweet. So Brittany added this layout. We have this new header file or components up here and we just imported that just like we would with react. So still mentally I'm I'm together today, even though I can barely think what this sign is called. All right. So the next part that we are on, we're going to.

  110. Just reading in the docs that you can programmatically invoke prefetch. Nice. That's awesome. I love that. But otherwise it's on Hova and on Touch on mobile. Yeah, I was going to say I love the fact like on hover for mobile you could load it. Otherwise on desktop I'd preload it like that's that's kind of where my mental model will go just network bandwidth wise. Yeah.

  111. So yeah, it brought all this in. So these are our posts and what we're going to work on next. We, we could work on this because it's kind of a mess and we could show pagination, but maybe we'll get there when when we need to. But the the next page we want to show is this one, which is the podcast itself, which should still throw in air.

  112. So podcast fix that. So what we were doing last time was getting this perfect stream page HTML. And that's kind of where things went awry because we're using this notion page to HTML, which they very clearly call out needs to be a public page. So that was my bad.

  113. Let's see. So get perfect picks at zero, That's our page. So if we just send back that page, let's say. I just froze up so hopefully I don't lose Internet connection. Be fantastic. I hope you're good. All right, so let's go back over here. Now we're actually sending the entire post back. And when we come into here, this should be more representative, unused.

  114. OK, cool. So I think now we should be able to do this, right? Console dot log post. And see what we get. But was it? Did you fix the public issue? Oh, you have an object there now? OK. Good. The cool part now, because the way that notion works, for those who haven't used it, there's everything is a page. It starts with a database and then a page. So our streams are all in a database. Every stream is a page.

  115. In order to get the blocks, you have to go into the page to get those blocks. So that's kind of the the next step of where we are right now. And again, like, I don't think anybody can see it 'cause it was under our faces. So I hit us. OK. Sweet. So right now this is all we're bringing back about our current object.

  116. So we have a cover photo. So we could do this in Notion. This is our it's interesting. It has the V usually that doesn't occur, but whatever. So this is this is actually the card that we could create. So let's try doing that first.

  117. So in Daisy UI we have card I believe.

  118. You even changed the theme of your Daisy UI docs. Oh, I just whatever came up, I don't know. Yeah, Oh no, not a light theme. My eyes. Oh, I like synthwave you. Know me poor to wash his eyes, he's like heaven. I was like, oh. That was that was to get him to wake up and. He's like, oh. Wow, so this is actually a pretty cool card right here. Yeah, I like that.

  119. So in here we should be able to just do that and that should actually just show up now. Nope, we're going to create a Card component. OK.

  120. OK, so Brittany says we're going to create a card component. So we are going to do in our components, we're going to do new card, just card. Card dot spell. OK, I didn't know if you want to call it something else. Oh no, card's fine. It sounds like we need some inputs coming in so export right for import.

  121. Is that correct export? Export for props. So in react like to make a prop like your react terminology would be to use export. OK. And then I liked your cool like how you just export everything. So if we do let, I don't know what we're going to change in this thing yet. They're so dynamic, maybe like width equal 96? Yeah.

  122. And I I guess the it's going to be a number.

  123. And then this guy will become that.

  124. Oh my goodness. Yep, and like you could change the shadow so you could have like a hover shadow I.

  125. Do shadow. I think you wanted to put W dash with not 96 in line 7 W. Not W Dash. Yeah. Because you you did 96. Oh, you want width there instead of 96? You want it to be the variable inside of the curly braces. Oh, that a fun one. Shadow, Shadow. Yep. And then to be good Stewarts of the TypeScript. Put your Lang in there.

  126. That is one thing that is a little annoying about Spout Kit to be honest, is that you have to explicitly tell it like what language you're using in each script, or if you're using SAS in the style tag, you have to do that too. It's can you do like snippets? Is there like a package where you just always? Oh yeah, you can extensions in VS Code that you can create your own snippets for whatever you want. So that would work.

  127. What were you saying, Tamash? Sorry. No I just I was just wondering if this is going to work because you sent 96 to be a string so wouldn't then the clause BW dash single quote 9/6? So it needs I think it. Needs to be a number. Yeah, I think it evaluates it though. That's what we can.

  128. We can try it either way though, totally fine with me I. Think it does make sense to keep it either a string or a number. I do think it's going to be a string at the end of the day and then then the pipe is going to be pipe with colon or equal still ears. There we go, equal.

  129. Yeah. And I think it's convention to capitalize your type, right? I'm very new to TypeScript so like I don't know what other widths we would use. Do we know what the? Size. There's 7264. Oh, I thought you're going to say there's 72 of them. Like no. There are a lot of them, but they're they're like base.

  130. You can also do like 16 one third and full and screen. And there any way we can import Daisy UIS types just do it that way. That's got to be a thing, right? I don't know. So if you do app. Types. Worked. Let's do that. From. Oh, because you use the package. Maybe they just have types in the package. That would be nice.

  131. Oh, the one said he made a snippet for it. Hey, what for? For adding the lane TypeScript. And made a snippet where it is said snippet. Well, it's probably in his like extension that he made for himself. But yeah, but like I said, there's snippet extensions that you can use and then create your own for whatever you need it for.

  132. So you can maybe make ATS snippet that would just add the Lang equal to TS. Let's see if this actually works. Probably not. Nope, that must not be a typed thing. Nope. That's a bummer. I guess they don't have them listed. Oh well, maybe we can put that in as APR. I was just going to say that I think it's open source.

  133. You can do APR add types that it would. It would be a lot, and you could probably pull these types out into like a type folder too and extract all this code from your files. Yeah, I was going to ask you that. Maybe we'll do that. I think I started. Yeah, I have all these other ones for other stuff. Yeah, so.

  134. Maybe we'll do a model called Daisy UI I'm. Going to do MV. Oh God, what is it MVC spelt? MVC spelt. Model view controller spelt and. Going back to the YEAH phase of 2002.

  135. That's still like really popular in like the node back in world. I used it with. I don't know if you if you ever heard of Cake PHP. We didn't change it to at yet. If you want to do that, we can. We can use my Making Pathing Easier in Cell Kit article. Oh should we? Should we leave it in Lib to stay?

  136. It can be, it can be in Lib, but you're using the at symbol and right now the default is what we're using, which is the dollar sign. OK, let me let me move that up then into Lib right like. That yeah you can. I like that convention of keeping everything in the Lib folder. Yeah, let's do that.

  137. And then it would just be dollar sign Lib slash models instead of at. But I do prefer at. I would change it but you said you wanted to keep it as standard. Just felt kit. If we're going to do an advanced felt kit course, no pressure, we probably want to try. Oh, is it not default?

  138. Wits is declared, but its value is never read because you're not using. Import, import, import and. Export. You could delete line 3 then, right? Because. You yeah, you do need to delete line 3 because you're using it twice. That's probably the issue. But no, it's this import is never used as a value and must use import type. Oh, I wonder if types are different. I've never used TypeScript.

  139. I swear we're using that in other places, but oh, those are in the TS files, not svelte files though. Like here. We're using types, we're using post. I know that somewhere. Interesting. Well, OK, that's, that's something new. That's good. That is, but it looks like it's. Working.

  140. Oh, we did do import type there. OK, all right, back to our card. Let's see right girl? We can also do export by I mean sizes I guess Bulls XL. Oh Yep, you skipped. Are are those the two you want to use? Is that what you're? I don't know. I don't know what we're doing yet, but OK, I just figured I'd put those in. Yeah.

  141. And we're also using that in that button component. So we would probably want to standardize those before we forget. You could probably have that again, all separates, right the the. So if you have things like the sizes, which then you reuse in a button and then a card, then you can just extract those into yet another file. Now you can have this, you know nice structure of your of your types.

  142. We're going to try. We'll see how far we get. I was like, this could actually be like your own subset of the Daisy UI because you get all of Daisy UI, but you want to create your own kind of design system off of that, and this is a way to configure that to your own liking. We're going to have to do our colors.

  143. Later provide this out-of-the-box. I think they have a config that you can customize what you want and you just have to put the config file in your tailwind dot config dot JS similar to how we do in our next JS. Application. It's not going to be this low level. Though, yeah, I don't think it has types though. It doesn't.

  144. I wish they did and that's why I said if we could PR them and say hey put all these types, it'd be amazing.

  145. Well, that would still import all of the types, right? But this is this way we're actually specifying the only the types that we want. From there, that is true, it is doing more of a custom version of them. But if we did it with theirs, you can actually do all this crazy TypeScript magic where you start to do like reducers and like use this, all that fun stuff.

  146. But. That's all on you. I'm not that great with TypeScript unfortunately, but we can work through it. This is how far I've gotten is being able to write like a simple one line type with the OR operator. So let's see here where we are at this and we're going to import. So we've created our our type for import and this is no longer a type. So it's import card.

  147. Oh, actually we're we're doing default imports on these army card. It'd be cool. Like all of these, I think, since they're so specific to do a top level, like export just a bunch of things from a single file, But that's fine. So instead of did Britney freeze? I think so. She's very intense if she didn't freeze.

  148. Yeah, she's focusing. For card from. I can hear again everything's loading back up. Lib. I was just thinking it would be cool if we move these not model the single file I think.

  149. Can you hear me? Yeah. We can hear. I think I might have to yell at my kids to stop streaming. Maybe that's what's going on? Taking all my bandwidth? Stop stealing my bandwidth. OK so I think yeah I forgot to start NPM run down. It's going to be super fun. Whoa, that got a little crazy wonky. Well, let's see what happened and can you split your screen so we can see the code and the sorry. I'm looking.

  150. Excuse me? OK, so let's look at our card. So W dash, what's that coming through US? 96? Well, you're going to have to go down a little bit. I can't never mind, I'll hide our faces. Card width 96. All of that's coming through correctly, but the division itself is do. You need this top level to have like a Max. What does card actually give?

  151. Us well we would put it on the card itself so it's just the full width, so it needs a Max width. So I think in the card component we can add a class. Isn't that kind of weird though that when we had this? In the other file it was fine. Yes, let. Me. Just click. So let's see. What if you?

  152. Do that. I'm going to do that and then do that now. It's fine magic. So why? Is it because Tailwind can't see our new componentized things? I don't know yet. Tailwind V3 says hey, I don't. Take that one out and let me see what was happening. It's just because it was like full width and I don't know now it's fine.

  153. Interesting. Maybe it's the Just in Time compilation? And that's what I'm wondering. If it didn't see it then it threw it out, which would not be good for this thought of componentizing. OK, that's weird because it should still build it and then throw it. Away. Oh, nobody could see The Dirty look I just gave you.

  154. Oh, what was The Dirty look? Because you said this thought about not or about componentizing I mean. Action of componentizing. Sorry, she's really upset after our last one. I don't know. I'm a little touchy. I'm all for design system. Justin's confused, I swear. I'm just kidding.

  155. Oh, I don't know if we posted this, but we should. Kids sucking up bandwidth. Not cool, not cool, kids. Not cool Alex, get off my bandwidth. See how she yells our kids and it hurts my ears. It's not good. I'm Alex too. Yeah. OK. Did you? Did you? Hear me call him Alexander earlier, by the way.

  156. No 'cause my ears a little lit up. So we're we're to Tamasha's like spot. I think now we can bring in a cover image from clouded area. So I'm like next JS where we have that cool loader, we should use Cloud Nary's component. Do we think or? I would I would create my. Since we're doing everything in components, it should be at the Image component.

  157. OK, let's build the image component. At least they, you know, very basic one. I've always wondered is that do you guys when you create new files in VS code, do you go new and then later save it where you want? No, I. Never do that. My hands on the mouse to like OK go here, go. Here go.

  158. I think there is a key command that you can do that if you're on the right folder. Anyone write it in the comments even later? We'll see it. I think one of the online code editors, I don't know if it's Stag Blitz or Code Sandbox, they because you know when you create a new file in in code, you have to actually click the folder and then go a new file. Otherwise it's just created at the root of your project. But one of those online editors, when you hover your mouse over the folder, you get this little icon to create a file or a folder where your mouse is.

  159. And that kind of makes sense and I would love to have that in code as well. Does make sense. Interesting. So we're going to take this guy out. Do we take the whole figure do you think or leave figure alone? On Windows it's Control Alt windows in so that sounds. Is that a hyper key command option? Command.

  160. What's the Windows key for Mac? Command key I think. Yeah. And then and then N. So it's all the bottom control option and command and then N like that. I don't know. Mine is Control alt windows button in. Control. Yeah, I think that would be weird. Does that does that pop this up Brett, for you? Oops.

  161. Control. That. Control Alt windows button in it pops up that yes. OK, weird. That's a weird Keith. Like my fingers felt weird too. That is very weird. Why doesn't like this? Needs to be string? Yeah, weird that it knew it that time. I don't. I don't understand that. It knew it. Like without this it knew.

  162. No it didn't. Oh, that's I don't know. I don't know what's happening anymore. All right, so that's like the very basic. Well, let's at least do some Li set up. Yes, please. We will also simplify that even further, right? You don't need source equals. Yeah. Oh yeah. So in JSX world you have to do this.

  163. You can actually just do the SRC and the alt in curly braces, no? If the attribute is the same as the, I hope they. Update. That correct? Well, it's JSX, right? Well. I I think JSX technically can do this. React more than correctly Think. Don't kill me people I don't know I. Won't talk bad about reacting.

  164. Yeah, React. OK, so we have an image component that we'll have to work on like see if we lazy load, but for now so that is going to go in here.

  165. Oh, I'm not following you anymore. I'm just getting errors. Follow. There we go. This is still like the neatest little service, the live share. I love it. I think it's. Amazing.

  166. OK. Type. In there. So this has to be so I don't have to do that even do I just do like so this will become. Well, where's your SRC coming from? Yeah, that's that's kind of interesting. So here we'll have to do something like let maybe we do an image component I guess figure because we have to pass all the data for an image in to allow for it and it's going to be optional. I would imagine you do a.

  167. Type of image your card component. I think you would want this logic to be in your Image component. You would want what in your image component. I I would think you would want the logic in your image component for like the cloud and area piece right? I think all that will be, yeah, but we're calling the image to show it within a card.

  168. So if we get image we would show it. So like how do you do? Can you do image question mark turn area or no? Yeah, you can do a turn area like that, like that. Oh no, you can't. No, it that doesn't work. How do you do? Do you have to write function like if image give me the component otherwise don't? You would use.

  169. Template. Sorry. I would do a templating block so if. I forget about that. OK. Then you would call image. Perfect. And if and then you can do an else there. Awesome. Why is it complaining? Because image does not. Image implicitly hasn't any type because you haven't defined the type for image this.

  170. Yeah, you're giving it the image as your component. Oh, so it doesn't know a component's type like the exports coming out of that. It doesn't understand this. Apparently not. I don't know. Interesting, so if I were to do this would it work? Who's got a cat meowing? Yeah, she's annoying.

  171. I I thought it was appropriate on brand. Yeah, that's true. That is really interesting how this works I guess. I just started music in my ears. What the heck? Yeah, I think you need to define the type separately, because it wouldn't. That's a total bummer, you know? Like it should just auto detect the types. Well, usually you write like a class and then you have like all your methods and stuff like that and then TypeScript understands what that class is able to do.

  172. So, but it's not a class. You might have to investigate that a little more I guess. Yeah. So let me bring up. Also I finished the swelled. Do you have Do you have link TypeScript? Sorry, say that again. You do OK? No I I was just asking if an image that's felt you actually had the line equals. To.

  173. DS in. We do. The script tag you do OK. I know Brittany and I were talking earlier about how we with our Devrel jobs and maybe you run into this, we feel like we're blogging so much and doing videos so much that we lose on this like coding piece. So I love doing these Fridays so we can like, keep up with it.

  174. Hacking away. Yeah, yeah, it's, it's getting more and more difficult. Right here.

  175. I do kind of wish it would just come along with the component because that's really bogging down. That's my main complaint about TypeScript is it makes the code so hard to read and parse. That little question mark after the image is, oh, that's TypeScript. To make it, you need to do that in the model, right?

  176. Not in the in the initialization of that variable. Yeah, I think this needs to be like, oops, yes, like that. And then let's see if this works now.

  177. Well, you called your component image and you're calling your type image too. You can't have the same. Yeah, I was. I was hoping that this would work now that. I oh, I see. The error was though, so this says type object. Oh, it does it does see source and all What So type object is missing the following properties.

  178. Yep. So it it did pick it up. All right, That's that's so much better. I was like, that can't be true. So let's see can I do this still? No, because it's going to be. Source is equal to post dots post dot no no. Where are we at? We're in card. So source is equal to image. Does it understand?

  179. See that's that's the intriguing part. So it's it's considering this a image felt component. Yes. So I was wrong. We do need that. That's too bad. Like I wish it understood that image had these attributes coming in. It did look like it had that you have to put the type in a separate file.

  180. Someone to say? Oh, that's not cool. Thank you though, I guess, I guess we. That solves it, but. I should have not deleted my generic. This is This is why we need like get commit every like second I save. I think I got all excited and deleted our generic. OK, sorry folks, you'll have to watch me do this again.

  181. OK, I'm going to step away for a second while you're doing that. No problem. Tomas. How you doing? You awake? I'm. Yes, I am. OK, good. Technically, this probably can be that, although it shouldn't be. Yeah. OK, now we're getting somewhere.

  182. Yeah, it's because of this side. Oh, right, you can't do that.

  183. Not sure what that'll end up like, but that should fix this and a back. Timeline panel What does timeline panel mean? I don't know. Where you're like well either B1 said timeline panel. VS Code now has the save history too. Saves my panel. Where's timeline? That's that's new timeline my view.

  184. Oh oh Oh no way I didn't know that existed. Oh but that's just in this file. Can I go to a different file? And then Jean, I don't know how to say your name. Sorry. Jean. Something. Yes. I would love to be able to export types directly from the svelte component too. What did you say, Tamash?

  185. Oh. No, I just tried to pronounce his name as well. Is it John? I. Think he's Jean Ives. Jean Ives, I wish I could speak in French, I'm assuming. Just hung out with some French people. I should be on the ball in the. All right, so we have our card component. Source is complaining source string, alt string is not assignable, it has to be an image. How do we pass a multi thing to a thing? So if I do image equals and then can I send in a object? No.

  186. I mean, you can send in any kind of JavaScript, but why are you sending in? This this needs to be oh object. So what does the image component look like? Again, what are your props? So you. Are not in your image in your card. Yeah, when we go into card the prop for image, it is going to be our image model which has. Which is an object of yes.

  187. So you can send it in like that. You should be able to I. Think it's. Always complaining for. The world unexpected? Well. Because it's an object, right? So you need a. Oh yes, comma. Oh boy, it's fried. No, now source is complaining short hand properties. Oh, it's still an object we'll get.

  188. Oh my goodness. We'll get there. All right and now image is complaining width.

  189. Widths. Oh I think we just need the rest so. So how do we do optional types up here? So can widths be undefined or undefined? I think you can do it there, or you can do it in the models for your types. You're asking me TypeScript questions. I don't know. OK. I think that's. I think I answered it correctly.

  190. John I've. John I've. Is that how we say? John, I've John. I've John, I've sorry, John, we're like pronouncing your name terribly wrong, but. And. Horrible American. So what we have type image source string, alt string is not assignable to type intrinsic attributes and width or undefined property.

  191. Image does not exist on type. So are we not exporting something? That's that's what it feels like. Yep. Oh yeah, shadow and image. Yahtzee. OK, Nice. Tamash, do you have Yahtzee?

  192. Do you know what Yahtzee is? No. It's a it's a dice game you play with five die dice, 5 dice, die, die, five dice and you try to try to get like straight, so 12345 or like a pair or two pair. It's fun. Yeah. It's. Like a card game, but a dice game. And Yahtzee is when you get all of them the same. Yahtzee I.

  193. Didn't have to shout Yahtzee. All right, well. OK, so this is the very generic version of our card which should come back correctly. We'll refresh, make sure it's doing the Lorem ipsum so it's changing the image each time now we should be able to change this out. Oh you were using an APII have never seen that.

  194. That, that is a cool one if you ever write that one down. So you're already in JavaScript. You don't want to use curly braces there. You want to use back ticks if you're going to do a string interpolation thing. So we're going to do back ticks and we're going to do post dot, cover, cover dot. Oh my gosh, stop it, dot.

  195. Mine has been so bad lately about auto populating things that I don't want. It's like stop. If you're not going to be helpful, just don't. So if we're if we're doing this nicely. Now you need a question mark. Yep, this the knowledge coalescing. Oh, good word usage. I like it. Nice.

  196. Yeah. So. Come on and do stuff. Yeah, let's let's go just add, I think I actually have this now in ours. So let me just open CCD up and go directly to post. God, you do that so fast. I don't know all the key commands to do what you just did. I don't either. You just did it. How do you not know it? You just like in your brain, you know them and it's. Like it's muscle memories.

  197. It's muscle. There you go. No, I I actually do it kind of the slow way, but if you just command P or. Whatever. You didn't have to put that in a I'm just I'm just thinking you didn't need to put that in the template literature it. Just automatically. Yeah, you're already in. JavaScript, you're not using a a variable.

  198. Yes. Yes, so we actually want to do something about the fun part is we should allow this in our card to also say, Oh, this is this is dirty because we almost want to say in our image will allow that to come through as well. But it realistically just forsake of me not going crazy.

  199. If we check this, we could go so I got to remember your syntax. It's pound if right and then we go that. So if not this, not that we're going to do the same card and then else happens after or within. Inside that and you're going to do no like above that, I'm sorry. Inside the markup there you go and then your curly braces colon else.

  200. Oh man. And then space if. Oh my goodness, that. Are wait, are you doing? Are you doing just else? OK, yeah, never mind. So we'll drop that in, but if it so actually we'll do it the right way. So if it does exist, we'll throw it through. If it does not exist, we'll just do a card without an image and then we'll update our card.

  201. Sorry, OK, I. Was wondering where you were going with that. That should be OK. It says it's not, but it should. Allow because the width. Oh, I think. That is a little confusing too. No, it should be all right, right? All of these can be on it. Undefined, undefined, undefined. Yeah, it should be able to have no image.

  202. Width widths. Type images missing property images missing but required in type width. Where's the type for width? No, it's in any of these in in all of that image. Image here. Oh OK, that's where it's looking for it, but it says or undefined. That's so weird to me that like I keep thinking this should be that but it doesn't like it.

  203. I wonder if. It's. That's not your type, that's your variable initialization. So that's JavaScript. Your type is where you would do that, right? But the type says undefined, so it should be fine. Interesting image is missing but required. It's not required though. How is this with question mark coming through in shadow question mark? Where is that at home?

  204. Right there. I wonder if that's defined in those like you said. Do you? Have a but it's. Not Mark, no. Where is it getting that question mark from? Maybe it's 'cause it's equals undefined?

  205. Yep, that was weird. So I guess you have to initialize your variables. Oh, with a default value? Is that what we needed? Yeah, I guess so. Interesting. So actually it's this we can throw through as well, and this we'll do title because this isn't going to come through properties.

  206. Not Oh my gosh, title sucks. It's like name. Oh, this is where we get into the Jason. I, I don't know, I'm just. Going to hell, just like nesting look. Up a title for now and see how it goes. OK, all right, let's cross our fingers. Hey, woo. Cool. So this should be a cloud nary image. That worked.

  207. Nice. And because I was so nice to release our CD end of the world, it works everywhere. So you can technically lock down media dot coding CAD dot dev to only work on our site, but I found that a little painful. Oh, because you wouldn't be able to use it on this site if you had done that. Correct.

  208. Yep. So we got a little further. I think that's pretty cool. We're trying to stick to 90 minutes at a time and we're we're getting close to that any so. I tell you what I would change. Yeah, tell us. So you know how you pass into the entire source source URL for your image. You mean for the image? Components.

  209. Pardon. Yeah, for the image component. OK, So what I would do is as opposed to pulling in the source, I would just grab the public ID. Yep. If you I'd like, I don't know if you stored that separately. So the the interesting part on Notion we have to give it the full URL, but I do separate out the public ID when we're parsing that data so we rip out like the a loop down to our actual folder name so it has it.

  210. OK, because if you pass in the public ID then it means then you can use the. You can use the cloud in your URL generator to generate the actual cloud in your URL and then you could then put the F photos and Q autos and all that optimization in in your image component. Essentially that is a a great great point.

  211. Or just throwing this out here since I do all that for looping and nonsense up there. If we detect that the cloud and area in our image component, we could do it there too like directly in our component. Yeah, I don't know because that would you know that that would give you a lot of I mean even if you just state the URL that you that you showed in the browser just now. Yep, so and you said this is coming from cloud in there, right.

  212. So if you. So this the actual URL comes from Notion. But yes, the the image is then delivered. So like if we took out all of this stuff, that's the actual image. And then what Tomas is saying is if we do Q auto, F auto, we'll get our AVIF format back. Or yeah, whatever format cloud, you know, deems to be the the best one.

  213. And if you checked in network panel, this is where things get, you know, exciting. So it's just I can't see the values, but if you thank you, if you refresh and you select your image and look at the so this is what 66.6 kilobytes? That's a funky number. Yes. But yeah, so it's yeah, 66 kilobytes if you just go back and do check the request without F auto and Q auto.

  214. Yep, that was that was going to say it should show us what type came through as well. All right. Yeah, if you go into, it's that content type image again enough, Yeah. Yeah. So you see our AVIF because I don't know if this is fully public or not yet, but we're on the beta program for AVIF to come through. Yeah.

  215. And then and. Then if you just delete those, we should get a larger file. You see it's. Yeah, it's nearly twice. Actually, it's more than twice you. See the image slash JPEG there. Yeah, and it's 100. And cool part, like if you look on on our main site where the next JS is actually doing this for those who are interested, when you look at this one, it does a lot more than just that. So you'll see a full image come through with all the different, different break points.

  216. So 640 gives you this image back. So it's much, much smaller. When you're on a smaller device, it'll pick this up and as you see in the F auto C limit, it goes down to width of 640 and then you still get the Q auto. So this is still going to bring a AVIF back, but not nearly as big. So the network for this one should be quite small and. Cloud Unit has a generator for this binary. Yeah, yeah.

  217. So that's that's the. Responsegenerator.com I think. Yeah, Would you? So for our sake, would you recommend like if we had to take a full URL, would we? Would you just do that on the server side and do the cloud Nari URL creator type of thing? Yeah. And then just load that and then statically we could display it just based on those two. Yeah, that's what I did in my course as well, right? You just use that URL generator and then you basically, you know, the entire cloud only feature set is available at your disposal using that SDK about using a package. And so the last thing that you do is let me just say, I think you just call A .2 URL and it will you know, based on all your settings and all your, you know, parameters and transformations and optimizations that you programmatically created. The final thing is, you know, generate me the full URL if we just give you kind of.

  218. Piece everything together that you. Yeah, yeah, yeah, yeah. So we, we finally got to the the part that was the really cool part for Cloudenary. So maybe maybe we need to have Tamash and maybe we can get Mr. Fayak on as well and bring in the whole Cloudenary gang. And maybe at the end of 90 minutes we could actually have a spelt component for Cloudenary images.

  219. What do you think? Yeah, that would be nice. Yeah, we can do that. I'll leave you with one more thing because I think I heard you mention lazy loading of, of images and this has come up quite recently in many discussions that I had with people.

  220. You know, Core Web Vitals is obviously a thing, and it's a big thing these days for multiple reasons. And one of the, the, the, the, the metrics that they look at is the largest content for paint, right? And most of the time, the largest content for paint or the largest element that you load on your page is going to be an image. And So what I'm going to say now is, you know it's not going to be true for every scenario, but if your largest element on the page is an image, do not lazy load that. Yep.

  221. Agreed, because a lot of people say, well, OK, I'm just going to lazy load this. And then what happens is because remember, the browser is going to wait for everything to load that's in the view port. And then it's going to measure the time, you know, your application to, to load whatever the largest piece of element is. And so if that's the image and now you lazy load that image, you're just going to shift that LCP score even further out. So just just make sure that you know your LCP is not an image. If it's an image, then you know, optimize it and do all sorts of things to it, but do not lazy load it. We do what's the progressive, I think is the OR no primary, I don't remember.

  222. We, we set ours for the top image that we show. That's the that's the main focus for the download. So because it's the LCP, it's always our top image almost takes the full fold type of thing. So yeah, we have a nice note here. Let's do a hackathon. I like it. So we kind of do a 90 minute hackathon every Friday.

  223. Feel free to join us, DM me, DM Brittany, we'll hook you up with the the stream link directly to stream yard and everyone can join and we'll share out the VS Code. So. We'll have to do like a long day, long like, or like longer one sometime like a long day, read a thon. Especially with a set focus like that where it helps the broader community where we're getting kind of like, hey, what's greatest felt component for images, just like next JS and Gatsby S cool, yeah.

  224. That would be nice. Well, any last minute thoughts? I think we we, we kind of did all of our fun stuff at the beginning this time. I think you need to remember to do a git push before we end. Yes, I'll do it right now. I, I think I'm I want to ending me ending these, even though I'm, you know, coding cat cat person.

  225. I love basset hounds. So I'm going to show off every Friday's Basset Hound. Oh nice. So that's that's going to be my ending from. Now very cute. I think maybe next Friday we can work on getting a live site. So deploy. Yeah. To Netlify next Friday and then have a live site and we can work on more.

  226. Cool. Do you want to do that offline and get the on and just show them how we did it or just I'm thinking about keys and things so. No, because we can use the Netlify CLI and import our environment file without showing it. Awesome. Yep, I think we'll do that. Perfect. All right, well, let's get two things on the books. So next week we'll get the site live on Natlify. I don't know why Natlify, I don't know why after them, but and then.

  227. Maybe someone is a little bit biased. I'm a little biased. If we if we schedule out a little further, maybe we can get the cloud nary crew on and we'll create a scout component. I think I was a little biased before I worked there too though I've used them for a while. Yeah, I I like the majority of them.

  228. It's a cool company. Cool. All right y'all, thank you so much for joining code with Coding Cat. We'll see you next time. Thanks for having me take care. Ciao.