Тёмный

From Svelte to Go and HTMX 

ThePrimeTime
Подписаться 432 тыс.
Просмотров 141 тыс.
50% 1

Recorded live on twitch, GET IN
/ theprimeagen
Reviewed video: • Why We Switched From S...
By: Anthony GG | / @anthonygg_
MY MAIN YT CHANNEL: Has well edited engineering videos
/ theprimeagen
Discord
/ discord
Have something for me to read or react to?: / theprimeagenreact
Kinesis Advantage 360: bit.ly/Prime-Kinesis
Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
turso.tech/deeznuts

Наука

Опубликовано:

 

16 дек 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 346   
@_MoKhaled
@_MoKhaled 5 месяцев назад
Can't imagine my two favorite tech youtubers on one video together, this is legendary
@a-yon_n
@a-yon_n 4 месяца назад
Several of mine are often
@vyrwu
@vyrwu Месяц назад
Epic
@Svengtz
@Svengtz 3 месяца назад
Next up: from Go + HTMX back to PHP.
@robertzxzx
@robertzxzx 2 месяца назад
Would rather eat raw aluminium every day than program in php
@ncpeaksean4278
@ncpeaksean4278 Месяц назад
Whats the joke?
@tcrypt25519
@tcrypt25519 27 дней назад
The language isn't great but the model is. Inherently stateless so easily parallelized, native ssr, and faster than JS. If the language itself was safer and less trash php as a platform would still dominate.
@blackaccel
@blackaccel 26 дней назад
@@robertzxzxI concurr
@egzakharovich
@egzakharovich 21 день назад
But why, if with Templ Go make the same thing PHP did?
@console.logged
@console.logged 5 месяцев назад
It’s nice seeing The Rock get into HTMX
@casper0165ful
@casper0165ful Месяц назад
Hahaha now thats funny
@xixo47
@xixo47 29 дней назад
Thought was Bezos
@dejangegic
@dejangegic 5 месяцев назад
This is the colab we need. Anthony and prime talking Go let's do it
@colemichae
@colemichae 5 месяцев назад
Anthony could not keep up with Prime 😂😂😂 prime just spits it out which is great
@aspuzling
@aspuzling 5 месяцев назад
Sorry, but "reacting" is not collabing. Anthony has no chance to respond to Prime.
@dejangegic
@dejangegic 5 месяцев назад
@@aspuzling I might not have been clear. I would like for them to eventually collaborate, and this comment was just me cheering on that idea.
@aspuzling
@aspuzling 5 месяцев назад
@@dejangegic ah got you. Yeah I agree
@JkyLi
@JkyLi 5 месяцев назад
I did the same for the previous few months. I used to have a Go backend server and a svelte frontend, I use the static svelte generator to generate static files and directly serve them as static files using caddy. Now, I only have a Go backend which spits out HTMX. It takes way less effort than I imagine. However, the performance of my tiny internal tool that only be used by a dozen of people is the same. The maintenance time does go down though.
@MrMustachehead
@MrMustachehead 5 месяцев назад
Love that chat about type security. Anything without static code analysis warning/errors is so much harder to refactor in the future because it takes so long to hopefully find all the dependencies. And you can never be sure you have found them all
@MrTallAndy
@MrTallAndy 5 месяцев назад
"How many config files do you have in your frontend app?" "Yes"
@MickDavies
@MickDavies 5 месяцев назад
So it's Laravel + Livewire? The modular monolith lives to fight another day son! I like to think that a PHP dev whose comfortable with Laravel could step up their skillset to Go in this type of capacity relatively easily and gain some new skills in typed languages but without a completely jarring learning experience. Go is the PHP developers secret best friend, they just don't know it yet 😅
@phoneywheeze9959
@phoneywheeze9959 4 месяца назад
does livewire return html? to me this feels like an old fashioned way of developing applications, what if you want some of the logic to be used for another project in an api? i used laravel with ajax before, and in there the client browser made the dom elements with the data
@mgjulesdev
@mgjulesdev 2 месяца назад
​@@phoneywheeze9959 if you properly architect your server, then how you expose your data should not be hard at all. Your usecases should not be aware of how data is exposed.
@jeffreysmith9837
@jeffreysmith9837 Месяц назад
​@@phoneywheeze9959 You separate the logic into packages that can be reused. The PHP equivalent would be extracting reusable logic into classes.
@Qrzychu92
@Qrzychu92 5 месяцев назад
I don't want to be THAT guy.... but the hated C# had this for decades :D type-safe, async data fetching from within the template, streaming rendering etc, hot reload in templates (now also in code). Just saying :) btw, now it's even better with with Blazor server rendering
@Ellefsen97
@Ellefsen97 2 месяца назад
Blazor feels so nice to work with. It’s so much better than razor pages imo
@vinnythelegend
@vinnythelegend 5 месяцев назад
I built an entire app with golang and HTMX, without even realizing TEMPL existed! I used the built in text/template for Go and I didn't actually hate it.
@doublekamui
@doublekamui 5 месяцев назад
isn't text/template is slow? 🤔🤔 i used jet template engine and used htmx inside it
@vinnythelegend
@vinnythelegend 5 месяцев назад
@@doublekamui it was pretty quick for me and I was working with a decently large data set. however I did have an infinite-scroll feature for the client so it only templated like 25 entries at a time.
@samadkhafi9211
@samadkhafi9211 5 месяцев назад
why not html/template?
@vinnythelegend
@vinnythelegend 5 месяцев назад
@@samadkhafi9211 html/template uses text/template under the hood
@jiasheanleong7918
@jiasheanleong7918 4 месяца назад
It's worth noting that the text/template isn't injection safe, while the html/template is
@baz5719
@baz5719 5 месяцев назад
Prime has been so good for the developer community at large. I hate to think of a world without him.
@liftingisfun2350
@liftingisfun2350 4 месяца назад
Don't use hate around Christmas time.
@v2ike6udik
@v2ike6udik 4 месяца назад
Plot Twist. He is not real. Just AIgen Mr. Moustache running wild.
@jerbear7952
@jerbear7952 3 месяца назад
People still think the AI plot twist thing is funny?​@@v2ike6udik
@ryanleemartin7758
@ryanleemartin7758 5 месяцев назад
Svelte kit is now the recommended choice even if it’s going to be full SPA .. basically for the built in routing
@ollydix
@ollydix 5 месяцев назад
It's good but the +page.svelte kinda sucks, would love if it was the same directory name for the +[dir].svelte
@electrolyteorb
@electrolyteorb 5 месяцев назад
who is recommending?
@Dozer456123
@Dozer456123 5 месяцев назад
@@electrolyteorb "Just trust me bro" is recommending it
@ryanleemartin7758
@ryanleemartin7758 5 месяцев назад
@@electrolyteorb Oh, The Svelte team.
@ChitChatLLMs
@ChitChatLLMs 5 месяцев назад
@@ryanleemartin7758 😂
@chefaku
@chefaku 5 месяцев назад
4:58 yes i am a lazy backend developer, I want the answers to my problems to be easy and simple "idiots admires complexity"
@humanbeeng-programming-tp3pq
@humanbeeng-programming-tp3pq 5 месяцев назад
It finally happened. Anthony on Prime’s channel🎉
@ignrey
@ignrey 5 месяцев назад
4:47 I 100% agree with what he's saying trying to build a solid piece of software with react and some backend languages could be a nightmare in terms of security, integration and stuff.
@erickmoya1401
@erickmoya1401 5 месяцев назад
I have yet to see the video. But I dont see many people in htmx explaining how this makes it secure, handles auth +auth.
@RememberingGames
@RememberingGames 5 месяцев назад
​@@erickmoya1401It doesn't because htmx people only do miniature apps for views on youtube. Nobody with a rationnal mind would use that to build a real life, big application.
@dealloc
@dealloc 5 месяцев назад
@@erickmoya1401 It doesn't, it's the same factor of security as anything else that outputs HTML-usually whatever templating language you use, whether it being JSX or something else will handle things like sanitisation to prevent XSS. But everything else is still prone to human error, and therefore to security issues.
@ygunayer
@ygunayer 5 месяцев назад
Can't help but realize how we're coming back full circle to the modular monolith and I quite welcome it. I'm leaning towards the Elixir/LiveView side of the fence, but I wonder: what is the breaking point? Is it the over-complication of the JS/TS ecosystem? Is it because the cognitive load for writing and maintaining SPAs is going off the roof? Is it because SPA frameworks and libraries are getting so bloated that it defeats the purpose? Is it because each of those frameworks and libraries lock you in (I'm looking at you, React "library")? Or is it simply because the SPA model was never the right one? My take on it is that the only thing we've ever needed was the ability to hook up a certain HTML element with an isolated state and logic, and the JS+HTML model never provided that out of the box, whereas with traditional AJAX+SSR it's quite easy to implement. The latter traditionally suffered from scoping issues with global JS for interaction, and most importantly global CSS for styling, and it looks like HTMX and the PHP model of rendering within the language bounds fix the former issue, and Tailwind just obliterates the latter.
@danielg3857
@danielg3857 3 месяца назад
I think it's like you said with the SPA model; there are cases where the hypermedia/enhanced html way of doing things isn't good for complex interdependent ui state as per the HTMX docs, and so you need the overhead of a js framework, but at the same time the modern js overhead isn't worth it for most cases, so people would take a big perf/complexity hit for the rarer case and because of the developer/career inertia; nowadays I hear people talking about having the complex JS in little "islands", so the future meta might be backend-templating/enhanced-html(whether htmx/liveview or even a future HTML spec) and light js scripting with occasional islands of heavy js
@StephanHoyer
@StephanHoyer 2 месяца назад
For me it's the frameworks that suck. I work on a fairly large app with mithril.js and I'm still very happy with it. But I think for most trivial cms-like apps go and htmx are a pretty good alternative. For my app (an online worksheet editor) it's not sufficient enought I think.
@jenreiss3107
@jenreiss3107 5 месяцев назад
mmm doing the same but with Ruby and Sinatra. It feels like a warm blanket in a land where the word "Javascript" has never been mentioned
@sweetphilly2
@sweetphilly2 4 месяца назад
Wow I literally just watched Anthony GG's video with this video queued, having no idea that you were reviewing his video
@apollolux
@apollolux 5 месяцев назад
Reminds me of Smarty templating in PHP, but over time it was so overkill for my needs I just rolled my own no-dependencies simpler version that doesn't have fancier stuff like pre-parsed template file caching. I wonder how hard Templ goes.
@rzabcio3
@rzabcio3 4 месяца назад
Underlined whiteline (after "platform"). Literally unreadable. :P Also, I'm stunned how this thing is called "crazy" and "insane" but in fact is the same thing like JSP/JSF from 17 years ago! They also seemed cool at first glance, but turned out to be really, REALLY bad idea, mixing model with view and controller. That's maybe great to some small projects (in terms of code base and dev count), but would be real pain in larger ones. That's actually crazy how IT sector is crazy over the same things and mistakes over and over again! :D
@arnontzori
@arnontzori 5 месяцев назад
Prime hates C#. Prime loves every single C# feature other languages adopt Go figure
@RememberingGames
@RememberingGames 5 месяцев назад
This!
@computerfan1079
@computerfan1079 5 месяцев назад
Fair enough. This is just Blazor pages without C# at this point
@Qrzychu92
@Qrzychu92 5 месяцев назад
actually, I think Prime would have his mind blown if he tried out modern C#. Especially EF Core - to my knowledge, the only ORM that ACTUALLY let's you use the db as if it was just a list of objects.
@apexashwin
@apexashwin 5 месяцев назад
@@Qrzychu92orms are for idiots and C# is a great language but Microsoft is shit, they kill their framework’s every three year to introduce something new and terrible.
@Gornius
@Gornius 5 месяцев назад
Personally I don't like C# for its weird code style guidelines: - Preferring newline '{' instead of endline '{' - Pascal case for different things than class names - Prefixing every interface with 'I" And most importantly - strong connection with Microsoft.
@patricknelson
@patricknelson 5 месяцев назад
Was just thinking: What if they wanted to style their “go” components (those functions) like you can already in Svelte, in a modular and colocated fashion? If they wanted to move away from tailwind for whatever reason (which has all the styles already globally set and just referenced as classes, which works well here). Maybe someday there could be a Go framework (maybe integrated into Templ) that can compile and ship CSS classes in a Svelte-like way too. That’d be nifty. Disclaimer: Am not Gopher.
@perc-ai
@perc-ai 5 месяцев назад
Anthony is alreayd building that rn
@Torudson
@Torudson 3 месяца назад
A bit old, but templ actually does that already. You can create css blocks on the .templ files and it will be compiled and scoped to that specific file (there is probably some way of making them global too, but not sure)
@user-mahaka2002
@user-mahaka2002 4 месяца назад
HTMX it's been a breath of fresh air. For it to take off and become a trend, it just needs to be adopted by a large company. That would create a cycle of interest around the lib, open up job vacancies and spark more interest from the community.
@user-bz8qi6vu4q
@user-bz8qi6vu4q 5 месяцев назад
What building in 30 sec is long ? The building process of our app now takes well over an hour (90% java, 10% JS) with testing. Java artefact generation takes ages...
@jalalle1995
@jalalle1995 5 месяцев назад
The title is a bit misleading, they didn't move from sveltekit to hmtx+go, but rather from sveltekit+go which makes total sense considering they wanted to focus on one language
@ElclarkKuhu
@ElclarkKuhu 5 месяцев назад
I also think he meant Svelte to HTMX because SvelteKit is kinda like Next.js of Svelte.
@macctosh
@macctosh 5 месяцев назад
@@ElclarkKuhu right there is the problem...., why are you selecting a tool that you don't even understand. I kept shaking my head when he said that " we decided to use SvelteKit for our front-end and go (Echo ) for our backend" SvelteKit is the whole deal ( front and backend) if you only what the frontend use svelte!
@erickmoya1401
@erickmoya1401 5 месяцев назад
​@@macctoshgood point here. If you dont know why you need it for, then the issue is the lack of knowledge, not the tool.
@sonkeweis9063
@sonkeweis9063 5 месяцев назад
I guess they used SvelteKit for the routing and its patterns for organizing the frontend files.
@RoyRope
@RoyRope 4 месяца назад
Sounds like nightmare fuel serving the front-end from the backend again like this. We will sit this hype out for a while and see how it goes for others.😅 Can't also imagine all our front-enders switching to this, that will be a steep curve.
@muresanandrei7565
@muresanandrei7565 4 месяца назад
Another ohh this is the best thing this will revolutionize this crap looks wack 🤣
@RoyRope
@RoyRope 4 месяца назад
@@christiansakailearning a complete new language, learning hexagon architecture, learning micro service architecture, learning the whole backend side, yeah that's a steep curve compared to learning Angular and TypeScript...
@RoyRope
@RoyRope 4 месяца назад
@@christiansakai i have 3 years of professional Angular experience, you where saying? I am not implying backend is more difficult btw, maybe read what I state and don't be so insecure...
@RoyRope
@RoyRope 4 месяца назад
@@christiansakai that's my point, most front end devs now don't know how this worked, they have to learn this and a new language and where it has to fit in with the existing backend code. A steep curve that is. Not to say it's more difficult or something, when all back end engineers have to learn all frontend things the same applies.
@RoyRope
@RoyRope 4 месяца назад
@@christiansakai you again fail to address any of my points sir, which is quite remarkable in such a lengthy post.🤣
@Shaheer-xs5os
@Shaheer-xs5os 5 месяцев назад
Never used Go before , but it's time to start a new adventure I guess... was an amazing stream man! WD!
@jwoods9659
@jwoods9659 5 месяцев назад
Go is fantastic I prefer the backend. I wait to do frontend, it can be simple people add too much to the front end.
@DocHudson420
@DocHudson420 5 месяцев назад
@@jwoods9659we get it bro
@zenlanfleek6580
@zenlanfleek6580 5 месяцев назад
@@jwoods9659 Average Go consumer.
@jwoods9659
@jwoods9659 5 месяцев назад
@@zenlanfleek6580 Idk I just started using it and it's great. As far as I have experienced frontend is a mess full of one upums frameworks... Just too much
@nictibbetts
@nictibbetts 5 месяцев назад
It’s the way to Go.
@nineephe
@nineephe 5 месяцев назад
I like to use go+quicktemplate. It is a bit arcane but it is compiled so it is type safe
@datguy4104
@datguy4104 5 месяцев назад
12:22 I could have sworn the html/template already did this. VScode chad, so wouldn't surprise me if it just twerks. Also everything passed into Go's native templates is just parsed into a string anyway.
@georgehelyar
@georgehelyar 5 месяцев назад
Go templates with type safety kind of just sounds like razor
@ASDFG856
@ASDFG856 5 месяцев назад
its the same thing as razor engine
@RememberingGames
@RememberingGames 5 месяцев назад
Yes, but inflencers aren't about fixing real world problem, it's about new framework hype. Htmx has an X in it so its got to be a futuristic paradigm shift.
@psyckojoe
@psyckojoe 5 месяцев назад
GSP's retirement is going well
@bobby_builds
@bobby_builds 5 месяцев назад
Just use the to make the modaels.
@nomadshiba
@nomadshiba 3 месяца назад
16:20 his issue was he mixes sveltekit (a full stack framework) with "go", either choose sveltekit or "go" with something else. sveltekit has use:enhance, he didn't need to proxy anything, all he had to do was using (s) with `use:enhance` and combine it with the `form` html attribute, and do everything with form actions, without any proxy, he doesnt have to manage any state, doesnt have to build a proxy, its just boosting. something like this +page.server.ts const count = kv.value(0); export const load = (async (event) => { return { count: await count.get() }; }) satisfies PageServerLoad; type zSetCount = z.infer; const zSetCount = object({ value: string().regex(/^\d+$/).transform(Number).pipe(number().min(0)) }); export const actions = { async setCount(event) { const form = await parseFormData(await event.request.formData(), zSetCount); const response = { setCount: form }; if (!form.valid) fail(response); await count.set(form.data.value); return response; } } satisfies Actions; +page.svelte export let data: PageData; export let form: ActionData; $: count = form?.setCount.data.count ?? data.count ?? 0; const setCountFormId = uniqueId(); + {count} - OR if you like more reuseable actions export let data: PageData; export let form: ActionData; $: count = form?.setCount.data.count ?? data.count ?? 0; const countUp = uniqueId(); const countDown = uniqueId(); + {count} - and all works even when you disable js on the browser.
@nomadshiba
@nomadshiba 3 месяца назад
oh you like modals? +layout.server.ts import type { LayoutServerLoad } from './$types'; export const load = (async (event) => { const selectedPostId = event.url.searchParams.get('post'); const selectedPost = selectedPostId ? await someDb.getPost(selectedPostId) : null; return { selectedPost }; }) satisfies LayoutServerLoad; +layout.svelte export let data: PageData; {#if data.selectedPost} {/if} still also works without js.
@indrajitsarkar3169
@indrajitsarkar3169 5 месяцев назад
the complexities comes with modals, which should be, is insane.
@blackaccel
@blackaccel 26 дней назад
I don’t get the modals issue, should we not use them?
@rosehogenson1398
@rosehogenson1398 5 месяцев назад
Feels like it would be possible to write a linter that typechecks template/html templates
@gungun974
@gungun974 5 месяцев назад
Again thanks prime to let me escape Typescript Hell. Now I can happily live my life in Go and use and contribute my favorite Go FOSS project. Templ !
@DamonMedekMusic
@DamonMedekMusic 5 месяцев назад
It sounds like they were just using go as most of the logic anyway and they just needed some output so its web compatible. Seemed like they created more of Go API with a front end GUI. Sveltekit is still great as a whole.
@mrbit10
@mrbit10 5 месяцев назад
this reminds me of server-side scripting, seems like tech took a detour. perhaps out of boredom or to solve a problem only to create many more. going back to the late 90's and early 2000s, i created many beautiful web applications without the need for React, Angular and etc... just good old JavaScript and ajax and sprinkles of direct server-side script, I still scratch my head as to how we arrived where we are now.
@liftingisfun2350
@liftingisfun2350 4 месяца назад
Facebook trying to correct itself
@nexovec
@nexovec 5 месяцев назад
"Modern js development" sounds a bit like "modern horse riding" This is basically the stack I'm set on. I'm using gorm for now but I'm thinking of ditching it because it just takes too long to debug SQL with it. Thinking of using clover db for prototyping.
@timvw01
@timvw01 5 месяцев назад
Rust + wasm , lets go
@sirkato7751
@sirkato7751 4 месяца назад
So weird that webdev seems to go back to simply PHP
@yasin-ali
@yasin-ali 3 месяца назад
I was thinking the same thing
@iggydotdev
@iggydotdev 5 месяцев назад
Interesting... This feels like the good old vendor locking situation. If your company is quite big, and every department has different needs, then a headless implementation would be a better choice. Am I missing something? Is this the Backend way to do Frontend? What about security? Web components... good but we are not there yet. Something is missing. Otherwise there will be only WC and not a need to use react, vue, svelte, ... (Also, HTML has a default tag for modal called dialog)
@adjbutler
@adjbutler 5 месяцев назад
HTMX is making frontend DRY again! YAY!
@Chris-se3nc
@Chris-se3nc 5 месяцев назад
Ready to hear about why the old way is the new hotness.
@LoneIgadzra
@LoneIgadzra 5 месяцев назад
Never should have gone away. It's faster to develop, easier on the browser, and simpler to debug. SPA is necessary for some types of UX, but imposes additional complexity. This is obvious, but the entire industry jumped on a cargo cult for a while.
@complexity5545
@complexity5545 5 месяцев назад
The old way never got out of style. Reactjs^^Nodejs running as a server are for the dumb dumbs; it was a facebook and google experiment to hire low skilled programmers to try to do advance stuff. The last 10 years proved that JS on the backend is scientifically stupid. Its the exact opposite of a computer Scientists that uses logic. Most good programmers immediately knew this back in 2012. All the pros have been using [go] for product + server side rendering since Go came out.
@RememberingGames
@RememberingGames 5 месяцев назад
@@LoneIgadzra Then just use Razor, JSP, PHP, Go, etc... The paradigm never gone away, simply, influencers needs to make money. So there got to be a new thing every week, even if that is reinventing the wheel everytime. Being excited for htmx is like being excited by the innovation of the pink sauce lady. All marketing, no substance. Saying stuff like PHP bad, but htmx is revolution makes me even question the sanity of people saying that. And I don't even like PHP...
@emcassi_
@emcassi_ 5 месяцев назад
Today's a good day to use HTMX
@jdawgforealz
@jdawgforealz 5 месяцев назад
Prime when are you gonna switch to qwerty layout? I recall a tweet sometime ago saying you were gonna migrate over. Waiting to see your sweet vim shortcuts in qwerty format.
@oussamasethoum1665
@oussamasethoum1665 4 месяца назад
Am building with svelte and I understand his point of view, server side rendering requires you to use javascript on the backend which doesn't give you the benefit of go performance
@mfpears
@mfpears 5 месяцев назад
Please no please no please no something went wrong on this timeline
@s_onefps
@s_onefps 5 месяцев назад
Hey! Love your videos that contains Go 😅. Keep it up! Hopefully we see more of it
@Comeyd
@Comeyd 5 месяцев назад
@ThePrimeTime For rust, you should really try and give Poem and Maud a try. Maud is very good, it’s html entirely as macros, and poem is, well, frankly, beautiful. I highly recommend it.
@ArkhKGB
@ArkhKGB 5 месяцев назад
templ: using your main language in your templates. Ok, so 25 years later you're still reinventing php?
@bacon-SG
@bacon-SG 5 месяцев назад
Kinda, but keep bashing PHP because of MEME
@Comeyd
@Comeyd 5 месяцев назад
Honestly, yeah, that’s what I thought when they both said that! “Looks like PHP with extra steps” And I haven’t been serious about PHP since PHP 5!
@erickmoya1401
@erickmoya1401 5 месяцев назад
21:15 what are you using to take so long?
@Wielorybkek
@Wielorybkek 5 месяцев назад
I don't understand how a FE framework would force you to use JS on the BE? between them is either REST or GraphQL, does not matter what you use
@gabrielstellini
@gabrielstellini 5 месяцев назад
Forced might be the wrong word. But when you use different languages, you do usually end up writing things twice, like types and validation. If js is on the backend too, chances are you could just reuse the same validations and types. And yes, there are tools to automate type generation across languages/openapi type generation, but it is almost never a perfect reflection.
@ivanjermakov
@ivanjermakov 5 месяцев назад
This is not a problem if you use pure CSR or pure SSR. Once you do both (hydration) you have duplicate logic across client and server. It is a lot simpler to write code once (usually in JS/TS) and framework will use it properly in both runtimes.
@Wielorybkek
@Wielorybkek 5 месяцев назад
@@ivanjermakov how is hydration duplicating logic? I admit I've never used it myself but from what I've seen it's usually a matter of config on the FE framework side
@ivanjermakov
@ivanjermakov 5 месяцев назад
​@@Wielorybkek basically SSR workflow: 1. Browser requests the page 2. Server returns a page 3. Browser shows the page to the user (first contentful paint) and requests js bundle 4. Server returns JS 5. Browser loads and parses JS, update DOM client-side (hydration) and provides interactivity (time to interactive) You see how two different places need to know how to render the page (server when sends initial response and client during hydration). This approach takes best from both worlds (fast FCP and interactivity of SPA), while sacrificing application complexity. Theo t3-gg has a good video on this topic called "Do you REALLY need SSR?".
@aldencabajar6781
@aldencabajar6781 5 месяцев назад
​@@gabrielstellini you could doesn't mean you should. Reusing models will get you in to a world of pain with changing business requirements.
@zabialy2919
@zabialy2919 5 месяцев назад
Is HTMX production ready? And are there any major drawbacks of using it? I currently have a Spring Boot backend and a NextJS frontend, where I basically only do the rendering. I was also thinking about switching to MVC with HTMX, as from what I see it would be faster to work with than writing all the API types 2 times.
@kristun216
@kristun216 5 месяцев назад
different way to skin a cat. it's preference based. i would dive into it first before you start picking it, you may find things you don't like. in your scenario, you would have to reimplement a lot of your backend to have HTMX controllers rendering components. that's a lot of work. i would weigh the options before you commit to anything.
@erickmoya1401
@erickmoya1401 5 месяцев назад
MVC?
@zabialy2919
@zabialy2919 5 месяцев назад
@@erickmoya1401 I ment instead of having NextJS consuming an API, having my Backend returning the view basically.
@zabialy2919
@zabialy2919 5 месяцев назад
@@kristun216 Yeah, sounds smart. Thanks :)
@doublekamui
@doublekamui 5 месяцев назад
if you just build a simple website that request api and display the result, yeah it will do the job. but if you build a complex frontend like video editor, photo editor, game, i think pick a full frontend framework would be the better choise, and then it help you to manage that complex code by writing in component based concept
@alekseykostyuk3806
@alekseykostyuk3806 5 месяцев назад
Finally this JS nonesence is fading away. I hope htmx becomes more widely accepted, so that Teams can finally remove this FEBE barrier. It's a complete game changer. We'll get more of better software.
@suikast420
@suikast420 3 месяца назад
That's looks like jsp in java. Am I wrong. I don't realy like jsp. The htmx stuff is shoot to the past isn't it or did I misunderstood something?
@Macintoshdfr
@Macintoshdfr 5 месяцев назад
Htmx is cool to use, very simple. It seem very similar to JSP in J2ee with async process to get the rendered view. It's very nice to not use javascript and JSON to refresh the data of the view to get the same result
@RememberingGames
@RememberingGames 5 месяцев назад
You do realize htmx is a javascript lib right?
@_bradleystrider
@_bradleystrider 5 месяцев назад
@@RememberingGames that's an incredibly reductive point but ok
@Macintoshdfr
@Macintoshdfr 5 месяцев назад
@@RememberingGames I realize , i have nothing against javascript. It's just a fact you don't need to write javascript... where is the problem in my sentence...
@RememberingGames
@RememberingGames 5 месяцев назад
@@Macintoshdfr Nothing with the statement per se. I'm just tired of "new" tech that does what I was doing in 2003 and everybody thought it sucked. All of this is all cool for a small newbie tutorial but I can garantee you, as soon as you'll hit a point where you need special logic, the result will be a mess. I've gone through this countless times. Makes me sad to see how little is remembered from the errors of the past and we are bound to repeat them endlessly. So yeah, your statement is 100% factually right. The problems are what happens beyond this statement though.
@doublekamui
@doublekamui 5 месяцев назад
​@@Macintoshdfrthen build a video editor website or photo editor website or game website, you will realize that htmx is only for building frontend when you just want to do simple api request and display the result :))
@lukasmolcic5143
@lukasmolcic5143 5 месяцев назад
no types is the only reason I am still not down with htmx for larger projects
@aghileslounis
@aghileslounis 4 месяца назад
When the Top G validates your work 😎
@_MB_93
@_MB_93 5 месяцев назад
php lazavel did this with Blade template engine like a decade ago
@yungtube7848
@yungtube7848 3 месяца назад
But that was php 🤢
@doublekamui
@doublekamui 5 месяцев назад
for building a simple website that request api and display the result, yeah it will do the job. but if you build a complex frontend like video editor, photo editor, game, i think pick a frontend framework would be the better choise, and then it help you to manage that complex code by writing in component based concept and if our backend is consumed by mobile too, we need to determine that if the request come from website tyen return html, if the request come from mobile then return json, if the request come from dekstop app? 🤔🤔
@gani7112
@gani7112 18 дней назад
the only problem is react, angular, svelte has a lot of component libraries which wont be available of we use go+templ+htmx
@ZiggyJFox
@ZiggyJFox 4 месяца назад
Still not convinced to how this would work with complex front ends. I think I am going to prove myself wrong.
@egzakharovich
@egzakharovich 21 день назад
4:20 Yeah. Imagine the feeling, you writing your backend with Python, Go or Rust. But you have to use NodeJs for frontend... It sucks. That's why I searching vids about HTMX, to learn about alternatives to Node and NPM stuff.
@daltonyon
@daltonyon 5 месяцев назад
Everyday I'm more excited with go lang
@MainBeta
@MainBeta 2 месяца назад
Some people have forgotten that client-side rendering + json was invented to unify backend for web and mobile applications?
@jessequartey
@jessequartey 5 месяцев назад
Immediately there is a notification over 1000 people said "Yes i want to listen to this guy talk."
@mornwind318
@mornwind318 4 месяца назад
The mention of mobile apps is so hilarious because all we try to do on the web is have the same experience that native apps do, and we do a goddamn good job at it with very little code and tooling that isn't as bad as Xcode and Android Studio. "It was better before" is like saying that all we do on the web is just displaying API results, but it is not. You love handling sessions on the backend? I don't. Complex UI require complex states. We aren't all writing clones of Wordpress. Just trying to avoid using any sort of global state machine to handle cross feature states, mixing in navigation and shortcuts and so on, is enough to make me cry in pain.
@aazzrwadrf
@aazzrwadrf 4 месяца назад
how does hot reloading work? ui without hot reloading is insane.
@joelv4495
@joelv4495 4 месяца назад
19:24 That has always triggered me so hard. It's like "Why couldn't we have just all settled on a .config directory or something??". I've tried adding config to package.json where possible, but eventually I just gave up and put a massive files.exclude block in VS Code's settings.json file...
@Summersault666
@Summersault666 5 месяцев назад
Django 5.0 + htmx
@rachidboudjema8807
@rachidboudjema8807 Месяц назад
Django 5 + Htmx + Hyperscript... Never looked back
@iampuff7
@iampuff7 4 месяца назад
I like to think of HTMX as html templating but on the frontend
@fuzzy-02
@fuzzy-02 2 месяца назад
I learned vanilla front end and some php for backend in my uni courses. Are these templates like making a .php file and just include-ing it in other places? And any advice you can give? So far I built a basic project for the course but it ended up as a spaghetti mess of .php files and juggling data with session and figuring what carries over after a page refresh and what not. In the end I felt likr backend and frontend became one elden ring abomination. I concluded that Id rather bash my head to solve logical backend problems then trying to untangle frontend frameworks. Tho im not fat, nor have a fedora or uwu keycaps
@su1cedek
@su1cedek 5 месяцев назад
It finally happened
@GreyDeathVaccine
@GreyDeathVaccine 3 месяца назад
So Templ is basically a reinvented PHP? I love HTMX BTW.
@TheNewton
@TheNewton 5 месяцев назад
19:18 just config hell anxiety things ♾.
@jeremybuckets
@jeremybuckets 5 месяцев назад
MVC stands for Modals, Very Cool!
@pyrocentury
@pyrocentury 5 месяцев назад
How many of you using htmx are mostly working BE?
@Ultraporing
@Ultraporing 5 месяцев назад
Soo here are a ton of web devs. I'm from desktop and embedded development and like to ask, is there still a way to create a proper Ogl or dx game within browser, like at one time unity supported? I'm looking for a way to host a game in the web without the user having to install anything, and letting me use shader and stuff like that. Does anybody know how to do something like that these days?
@RememberingGames
@RememberingGames 5 месяцев назад
Webassembly is your answer. Doom was even compiled from the C source code to webassembly and it runs in the browser. Pretty amazing stuff.
@miracleinnocent2649
@miracleinnocent2649 5 месяцев назад
I knew The most Backend Language Programmers that will adopt HTMLx is Golang devs
@ericgarza283
@ericgarza283 2 месяца назад
6:35 is exactly why I hate this usage of JSON
@kyjo72682
@kyjo72682 4 месяца назад
Feels like endless reinventing of the wheel.. ASP was released when? In 1996? And Java/JSP had most of this by 1999.
@liftingisfun2350
@liftingisfun2350 4 месяца назад
Prime is so meaty now he used to he a big scrub but hes like an extra large filet mignon... not much fat but a lot of tender soft meaty value. It's a pleasure to see.
@HalfMonty11
@HalfMonty11 5 месяцев назад
idk man, I really don't see a draw... Sveltekit has already got me developing the front and backend at the same time and it's all just normal js/ts and html stuff which is fast and easy. If I needed more performance out on the backend, there are plenty of tricks you can do before throwing away your whole tech stack. I get in his case he already had lots of code in GO, then sure, otherwise if you are starting from scratch, Sveltekit makes way way more sense.
@jeffreysmith9837
@jeffreysmith9837 Месяц назад
More maintenance. You will need to upgrade to svelte 5 for example because in a couple versions the old syntax will be deprecated. And who knows what else in the future. Htmx is a simple js file that will live forever
@vormavius
@vormavius 4 месяца назад
a go legend reacting to a go legend
@doesitmatter
@doesitmatter 5 месяцев назад
13:55 is that what react users be like once they discover proper frameworks? Wait cant you do that in svelte? 🤔
@emokjulev9936
@emokjulev9936 2 месяца назад
looks like that c# for front ned
@thegrumpydeveloper
@thegrumpydeveloper 5 месяцев назад
All I know is yavascript sounds way better than the JavaScript that I use and will definitely be adopting that pronunciation without even npm installing it.
@shaded4438
@shaded4438 4 месяца назад
I imagine this htmx would be very hard to build around highly complex business logic But I've not used it yet so idk; however this dudes site looks super basic so you could write it in anything from what I can tell there is barley a need to use any libraries, could even get away with pug or something
@mornwind318
@mornwind318 4 месяца назад
HTMX Is for scrubs who can't write JavaScript 101.
@athinodorossgouromalliis9021
@athinodorossgouromalliis9021 5 месяцев назад
Antonygg is my fav golang personality he codes live and gives good content. Though he bases you and theo in this video 😅
@cristophermoreno2290
@cristophermoreno2290 5 месяцев назад
It's a BRRRRRRRREEZE
@dinaroid9357
@dinaroid9357 5 месяцев назад
my man Anthony GG! The strongest high value engineer on the yt
@nefrace
@nefrace 5 месяцев назад
Don't forget about sipping margarita on the beach
@adamtak3128
@adamtak3128 5 месяцев назад
a homophobe and a transphobe. maga brained idiot. fuck him.
@flflflflflfl
@flflflflflfl 5 месяцев назад
Check out Tsoding, Biskwit, Low Level Learning, Engineer Man, Andrej Kaparthy and of course Terry Davis! Then throw in some Joscha Bach if you want to get philosophical.
@dinaroid9357
@dinaroid9357 5 месяцев назад
@@flflflflflfl but how much they can squat?
@flflflflflfl
@flflflflflfl 5 месяцев назад
@@dinaroid9357 about three fiddy
@phillipkenoyer
@phillipkenoyer Месяц назад
I'm switching from Rails to Go+Templ+HTMX.
@Woeden
@Woeden 5 месяцев назад
So based
@dromedda6810
@dromedda6810 5 месяцев назад
GoTH Stack seems like a real winner ngl..
@spaceyraygun
@spaceyraygun 5 месяцев назад
red commits are the best commits.
@piotrpaczua8260
@piotrpaczua8260 3 месяца назад
Seems like reinventing aspnet razor pages but in go xD
@sachahjkl
@sachahjkl 5 месяцев назад
Hey that's literally me
@SeanCallahan52
@SeanCallahan52 5 месяцев назад
Honestly, go error handling doesn’t even bother me. I’m used to it now but if you’re not, it is a little much at first.
@hayyanhami6826
@hayyanhami6826 4 месяца назад
I was also watching comments... "Ciansweeney" had a point!
Далее
From React To HTMX
40:01
Просмотров 288 тыс.
Rich Harris Teaches ThePrimeagen SvelteKit
50:56
Просмотров 169 тыс.
Subway Surfers вернулась к классике
00:34
9 Months with GPT, Can I Fire My Devs Now?
20:53
Просмотров 177 тыс.
HTMX IS INSECURE (XSS) | Prime News
19:58
Просмотров 112 тыс.
Jonathan Blow Made Me Quit My Job | Prime Reacts
24:28
Просмотров 159 тыс.
Why Learn HTMX?? | Prime Reacts
21:29
Просмотров 116 тыс.
Why Svelte is BETTER Than React | Prime Reacts
11:28
Просмотров 162 тыс.
Why Go Or Rust On New Projects
10:32
Просмотров 157 тыс.
HTMX for Impatient Devs
8:33
Просмотров 38 тыс.
So You Think You Know Git - FOSDEM 2024
47:00
Просмотров 923 тыс.
ОБЗОР Pixel 8a | iPhone от ГУГЛ👀
0:33
Просмотров 19 тыс.