HTMX examples for React developers

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

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

  • @kyle8575
    @kyle8575 9 หลายเดือนก่อน +18

    You're getting better at these videos. Keep going man.

  • @SootuKoll
    @SootuKoll 9 หลายเดือนก่อน +12

    I'd pay for an Udemy course of Kotlin and htmx. Just saying.

  • @pkop4
    @pkop4 9 หลายเดือนก่อน +11

    Not having the url change on navigation tabs is bad ux. It's nice to share links plus reloading page will keep navigation state. Seems you could just do similar to how you have it but instead of setting hx-get, set href and use hx-boost=true?

    • @Torudson
      @Torudson 9 หลายเดือนก่อน +3

      You can also do hx-get and hx-push-url to get the url changes

    • @tom-delalande
      @tom-delalande  9 หลายเดือนก่อน +7

      Yea you’re right and tbh I didn’t know about hx-boost. But building it like a SPA makes it clearer what HTMX is doing for the sakes of the demo. I definitely agree that you should store as much state is reasonable in the URL.

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

      @@tom-delalande Makes sense though I would say SPA should update url programmatically on nav for same reason, but in any case it presents a useful instance of how htmx/server side by default provides advantages vs SPA. And using native web behavior (href vs hx-get) means just in case JS is disabled the nav's will still work.

  • @ygorperez
    @ygorperez 9 หลายเดือนก่อน +6

    Tom is actually a genius!

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

    Cool stuff, that said because of how the is done with tabs it could do with accessibility work before it would be shippable, either by updating URL and aria current page. Or using tabs with tabpanel attributes

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

    Would be nice to see the react examples in a server rendered example like nextjs app router so it’s more one to one with the htmx implementation.

  • @LanguidBasil
    @LanguidBasil 4 หลายเดือนก่อน

    I love the project, will play with it on weekend to learn some htmx (also fira code is great =D)

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

    Do you have a repo with any of these Kotlin & HTMX examples please? Great job on the videos by the way.

    • @tom-delalande
      @tom-delalande  9 หลายเดือนก่อน

      I just added the GitHub link for this one in the description

  • @spacecowboyofficial
    @spacecowboyofficial 9 หลายเดือนก่อน +2

    How much does it cost to handle this many ajax calls in the cloud compared to react ?

    • @tom-delalande
      @tom-delalande  9 หลายเดือนก่อน +4

      You’re right that this can be harsher on the server. I think that most of these request are requests you’d have to make anyways. It’s just instead of JSON you’re returning HTML

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

    What are your thoughts on htmz

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

      He did a video on it already! It's called "Use this instead of HTMX".

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

    Another banger from the htmx man

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

    “The urls are not updating, that’s the point” is not necessarily true, since having a history entry or even a deep link can be very useful.
    Fortunately, this is very easy to do with HTMX using either HX-Push-Url response header or hx-push-url attribute 🙂

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

      It really depends what you want. You might want a SPA that doesn't update the url. I think in this case with the menu, it's not the BEST example. However, there are times you don't want to save location state, like with your online bank.

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

      Regardless, you still have a very solid point and recommendation.

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

      Think he said "that's a fair point" so acknowledges the drawback, but don't think this tradeoff is even necessary if just using href and hx-boost

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

      @@pkop4I think he says “that’s the point” but I might be wrong.
      hx-boost is nice but it has drawbacks, the main one is you need to send the entire html page, which depending on your use case might not be what you want 🙂 but I agree that hx-boost is awesome

    • @tom-delalande
      @tom-delalande  9 หลายเดือนก่อน

      You’re absolutely right. And to be honest I didn’t know about hx-push-url. But making it a SPA makes it clearer what HTMX is doing for the sakes of the demo. I definitely agree that you should store as much state as reasonable in the URL.

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

    Good stuff! Keep em coming

  • @lilbuckbreaker3868
    @lilbuckbreaker3868 8 หลายเดือนก่อน

    This is awesome ❤

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

    Why not use both? Have React used for the first page loads, routing, and reusable components in code. And in that React code you can add HTMX tags that then use the server to update the components. I think for somewhat larger projects this approach would be quite manageable.

    • @Atmos41
      @Atmos41 9 หลายเดือนก่อน +3

      Why not use both? Well, for many reasons, but the 2 main ones:
      - in order to hydrate, React needs either SSR or manual mounting on a root. So if you don’t use React on the server, it gets very annoying to hydrate on each swap.
      - ReactDOM is 50kB min+gzip. And that’s just ReactDOM 🙂

    • @KangoV
      @KangoV 9 หลายเดือนก่อน +2

      We're using HTMX for internal apps. NO JS devs in sight. All the devs can do front end and backend in any language. This saves a huge amount! No client builds is a huge win !

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

    Yo this is brilliant!!!

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

    Good content! Keep it up!

  • @josersleal
    @josersleal 4 หลายเดือนก่อน

    why___ chatgpt will generate that in any lamg in 30s

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

    nice video, just make the background dark next time

    • @tom-delalande
      @tom-delalande  9 หลายเดือนก่อน

      What do you mean? On the website?

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

      @@tom-delalande yep, whenever you switch between the editor and the browser, the white background kills my eyes