HTMX: The Game-Changing Alternative to React

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ต.ค. 2024

ความคิดเห็น • 254

  • @FirdausAziz
    @FirdausAziz ปีที่แล้ว +77

    With HTMX and HyperScript (from the same guy that created HTMX) we went from Django + Django REST Framework + Vue, back to just Django. The built-in DTL (Django Template Language) can already serve 80% of our needs. HTMX and HyperScript covers the balance 20%,

    • @MrEnsiferum77
      @MrEnsiferum77 ปีที่แล้ว

      U need CQRS on the frontend...

    • @seanfilimon
      @seanfilimon 10 หลายเดือนก่อน

      Bro why you using Django god

    • @seanfilimon
      @seanfilimon 10 หลายเดือนก่อน

      Your missing out on performance my mah

  • @marghidanu
    @marghidanu ปีที่แล้ว +37

    This is the most complicated simple example for htmx I’ve seen so far.

    • @jherr
      @jherr  ปีที่แล้ว +2

      Thank you! 😀

    • @dagorgonzoladotco
      @dagorgonzoladotco ปีที่แล้ว +5

      Right. Instead of Astro a better pick would have been PHP or Python IMO...

    • @anashe5417
      @anashe5417 9 หลายเดือนก่อน

      ​​@@dagorgonzoladotco I don't think so, the most of the viewers from Jack are react developers or those who are sticked to a js framework. He uses astro because is similar to any of those frameworks but with better performance. Anyways, who's still using php

    • @genechristiansomoza4931
      @genechristiansomoza4931 9 หลายเดือนก่อน

      ​@@anashe5417 Many devs are still using php. Do you have problem about it?

    • @steven11101010
      @steven11101010 7 หลายเดือนก่อน

      @@anashe5417Most of the web. WordPress alone accounts for 43% of all websites.

  • @ryanleemartin7758
    @ryanleemartin7758 ปีที่แล้ว +142

    This seems like a very interesting course correction from all the insane framework complexity we've convinced ourselves is necessary for everything.

    • @FunctionGermany
      @FunctionGermany ปีที่แล้ว +18

      don't let it fool you. you cannot hide complexity. good frontend apps are only complex when they implement complex logic. pushing that to the server with any tool whatsoever doesn't remove complexity. it might even add complexity if your "frontend on the backend" tooling isn't on par with what we have with browser dev tools.
      not saying htmx is bad but i think stuff like it or hotwire are more niche than most people think.

    • @ryanleemartin7758
      @ryanleemartin7758 ปีที่แล้ว +2

      @@FunctionGermany I generally agree but As far as I can tell what you are describing is not htmx.

    • @FunctionGermany
      @FunctionGermany ปีที่แล้ว

      @@ryanleemartin7758 what's the purpose of htmx then, if it's not reducing JS on the client side?

    • @FunctionGermany
      @FunctionGermany ปีที่แล้ว +1

      @@Ollinho12 i mean there are indeed a lot of moving parts with any SPA but you can definitely make it very simple if your use-case allows it. for example you can mount a react (or other) app yourself instead of using a meta-framework like next. you can use esbuild and only transpile JSX to JS to keep it simple and use ESM in the browser and not bundle. you can use a classic CSS component library like bootstrap and not use CSS-in-JS.
      that will make the project very transparent. as soon as you use htmx, you need some sort of templating and rendering on the backend instead of just an API like you can do with an SPA.

    • @cristianbilu
      @cristianbilu ปีที่แล้ว +8

      @@FunctionGermany I don't think i agree, i think it's easier to have a back-end framework that handles templating and rendering ( You get that out of the box with all server-sided frameworks like Laravel, Rails, Symfony, Django etc... ) than creating an SPA + an API on the side. Let's not forget that the majority of the frameworks i mentioned include already a lot of extra features like Authentication, Queues, Caching that you don't need to worry about. Also you reduce duplication a lot, since all the logic is written on the server, like validation for example witch is a big part of all the apps, you now need to write it only once on the server and boom, it work in the front-end as well with almost 0 fuss

  • @Christopher-lx4ud
    @Christopher-lx4ud ปีที่แล้ว +39

    what i like about htmx is that you do things like form validation only once since its all backend driven and where you have a dedicated frontend and dedicated api you mist essentially do validations twice,but with something like HTMX its essentially only once.

    • @laughingvampire7555
      @laughingvampire7555 ปีที่แล้ว +6

      well, "validation" in the front-end is more about handrails for the user and make the input obvious and easy for them

    • @MachineYearning
      @MachineYearning ปีที่แล้ว +2

      There's nothing forcing you to do validation in JavaScript nowadays. It's just to provide faster feedback on invalid form inputs and avoid an extra round trip to the server. HTMX doesn't change that

  • @j946atFIVEFOUR88AA
    @j946atFIVEFOUR88AA ปีที่แล้ว +71

    pretty funny how web dev is slowly going full circle back to php and ajax 😂

    • @BlurryBit
      @BlurryBit ปีที่แล้ว

      haha exactly 😂

    • @overPowerPenguin
      @overPowerPenguin ปีที่แล้ว +6

      PHP is not dead is PHP is not dead is PHP

    • @vasiovasio
      @vasiovasio ปีที่แล้ว +1

      PHP for Life! ❤❤❤

    • @VirtusLang
      @VirtusLang ปีที่แล้ว

      Thankfully, because I'm sick of npm install and all it's 998383 packages, plus 6 months of courses to finally make a login page.
      Before you just need JQuery, Bootstrap and a quick read on docs to create a whole dashboard.

    • @zainsyed9811
      @zainsyed9811 9 หลายเดือนก่อน

      Bring PHP and Flash back!! Good ol days!!

  • @LarryGarfieldCrell
    @LarryGarfieldCrell ปีที่แล้ว +29

    Note: Nearly all PHP template engines today also auto-escape values. Using raw PHP as the template engine is not recommended these days, precisely for the security reasons you mention. 🙂

    • @u9vata
      @u9vata ปีที่แล้ว +1

      Yes... its worth noting htmx has no security flaws whatsoever - you can say php rawly is not secure but that is well known.... So easy to make it never XSS if you use any real tool whatsoever...

    • @Poleriwi
      @Poleriwi 11 หลายเดือนก่อน +1

      @@u9vata what are you smoking php is secure

  • @FagnerBrack
    @FagnerBrack 10 หลายเดือนก่อน +2

    I've been doing this for years, only with plain HTML. The only difference is that the server call uses some custom code inside HTMX instead of the browser native request mechanism that binds into the user's OS, which is much more efficient than a client-initiated request from HTML. Much more performance and maintainable than 99% of React and Angular Apps I've seen in the wild.

  • @Necessarius
    @Necessarius ปีที่แล้ว +8

    Not only PHP needs sanitization; any other language like Python, Node.js, etc., requires sanitization as well. If you use a framework, you may already have built-in sanitization. So be careful with your choice of words.

    • @jediampm
      @jediampm ปีที่แล้ว +1

      Hi, I wrote here similar thing, go to find what he respond to me. LoL.
      He mention PHP because one of the videos that he compare Next with RSC vs PHP, in PHP side he forgot to sanitize / escape html, because he didnt use a php fn to do it and he choose not to use a PHP framework. And people start make posts saying that he forget to sanitize PHP. LOL.

  • @abdelazizabdelioua890
    @abdelazizabdelioua890 ปีที่แล้ว +15

    I remember when I tried this before it got the hype now.
    Happy to see its growing

    • @skyhappy
      @skyhappy ปีที่แล้ว

      I tried it a 1.5 years back with Alpine as well...funny how some things just pop off

  • @mma93067
    @mma93067 ปีที่แล้ว +4

    What we really need is support for html documents partials natively on the browser. We’ll go back to old school full-ssr again 😂

  • @TomNook.
    @TomNook. ปีที่แล้ว +16

    Here we go again

  • @Plrang
    @Plrang ปีที่แล้ว +16

    That's how things should look, I hate all those overgrown frameworks

  • @simonnjoroge933
    @simonnjoroge933 ปีที่แล้ว +2

    Now this is the literal definition of Over Engineering, damn. Though, it's a nice video. 👍🌟

  • @amansarma417
    @amansarma417 ปีที่แล้ว +23

    The game changing alternative to react is Svelte or Solid js
    I have been using react and now i just built a project in svelte i felt like it was so much i had control over my states its just made it so easy

    • @skyhappy
      @skyhappy ปีที่แล้ว +1

      What was the project about

    • @amansarma417
      @amansarma417 ปีที่แล้ว +1

      @@skyhappy a drag and drop with gsap added

    • @JiggyJones0
      @JiggyJones0 ปีที่แล้ว

      I also rebuilt one of my Nextjs projects using Sveltekit and I loved it. I'd recommend it over Nextjs

    • @matthiaslangbart9841
      @matthiaslangbart9841 ปีที่แล้ว +1

      HTMX makes it even easier because with HTMX all the state is in the HTML, not in Svelte's bundle.js. Rich Harris, the father of Svelte, said it himself: “The best code is the code you do not write.”

    • @amansarma417
      @amansarma417 ปีที่แล้ว

      @@matthiaslangbart9841 yet you cannot achieve some of the SPA performance. Indeed HTMX is really good.

  • @cipriancozma2783
    @cipriancozma2783 ปีที่แล้ว +3

    Great content. A quick question. You said that React is an imperative model. Is it true? I knew that React is declarative...

    • @dertuman
      @dertuman ปีที่แล้ว

      I think he made a mistake there, because previously he said it's declarative vs htmx's imperative.

  • @sujeet4410
    @sujeet4410 ปีที่แล้ว +2

    which zsh theme are you using? looks really cool.

  • @ncubica
    @ncubica ปีที่แล้ว +2

    Who else remember back in early 2000's aspnet had the "ajax control toolkit" pretty much what htmx it is doing, nothing new people. As always used the technology that solved the problems of your users that what actually matters.

  • @AK-vx4dy
    @AK-vx4dy ปีที่แล้ว +7

    It feels like php when it started as fragments of logic inside html

    • @jherr
      @jherr  ปีที่แล้ว +6

      PHP + HTMX is a solid pairing.You just need to sanitize the HTML server side (which you should be doing already). Or use a framework like Laravel that is doing that.

    • @AK-vx4dy
      @AK-vx4dy ปีที่แล้ว +2

      @@jherr Of course.
      But i have very old times on my mind, when
      php was mostly inserts in html and "magic" happened ;)

    • @VincentUchennaOk
      @VincentUchennaOk ปีที่แล้ว +1

      ​@@jherr I think you should do a video about Laravel (you might just like PHP). React, Next, Django, etc are just similar frameworks. Try Laravel 😂

  • @cnikolov
    @cnikolov ปีที่แล้ว +6

    Tailwind was introduce to remove the need to write any css, and its the most popular utility library there. combining it with htmx it means that you never have to leave your markup code its a cool concept but personally I like to write my js :)

  • @JLarky
    @JLarky ปีที่แล้ว +5

    That extra CSS is there from tailwind Integration, so just don't use it :) and install tailwind manually.
    As for returning fragments, I've heard talk about basically giving api of renderToString (or stream) to astro components soon, so you could use that for fragments

    • @lifedrawing1
      @lifedrawing1 ปีที่แล้ว

      Do you mean installing as a postCSS plugin?

    • @JLarky
      @JLarky ปีที่แล้ว +1

      @@lifedrawing1 yes, I have an article "A comprehensive guide to customizing Tailwind CSS in Astro" going into more detail on the approach

    • @lifedrawing1
      @lifedrawing1 ปีที่แล้ว +1

      @@JLarkythank you!

    • @aggbits
      @aggbits 10 หลายเดือนก่อน

      any update about this? did they add support for fragments?

    • @JLarky
      @JLarky 10 หลายเดือนก่อน

      @@aggbits yes, you can use "export const partial = true", again, if you don't use global integrations, it doesn't matter :) but in case if you do you'll need it

  • @lifedrawing1
    @lifedrawing1 ปีที่แล้ว +1

    Thank you for a very inspirational video. I wondered if the issue with the clean HTML response was only in development? I've heard reports that the responses clean up in production...? Thank you again. I've embraced this stack.

    • @jherr
      @jherr  ปีที่แล้ว +1

      I don't have the answer to that, what I can say is that the Astro folks seem to be deeply involved in getting a non-hacky solution going. So that's great.

  • @eduardoolat
    @eduardoolat ปีที่แล้ว +10

    I think astro is not the best way to demonstrate the power of htmx, maybe you should go simpler maybe with go, php or nodejs server, but great video!!!

    • @marcelk6514
      @marcelk6514 ปีที่แล้ว +5

      Agree, as we could see astro lays bricks in your way in multiple occasions, so it doesn’t seem to be a good tool for the job

  • @plantparty
    @plantparty 11 หลายเดือนก่อน +2

    Astro has HTML partials now so you can avoid needing to strip the HTML/CSS.

  • @mqix3741
    @mqix3741 ปีที่แล้ว +2

    respect for showing this.

  • @spondoolie6450
    @spondoolie6450 6 หลายเดือนก่อน +1

    A 16.5kB 500-line IIFE is taking over React ... love it.

  • @andTutin
    @andTutin ปีที่แล้ว +131

    jesus christ

    • @Ctrl_Alt_Elite
      @Ctrl_Alt_Elite ปีที่แล้ว +8

      😂 never related to a comment more in my life 💀

    • @abdulramonlasisi3385
      @abdulramonlasisi3385 ปีที่แล้ว +2

      Relatable

    • @nicjrichdev
      @nicjrichdev ปีที่แล้ว +5

      That’s Jason Bourne?

    • @randerins
      @randerins ปีที่แล้ว +11

      Next week: HTMY replacing Angular

    • @andTutin
      @andTutin ปีที่แล้ว +2

      @@nicjrichdev JSON

  • @judostuff9233
    @judostuff9233 ปีที่แล้ว +3

    Very cool tutorial. @jherr I wonder if in this case an implementation with web sockets would have been good enough.

  • @crowdozer
    @crowdozer ปีที่แล้ว +3

    Tried out htmx w/ laravel and a tiny bit of jquery. It was a bit of a throwback but it was also very easy and fun

  • @CristianKirk
    @CristianKirk 10 หลายเดือนก่อน +2

    Don't really know HTMX, but anything is better than React.

  • @AustinJohnson-zv5hy
    @AustinJohnson-zv5hy ปีที่แล้ว

    Super happy to see jack cover this topic 🌝

  • @laanithchouhan2933
    @laanithchouhan2933 ปีที่แล้ว

    Hey jack ! I would like to know if you use any external terminal app or is it default mac terminal setup. I like it a lot. But I use windows. Please recommend me something like that..

    • @jherr
      @jherr  ปีที่แล้ว

      I currently use Tabby along with oh-my-zsh oh-my-posh with the atomic theme and fig

  • @avi7278
    @avi7278 ปีที่แล้ว

    Jack, hi there. Could I ask you what character you are using in your zsh prompt on the second line? (or series or characters?)

  • @RobertoFabrizi
    @RobertoFabrizi ปีที่แล้ว

    How does htmx help create microfrontends? does it support returning blocks of html that have a shadow dom and are fully styled without having to import for example tailwind in the container html?

  • @MattFee-f7s
    @MattFee-f7s ปีที่แล้ว +1

    do you share you dotfiles anywhere? really like the look of your terminal

    • @lxsm3123
      @lxsm3123 ปีที่แล้ว

      I was wondering the same thing.

  • @tolgask2812
    @tolgask2812 ปีที่แล้ว

    What is the font ? Great content !

  • @JLarky
    @JLarky ปีที่แล้ว +2

    Nice to see you cave to HTMX as well 😂

    • @jherr
      @jherr  ปีที่แล้ว +4

      I like making apps. I stopped falling in love with specific technologies many moons ago. I think React still has a very solid place in highly interactive apps. I'm just glad we are starting to re-think using React for mostly static/less interactive applications.

  • @MeditationRevolution
    @MeditationRevolution ปีที่แล้ว +1

    Please share how you set your Terminal to look so good

  • @arhabersham
    @arhabersham ปีที่แล้ว +1

    It seems like, if something is taking over developers’ jobs, it will be tech like this, not AI

  • @petersouthwell5971
    @petersouthwell5971 11 หลายเดือนก่อน

    Server side isn't a new thing guys. MVC, struts, Blade, JSP, ASP MVC, etc. etc. etc. C'mon.
    Just what fullstack needs. More shit that does the same thing to learn. YAY. I love learning new tech so I can throw it on my resume with the 14 other UI frameworks I have to mention on a resume. And one more KEY word I get to explain to recruiters.
    Server side.. HTML Fragments. Man.. I have this new invention its incredible. I put my chocolate in this peanut butter and.. WOW. Resus Peanut butter cup? Nope... HTMX The "new" server side UI framework.

  • @christerjohanzzon
    @christerjohanzzon ปีที่แล้ว

    This channel is probably one of the best channels I know for development things. Great content!

  • @justbearcause
    @justbearcause ปีที่แล้ว +2

    Pure insanity

  • @gustavofelisberto2244
    @gustavofelisberto2244 ปีที่แล้ว +1

    I hope the "The No-BS Solution for Enterprise-Ready Next.js Applications" will cover I18N with translated urls / localized pathnames. Specially with app folder. I18N is a crucial piece for i18N and SEO. It will be covered?

    • @jherr
      @jherr  ปีที่แล้ว +1

      I can't guarantee that, but you aren't signing up to buy it just by signing up for the newsletter.

    • @gustavofelisberto2244
      @gustavofelisberto2244 ปีที่แล้ว +1

      @@jherr I hope it will be covered :-), mostly courses lack i18n with Next.js from udemy to front-end masters. Would love to see your take on this. Thank your for the feedback, content creation and time

    • @jherr
      @jherr  ปีที่แล้ว +1

      @@gustavofelisberto2244 BTW, I completely agree. In large e-Commerce settings infrastructure elements like i18n and personalization are 100% required, but there is very little enterprise-grade information on it out there.

  • @johnsmith1789
    @johnsmith1789 ปีที่แล้ว +1

    Can someone who has made a large project with HTMX vs React answer this: if you have a large application with many pages, and you want to keep it a fluid SPA, won't you have to keep everything on one .html file, and therefore wont it get gigantic? where in react at least you can break up components and import to keep files more maintainable
    Please share

    • @froreyfire
      @froreyfire ปีที่แล้ว

      You can serve full pages as in the old days, but add hx-boost=true to you body. Then all links to your pages will be replaced with AJAX calls and only the body replaced, which will feel much snappier and much more like a SPA, while it really isn't.

  • @walterlol
    @walterlol ปีที่แล้ว +2

    I really hates this :( great content!

  • @savire.ergheiz
    @savire.ergheiz ปีที่แล้ว +4

    Its the same. Its just delegating the process to the htmx lib 😂
    Also with these generalization of things there will be limits where we will got stuck sooner or later

  • @galaxygur
    @galaxygur ปีที่แล้ว +1

    Oh awesome just wanted to ask about potential of Astro + Htmx when starting watching this video, and then just heard that's exactly what you doing

  • @heyjordn
    @heyjordn ปีที่แล้ว

    We are so back

  • @jawadtkd8577
    @jawadtkd8577 ปีที่แล้ว +2

    hey can you plz tell name of your vscode theme 😊

  • @h-mix-v
    @h-mix-v ปีที่แล้ว

    What is it that makes React appealing, is it not the use of JSX syntax. If that could be baked into the DOM we would not need so march convoluted code.

  • @rajm.5819
    @rajm.5819 ปีที่แล้ว +2

    14Kb not 34Kb.

  • @johnpeterson8493
    @johnpeterson8493 ปีที่แล้ว +1

    thanks!

  • @exercitus8535
    @exercitus8535 ปีที่แล้ว +7

    Something about managing api calls in html feels wrong to me.

    • @_diversable_
      @_diversable_ ปีที่แล้ว +5

      You must abhor HTML forms, then!

  • @djaalabahmed2038
    @djaalabahmed2038 ปีที่แล้ว +1

    Great 👍👍, thank you

  • @astartup
    @astartup 9 หลายเดือนก่อน

    I'm confused how HTMX is an "alternative" to React. What templating language do you use with HTMX? Liquid? Yes JSX is not React, but it came from React. What about C++ HTMX?

    • @jherr
      @jherr  9 หลายเดือนก่อน

      What do you mean that it "came from React"? "Templating" happens on the server. So anything you want to use on the server; PHP, Go, Rust, etc. is fine. I use Astro for this because it JS/TS based, and that's the language that most folks watching this channel know. But you don't have to use Javascript or Typescript on the server to use HTMX. It can literally be anything that can serve HTML.

    • @astartup
      @astartup 9 หลายเดือนก่อน

      @@jherrI just don't understand how you render HTML on a server without a templating engine like Liquid or JSX. Even though you're returning HTML, you can still use JSX as a templating engine. Do you useState, no, but can I parse RSS feeds on the client without some sort of State? No. I require some sort of State, could be chrome.local.storage or indexeddb, but React still would work with HTMX in this scenario.

    • @jherr
      @jherr  9 หลายเดือนก่อน

      @@astartup In this case Astro is doing the templating. It does a good job with that. I'm sorry I don't follow the rest when it comes to RSS. I know what RSS is, and I know what state is, useState, etc. But I don't understand your example application. Are you trying to create an RSS reader?

    • @astartup
      @astartup 9 หลายเดือนก่อน

      @jherr I can't tell you exactly what I'm doing, but I need to use React because I cannot just scrape news feeds on my web server for copyright reasons. I actually have to use rss-parser in the browser with indexeddb, and then use server side rendering to build a moat around my software-as-a-service to skirt the copyright fair use issues. For this application, Next.JS is perfect. I still have need for HTMX in the app. I'm using react as tool not a hammer and everything is a nail. There is nothing in my design that would make it so HTMX could not be used effectively with Next.JS, pending they had the libraries of course.

    • @jherr
      @jherr  9 หลายเดือนก่อน

      @@astartup Ok, I just don't see the need to bring in another 14Kb for HTMX when you could add in SWR for 4Kb and that would do similar things and actually integrate with React.

  • @horacepfefferman4015
    @horacepfefferman4015 ปีที่แล้ว +1

    What was old is new again... (someone who used to post to /cgi-bin)

  • @isaachatilima
    @isaachatilima 11 หลายเดือนก่อน

    I feel some type of way in having html as response. Like to validate an input, if it fails, I have to return another input field that shows the red border and message.

  • @laughAFrame
    @laughAFrame ปีที่แล้ว +9

    Just when I think, I became good at react or next some other shit jumps up. I am done being a Fullstack developer. I am moving to ML or AI 🤦‍♂️

    • @imkir4n
      @imkir4n ปีที่แล้ว

      🤣🤣🤣

    • @jotaroisdarius1918
      @jotaroisdarius1918 ปีที่แล้ว

      Just dont learn it lmao, im tired of this bs aswell

    • @oscardasilva971
      @oscardasilva971 ปีที่แล้ว

      HTMX is a joke, I can't imagine a serious company actually using it.

    • @TVDaJa
      @TVDaJa ปีที่แล้ว

      Yeah because ML is staying the way it is forever

    • @Gollumeo
      @Gollumeo ปีที่แล้ว +1

      ML & AI are topics that evolve like almost every week lmao

  • @deGGenerate
    @deGGenerate ปีที่แล้ว

    Plz tell me what theme of your zsh?

  • @sakesun
    @sakesun ปีที่แล้ว +3

    Heard about this for months. But this is the first time that I realise that it's called HTMX, not HTMLX

  • @kasvith
    @kasvith ปีที่แล้ว +1

    Lets do a Vue3/Nuxt3 one also

  • @mondo1926
    @mondo1926 ปีที่แล้ว +3

    Getting PHP vibes from HTMX.

  • @codernerd7076
    @codernerd7076 ปีที่แล้ว +2

    ❤ htmlX!

  • @shawnshaw9859
    @shawnshaw9859 ปีที่แล้ว +1

    key difference is that htmx relies on a backend spits out html such as django, react can works with a backend that is html ignorant and just provides restful api, these are totally different use cases, htmx is basically a better jquery(well, sort of) for traditional backends, they're just _different_

    • @monishbiswas1966
      @monishbiswas1966 ปีที่แล้ว

      Yup that was my thought - React is a change in paradigm, which has a higher up-front investment, but makes a lot of things easier.
      I worked with MFA's plain JS + server side templating.
      It was easy to get things up and running, but once you got past a level of complexity the abstraction helps to seperate logic from presentation.

  • @Dev-Siri
    @Dev-Siri ปีที่แล้ว +5

    HTMX: JQuery for the next generation with HATEOS driven web apps.

  • @lamtrand88
    @lamtrand88 9 หลายเดือนก่อน

    hello, your terminal look nice to me, can you share your config ?

  • @timmusharapov9257
    @timmusharapov9257 ปีที่แล้ว

    One more framework-library? And why?

  • @aliasalias510
    @aliasalias510 ปีที่แล้ว +3

    Its so funny that this tool is getting so much attention now just because fireship has made a video on it recently. I don't think it will go anywhere. Have been using it years ago and it was O K. Also it's creator is sometimes super toxic.

  • @fatalglory777
    @fatalglory777 ปีที่แล้ว +1

    The key question: when is HTMX the *wrong* choice?

    • @jherr
      @jherr  ปีที่แล้ว

      Highly dynamic apps (e.g. Figma)

  • @jishnuviswanath
    @jishnuviswanath ปีที่แล้ว

    I lived in world Dojo html parser and we decided that's bad way to do stuff and then we are going back to it.

  • @squdge
    @squdge ปีที่แล้ว

    Fun!

  • @Mixesha001
    @Mixesha001 ปีที่แล้ว +7

    Sounds fine for sever side if I need to make some simple UI.
    Also kinda worry about xss.

    • @StingSting844
      @StingSting844 ปีที่แล้ว +6

      A lot of fears expressed about htmx xss vuln could be solved by just one function call sanitizing user input .

    • @TheMacpardo
      @TheMacpardo ปีที่แล้ว +4

      To solve XSS just use a proper framework on the backend, like Astro, Django, etc. They already sanitize your HTML by default.

    • @allesarfint
      @allesarfint ปีที่แล้ว +9

      I mean, you should never trust the user, even if the frontend sanitizes the input. If you only trust the FE to sanitize, then you are barely safer than no sanitazing at all.

  • @buckyfanksy
    @buckyfanksy ปีที่แล้ว

    are we circling back now to a dumbed down angularjs 1 ? No thanks

  • @jediampm
    @jediampm ปีที่แล้ว +5

    Hi thanks for the video.
    I think you just over complicate with this kind of example, with astro SSR.
    About XSS and PHP, the same is valid with nodejs without a framework or client js without a lib or framework. The fault is not on the language but is and should be on developer because the language give all the tools to prevent any kind of attack. If you are using a PHP frameworks you will not have a problem with XSS. It is easy to trash a lang like PHP without think twice. It is just typical of Full stack js / react dev.

    • @jherr
      @jherr  ปีที่แล้ว +1

      Sorry if you took something as me trashing PHP, I simply said that with PHP we need to make sure that we do XSS santization.

    • @jediampm
      @jediampm ปีที่แล้ว

      @@jherr Sir, you can fool yourself and even others with this words. However it is crystal clear why you mention PHP. In one video which you compare NextJS with RSC vs PHP, in PHP code you forgot to sanitize. I and other people post comments mention that you should sanitize or you forgot sanitize. However this was you mistake not the PHP fault. And worst mistake, maybe because you never use PHP, was not using a PHP Frameworks.
      For this kind of things i will unsubscribe you channel and stop watch you videos because a few videos ago, videos are somehow toxic. Thanks anyway.

    • @jherr
      @jherr  ปีที่แล้ว +4

      @@jediampm If you look at that the PHP/RSC video you will see that I pinned a comment directly addressing this issue, as well as adding sanitization to the PHP code. A PHP framework is desirable but not required. As for why I chose Astro in this video it was simply to reduce the number of new technologies that a React developer (the bulk of the audience) would need to learn in order to make use of HTMX. I'm sorry that you feel that way about the channel. I always try to keep my content positive and engaging, it's unfortunate that you feel it's toxic.

  • @PhanorColl
    @PhanorColl ปีที่แล้ว +1

    too complicated of an example for HTMX, but great work anyways.

  • @randerins
    @randerins ปีที่แล้ว

    Next LinkedIn job post will require 30 years experience of HTMX

    • @VincentUchennaOk
      @VincentUchennaOk ปีที่แล้ว

      Show some solid projects built with it is enough!

  • @neociber24
    @neociber24 ปีที่แล้ว

    HTMX just feels funny, not sure who being it back

  • @vasiovasio
    @vasiovasio ปีที่แล้ว +1

    This type of behavior can be easily achieved with Unpoly too.

  • @MightyMoud
    @MightyMoud ปีที่แล้ว +1

    This is a bad implementation. Usually SSE, which is supported in HTMX, is used to send new tokens to the client. Doing that is far easier than what you did here Jack

  • @evstafyevandrew2198
    @evstafyevandrew2198 ปีที่แล้ว

    Спасибо! Ты крутой!

    • @jherr
      @jherr  ปีที่แล้ว

      Спасибо!

  • @seanknowles9985
    @seanknowles9985 ปีที่แล้ว +1

    Can we create pwa with htmx?

    • @guidobit
      @guidobit ปีที่แล้ว +3

      Htmx is all about state on the server, its the client copanion to the RESTful api pattern. If you need an PWA, your best bet is on client side frameworks if you want things like offline functionality.

    • @seanknowles9985
      @seanknowles9985 ปีที่แล้ว +1

      @@guidobit Yeah but technically you could attach a service worker sent from the client to the index.html and cache other route pages that are server rendered..... Tell me I am wrong and why (Why does it need to be SPA for pwa to work). Last time I checked you can create PWA from MPAs which is basically htmx?

    • @seanknowles9985
      @seanknowles9985 ปีที่แล้ว +1

      @@guidobit Imagine how simple and powerful it would be to use golang, htmx with a pwa for offline capabilities.

    • @CFXTBogard
      @CFXTBogard ปีที่แล้ว

      yes, since the only thing you need to declare is the htmx script into your main.js... however, watch out for XSS vulnerabilities. HTMX is still new and additional scripting is needed to sort out stuff.

    • @guidobit
      @guidobit ปีที่แล้ว

      This is true! But it would require pre-loading all the pages in the serviceworker. Not sure how easy this would be for the average application. It would feel like the wrong tool for the job. @@seanknowles9985

  • @existentialquest1509
    @existentialquest1509 ปีที่แล้ว +2

    The only issue is that both HTMX and Alpine requires you to turn of the CSP settings for safe inline eval- apart from being a compliance issue for enterprise use cases there is also the risk of attacks

    • @kachekijaanlega
      @kachekijaanlega 9 หลายเดือนก่อน +1

      can you go into detail abouth this, people seem to be sleeping on this.

  • @miguel53537
    @miguel53537 ปีที่แล้ว

    Good luck to adopt htmx for bigger projects

    • @jherr
      @jherr  ปีที่แล้ว +2

      Bigger in what way? More complex on the client side? True. That would be an issue for HTMX. But if bigger just means more routes that are primarily server driven that just require some additional client interactivty then HTMX will scale quite nicely. In fact, HTMX is ~14Kb (less than what I said in the video) and that won't grow in size based on the app, and it's cross-route cached, so it's very efficient.

    • @NathanHedglin
      @NathanHedglin ปีที่แล้ว

      we made large websites in JQuery back in the day lolz.

  • @chadrotella5808
    @chadrotella5808 ปีที่แล้ว

    Im along time c# developer with over 20 years. Desktop apps server side services. Looking to do more web. But so many different framwworks etc.. was wonder where do i start. Next.js looks cool but not sure if i should learn something else first.

    • @gradycdenton
      @gradycdenton ปีที่แล้ว

      I've recently switched from Next to Nuxt. It's the same concept of full stack batteries included but uses Vue instead of React. A lot of people find React to be overly complicated with lots of ways to shoot yourself in the foot.

    • @FirdausAziz
      @FirdausAziz ปีที่แล้ว

      When sampling don't limit yourself to JS based framework. You can expand your horizons to Python-based (Django, Flask, Falcon, Quart), Ruby (RoR), Groovy (Grails), Go, PHP (Laravel, Yii). Powered by HTMX and Hyper script you can do SPA with these frameworks.

    • @markusn4614
      @markusn4614 ปีที่แล้ว

      I would suggest to use C# with Blazor, with .NET 8 coming you get SSR + SPA even more easily. Once you get the hang of it it's easy to move to JS based frameworks, I recommend Svelte with Vite.

    • @chadrotella5808
      @chadrotella5808 ปีที่แล้ว +1

      @gradycdenton thank you. i like vue.js and played around with it already. I will give Nuxt a try.

    • @chadrotella5808
      @chadrotella5808 ปีที่แล้ว

      @FirdausAziz thank you. I will look into some of the options you mentioned

  • @thierestembra
    @thierestembra ปีที่แล้ว

    99% of the video is about creating backend on Astro/Next.js and not about HTMX. Do not waste your time as I did.

    • @jherr
      @jherr  ปีที่แล้ว

      HTMX code is 99% server based, what did you expect?

  • @zombiefacesupreme
    @zombiefacesupreme ปีที่แล้ว +1

    I *seriously* get the appeal, but I would prefer to just use vanilla JS and Astro. Astro was doing the heavy-lifting in this demo anyways.
    This would be like 150 lines in a script tag, max. That would be like 10kb less than HTMX.

  • @siematos1099
    @siematos1099 ปีที่แล้ว

    your production quality is getting real good. but those flashbangs.... :

    • @jherr
      @jherr  ปีที่แล้ว

      Flashbangs?

    • @siematos1099
      @siematos1099 ปีที่แล้ว +1

      @@jherr predominantly dark backgrounds, followed by the occasional white screen

  • @lucisdev
    @lucisdev ปีที่แล้ว +1

    Frontend != React

  • @Christopher-lx4ud
    @Christopher-lx4ud ปีที่แล้ว

    i build HTMX projects with mostly nodejs and Pug

  • @Om3gaz3r0
    @Om3gaz3r0 ปีที่แล้ว

    Can you explain how htmx scales for larger web applications? How do devs reason about how a page works when the code for it is split across multiple http endpoints and state is distributed across various htmx fragments? It seems like for anything sophisticated you need to really plan out what sections of the page will mutate and I imagine for sanity you probably want only a couple of main trunks on a page that the server sends html for. How does one go about architecting an htmx application at scale?

    • @jherr
      @jherr  ปีที่แล้ว +3

      Applications would scale simply by adding routes. You need to look at HTMX from the server first perspective. Everything is driven off the server. The HTMX directives are just tiny client side helpers that reconnect the client to the server to get new data, or post data, or whatever, as needed. If you look at this through the lens of big isomporphic JS applications you are going to miss the point.
      Also, HTMX is really not designed to try and replace React or other view frameworks. Folks aren't going to be re-implementing Figma in HTMX. HTMX is in no way intended to do that. HTMX is meant to add primitives so that server-driven applications can be more dynamic.

    • @steven11101010
      @steven11101010 7 หลายเดือนก่อน

      @@jherr Which addresses the large majority of needs in web sites and apps. Apps like Figma, Facebook,...etc are a small minority.

  • @drewhjava
    @drewhjava ปีที่แล้ว +1

    "imperative model": svelte, solid, vue, etc. You mean the declarative model. jQuery/raw dom-manipulation/vb6 would be imperative.

    • @jherr
      @jherr  ปีที่แล้ว +1

      Alright, I get where you are going with that. Yes, React is declarative as well. Just different levels of granularity between React and htmx. ;)

  • @boogiman007
    @boogiman007 ปีที่แล้ว

    HTMX the new CFML , oh how things come around again and again .... lol

  • @TRIO_DE_CONQ
    @TRIO_DE_CONQ ปีที่แล้ว

    Do a tutorial on it

  • @portalteam5832
    @portalteam5832 ปีที่แล้ว

    up next, svelte plz

  • @TimKindberg
    @TimKindberg ปีที่แล้ว

    No JS?? But... you wrote a bunch of JS.

    • @jherr
      @jherr  ปีที่แล้ว

      No extra JS on the client side.

    • @TimKindberg
      @TimKindberg ปีที่แล้ว

      @@jherr Hmm ok, I didn't realize that extra JS ran on the server. I was hoping to see pure html + htmx directives only. Hey regardless, your videos (and you) are awesome, keep doing great work.

    • @jherr
      @jherr  ปีที่แล้ว

      @@TimKindberg What you see is about as "pure" as it gets from the client side. htmx is a JS "extension" so you need that JS on the page. But the backend can be anything you want, JS, PHP, Go, Rust, C++, Java, C#, etc. I chose Astro/JS so that folks watching the channel, who are mainly JS/TS devs, could get into HTMX faster and not have to learn another language to use it.

    • @TimKindberg
      @TimKindberg ปีที่แล้ว

      @@jherr I'll give it another watch and see if I understand it better this time.

    • @jherr
      @jherr  ปีที่แล้ว

      @@TimKindberg I should have been more explicit that everything .Astro is running ONLY on the server.

  • @contigen
    @contigen ปีที่แล้ว

    Hi! @jackherrington what's your terminal config, it looks nice

  • @Thorax232
    @Thorax232 ปีที่แล้ว +2

    This presents HTMX to be not much more than a general utility library. Which could just as easily appear in the form of a NPM library.
    In fact, just by probability, I'm gonna' say all the shortcuts HTMX provides already exist in the JS ecosystem.

  • @smithshaw1151
    @smithshaw1151 ปีที่แล้ว

    Way too complicated way to illustrate a simple point. But then again, it might just be me.

  • @TOAOGG
    @TOAOGG ปีที่แล้ว +1

    So what are real use cases for this? Piping all chat-gpt request through my backend is not what I want - I also do not want send html back and forth all the time, when just the data would be sufficent and the client can do the rendering.

    • @FirdausAziz
      @FirdausAziz ปีที่แล้ว +2

      Web devs who wants to forgo the back-front separation and go back to our unified architecture/framework (Laravel, Yii, Django, Flask, PHP, Go, Rust, Java, Groovy) while able to deliver same interactive/dynamic user experience.

    • @TOAOGG
      @TOAOGG ปีที่แล้ว

      @@FirdausAziz My question was not "what" but "why". I just see increased bandwith and cpu usage if we move the rendering to the backend and that would make AWS and co happy, but why should I be happy about that.

    • @TOAOGG
      @TOAOGG ปีที่แล้ว +1

      @@thelvadam5269 did you measure this or are you just guessing here? The drawbacks are there even when you are denying them - and they scale with every user. Nevertheless, even if they'd be close to zero, there should be positives that drive me to use htmx...and the positive that probably gets mentioned first is: rendering performance on the client side that magically appeared out of nowhere because translating json to a visible representation is so cheap /i

    • @alang.2054
      @alang.2054 ปีที่แล้ว +4

      ​@@thelvadam5269but with react we don't have to move JSON everytime. We make requests to API on special occasions, like asking for data. In react a lot of UI actions don't even touch the server. Like changing state, menus etc.

  • @cholst1
    @cholst1 ปีที่แล้ว

    Most stuff > react

  • @ytadi9229
    @ytadi9229 ปีที่แล้ว

    Looks like php, apsx, jsp