HTMX Go Todo List Application (#1 - Router, Vite and Template)

Sdílet
Vložit
  • čas přidán 6. 09. 2024

Komentáře • 10

  • @samarnagar9699
    @samarnagar9699 Před 8 měsíci +1

    i knew you were the right giy for me when i say the neovim

    • @webdevfuel
      @webdevfuel  Před 7 měsíci +1

      Haha! Thanks man, great comment. Neovim really is the best text editor, I never looked back since I started using it!

    • @samarnagar9699
      @samarnagar9699 Před 7 měsíci

      @@webdevfuel same it's the best

  • @starvin-arvin
    @starvin-arvin Před 10 měsíci +4

    Why would you want to bundle htmx? The beauty is not to have that build step and just load it from a CDN

    • @webdevfuel
      @webdevfuel  Před 10 měsíci +8

      There are pros and cons to both approaches. Loading it from HTMX's CDN (unpkg.com) is straight forward, but I wouldn't use it in production, since there would be dependence on a third party. By bundling it, there's more control over it, plus it's easier to bundle more JavaScript along side when it makes sense, for example with extensions. There's also the option to copy the htmx.js file directly from the repo and just add it to the static directory, which would be the best balance between ease of use and control. Thanks for watching!! 👍

    • @owenwexler7214
      @owenwexler7214 Před 7 měsíci

      What happens if the CDN is down?

  • @niquedegraaff
    @niquedegraaff Před 6 měsíci +1

    If you go full HTMX without a external backend, then you are going to suffer a lot when you want to expand your product to mobile for example. Because your mobile app needs JSON, and not pieces of html from the api.

    • @webdevfuel
      @webdevfuel  Před 6 měsíci +3

      It's possible to return HTML or JSON based on the Accept header sent with a request. It's rare that both a web app and mobile app endpoints need data shaped the same way, even with JSON (e.g. authentication), so it's a totally ok solution to return two different things (HTML or JSON) to web app or mobile app.

    • @niquedegraaff
      @niquedegraaff Před 6 měsíci

      But the api will return specific structured html for one website right? Is that not exactly the opposite of the purpose of splitting business logic and presentation?@@webdevfuel

    • @niquedegraaff
      @niquedegraaff Před 6 měsíci

      The more i think about this. Isn't a database connection already some kind of API? Back to SQL i guess ;)@@webdevfuel