Why We Switched From Svelte Kit To Golang + HTMX

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
we finally did it we completely get rid of our front end dependency next GS and spel kit and we are only using goang with HTM Max and this is not a meme this is not a clickbait if you want to know why we did it and how we did it you definitely need to watch this video but first of all if you're not yet subscribed to my Channel please consider subscribing give me a thumbs up and leave all your questions in the comments and of course jump into the Discord community all links in the description right so first of all um who is dissing is is swate well it's leue right so basically leue is a company I uh started founded two years ago with a with a couple other good people and um we recently actually got a series a uh funding of 8 million so it's not it's not a joking company right it's it's a big deal we also acquire two other companies and two years ago we uh wrote Our platform or Marketplace in uh next GS right everything in next GS everything was fine uh no big of a deal good piece of technology right but of course right now we we need to scale a lot uh we need to rethink how how our Marketplace is working and we decided to make a V2 right a complete rewrite sometimes hey it is what it is so with all the feedback we gathered over the past three years we are going to make a version too and um we were thinking okay cool we have the opportunity to rewrite what are we going to use and we decided with three other people which basically my included so two other people we decided to go with spel kit in the front end and goling in the back end sounds like a power deal you know what I mean sounds like a good stack to to to work in and that's true but but we came in some some some problems so this is the Y part right so we have SW in the front end gang in the back end um but but the only thing we were doing actually was we didn't want to use client side rendering on the front end right so we were using spell kit with the with the service side rendering but we had all our business logic sitting in the goang back end so the only thing we were doing was just rendering HTML duplicating the types typescript and proxying the request to the backet right that's the only thing we're doing so there a lot of shenanigans going on not then right so if we have a Handler uh if we have some some kind of an API call uh in in in the back end that return some Json we needed to go into the front end render the HTML make the types do the call but actually just proxy it right so it's it's on the it's on the back end right so it's not from the it's on the serice side uh stuff from uh on self kit instead of the client side stuff so it's basically just a proxy right yeah and that was just annoying because if I was working on the back end and I needed to just change some little some small little HTML value or whatever in the front end I just needed to open up the whole spell kit stuff I needed to make the types I needed to make the proxy request I needed to do all do all that authentication needs to be okay the user yada yada the state it was annoying so we did the thinking process like guys listen do we really need to have that front end complexity right although our Marketplace is very interactive right it's a big thing it's a lot of things are happening but still is is it worth it to have these two separate things the front end and the back end especially if you don't have a mobile app right if you have a mobile app you could basically question what we're doing but we don't have a mobile app because using lavue on a mobile app is basically just I don't know playing soccer with no legs you know what I mean uh you don't do that maybe we will later on but it's going to be a subset right so we were thinking guys listen we need to get rid of this of this uh of of this of this front end dependency but the only thing that was holding me back because I did a lot of goang back ends like like PHP like Lal or like Ruby real where you have everything in your back end and you render templates which is just a breed of fresh air to work in the problem with goaling is that your templates are basically not type safe that's the only problem you have in Goan right because you have a map with some data you want to basically use it in your HTML but if you be it's a map so it's not it's not type safe right if you mis type A String you have no value and then debugging is going to be very hard especially if you have a lot of stuff going on a lot of templates but Joel from uh also from the community but also uh an employee of leue he came up with this he came up with this he said Anthony listen look at that Temple and I said what the hell is that an HTML templating language for go that has great developer tooling and boy oh boy it's completely insane people are sleeping on this I don't know what I never heard of this this is just a sleeper thing especially if you know how to use it right so it's just basically template files but you use them as it's just a go file so it means that you can write goang in your HTML a little bit the same as uh using G uh using a function in in next in next in react actually where you returning a GSX it's actually almost the same right so this completely changes the game because now you have type save values right it's just cooling it's just cooling it's crazy for example here right you have this index with errors you can have layouts you can just write where there's a good example you can just look at at that this is a diff and you can write goal line inside of this thing you can make you can even make input components you can make it's crazy let me know if you want to see uh an in-depth video on how we set that up if you want to see an in-depth video on how to use that right on how it works on how we made it work like it's crazy right let that know in the comments if you want to see that if you have enough comments if you have enough likes on the video I will make a special tutorial for this because I think it's it's a sleeper stack uh and if you basically use it well man this is this is insane uh what's going on here yeah so um yeah you can see you can just write right go Ling and in your Handler let you open up a Handler here uh is out Handler you can see what you do here is basically um for example if you have erors here if we have templates if you have uh sign up erors we can just return login index with errors which is basically just uh this thing right with errors directly from goling right so you have typed errors and you can do whatever whatever you want with that right um yeah it's it's just it's that easy right uh the cool stuff is with this templating thing is that you it works very good in vs code because there is a plugin I think it's also for Vim not quite sure you need to check it which you can GD in go to definition and all these stuff right isn't that amazing you can basically just do boom you're it's it's it's insane it's crazy uh you can see what what Joel is doing here i' Shar the logo so it's a complete uh component stuff it's wild guys I swear I cannot even even stop talking about it it's just insane so big grats to Joel for finding this because I didn't know right so that's that's what we that's what it is right and if you want to build that I don't know if it's going to run but you just make run it's compiling these templates like a madman right it's compiling all these templates it's generating go- code for you and you don't need to look at it and it's just boom using the echo framework by the way um if you want to know why if you want to know why let let me know I will make a a video about it right so that's actually it what I want to show you we're also using HDMX here and there um for mining stuff uh I'm not quite sure where but it's just very minor right so if you want to have some we have some a couple of use cases but we didn't Port everything yet but I'm going to definitely make a follow-up video where we using HDMX where needed right to um reduce the amount of typescript JavaScript we need in the front end although what I want to show you is that we we use uh some stuff right because there are some uh use cases where you really need that JavaScript well that's no problem you just uh do that right of course I did not do an mpm run or mpm build or something um that's why this is basically uh still bking but you can write just yavas typescript here and uh use that with these templates on and all that stuff uh insane I know it's it's it's amazing guys uh this speeds up or or uh development process uh done right because now we don't need to juggle between front and back end uh deployment is just a breeze man with the getto runners on our server we just boom we push to master and it's deployed right it's just a make run um and and it's there that's the power of goaling right um yes so that's it guys let me know check out uh I will put some some uh links in description check out this templating language pretty amazing um like this video leave some comments especially if you want to see me make a follow-up video uh with a tutorial on how to set that up leave it in the comments give me a thumbs up boost this video into the algorithm and I'm looking forward to see you in my next video or live stream peace out
Info
Channel: Anthony GG
Views: 75,198
Rating: undefined out of 5
Keywords: programming, web development, javascript, htmx, htmx golang, golang htmx tailwind, golang, go programming, go, golang tutorial, typescript, webdev, react, full stack, software engineer, software engineering, development, programmer, programmer humor, svelte, go programming language, web developer, software, developer, coding, sveltekit, sveltekit golang, computer, developers, engineering, regex, regexes, vscode, vscode engineer, regexs
Id: zB9tEQYLPL4
Channel Id: undefined
Length: 9min 54sec (594 seconds)
Published: Fri Dec 08 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.