My take on HTMX with ASP.NET Core

Поділитися
Вставка
  • Опубліковано 8 чер 2024
  • Working examples of using HTMX with ASP.NET Core.
    Source: github.com/T0shik/HyperTextEx...
    Khalid's work: www.jetbrains.com/dotnet/guid...
    HTMX: htmx.org/
    Support my Work 🤝 / raw_coding
    Buy my Courses 📚 learning.raw-coding.dev
    Buy my Merch 🛒 shop.raw-coding.dev
    Join the Community 💬 / discord
    Tweet Tweet 📣 / anton_t0shik
    Tune in LIVE! 🎥 / raw_coding
    #csharp #htmx #aspnetcore

КОМЕНТАРІ • 47

  • @Mhblabla
    @Mhblabla 10 місяців тому +3

    I wish Anton saw how many LOCs Todo app in Svelte has.

    • @RawCoding
      @RawCoding  10 місяців тому +8

      Alright there big man, write it up and drop a link to source. Make sure it has a backend to persist state.

  • @carlosjosejimenezbermudez9255
    @carlosjosejimenezbermudez9255 10 місяців тому +3

    1 year ago I built an app with AlpineJS and HTMX, it was an amazing experience even if a little hard to figure out at first.

  • @nark4837
    @nark4837 9 місяців тому +1

    Can this be combined with Razor, to use similar to JSX components?

  • @nicholaspreston9586
    @nicholaspreston9586 9 місяців тому +1

    I might try this library out. Thank you. It could save me a lot of time.

    • @RawCoding
      @RawCoding  9 місяців тому +1

      Let me know how it goes

  • @yourockst0ne
    @yourockst0ne 10 місяців тому +10

    I have (jQuery + MVC) PTSD looking at this

    • @RawCoding
      @RawCoding  10 місяців тому +2

      it was the best

    • @yourockst0ne
      @yourockst0ne 10 місяців тому

      @@RawCoding are you building something like the the vue h() vnode constructor to be able to write a new templating syntax for c# ?

  • @nic_s3385
    @nic_s3385 7 місяців тому +1

    Well... seems I'm not that crazy. I've been working on and off on generating HTML and what should happen when the user interacts with that HTML server side using just C# for a few months now. I was using JQuery, but I want to try and not use any JS or C# libraries so it would be easy to transfer the idea/logic over to any language.
    My goal is to specify what I want and what it should do in code using simple objects. Then have it generate the whole page at load or just bits and pieces as the user uses the app. Much like you are doing here. This has proved to be really fast thanks in large part to not having a framework and no templates which rely on some form of find and replace logic. I just define what I want in code and it gets generated using the dumbest and simplest way I can think of without the use of any library.
    My stuff is still very very rough mainly due pretty much all of it being created from scratch (including dealing with client side logic) while your HTML generating seems quite polished. I'm considering HTMX as it will makes things so much easier, but then I'd be relying on another library which is something I want to try and avoid. I want to build a small app with it and see how that goes.

    • @RawCoding
      @RawCoding  7 місяців тому

      Let me know how it goes!

  • @yourockst0ne
    @yourockst0ne 10 місяців тому +22

    Backend devs are trying to kill JS/TS by any means necessary 😂. If it's not by using web assembly, it's by going back to stateless html generated by the backend.
    Frontend devs are replying with serverside components and server actions aka Nextjs. And others are escaping js quirks with compilers/transpilers aka svelte or imba

    • @zakraw
      @zakraw 10 місяців тому +10

      World Web War

    • @RawCoding
      @RawCoding  10 місяців тому +3

      We have to come together!

    • @SharafMansour
      @SharafMansour 10 місяців тому +2

      2 years ago I was team react.
      Last year I became team svelte.
      Now I am team SolidJS.
      Shouldn’t everyone just create their own framework or something 🤣

    • @yourockst0ne
      @yourockst0ne 10 місяців тому

      Hey 👋 @@SharafMansour do you use the SolidStart meta-framework with it or do you still use a c# backend? Btw before React, you were team Blazor 😉

    • @SharafMansour
      @SharafMansour 10 місяців тому +1

      @@yourockst0ne I still use blazor, and I am currently learning solid start. I am also up to date with svelte kit. The idea of naming the file +page.server.JS makes the code run server side is pretty insane

  • @nanaalfy
    @nanaalfy 10 місяців тому +4

    What's the value this brings? All I see is another library to abstract HTML, CSS and JS. What am I missing? I genuinely want to know.

    • @RawCoding
      @RawCoding  10 місяців тому +7

      if you have a json string, you need to parse it to work with it.
      HyperTextExpression allows you to express html in data structures which can be manipulated (as if you parsed html in to an XmlDocument)
      why that's useful? I can build a skeleton of a website, pass it through different functions and that will generate themed variations.
      data data data
      When I picked up htmx, I didn't want to go back to thinking in terms of razor pages & handlers & partials etc... I wanted to generate html and return it from minimal api endpoints.

    • @nanaalfy
      @nanaalfy 10 місяців тому +1

      @@RawCoding thanks for this feedback. Much appreciated. I'll read more about it

  • @leresche2816
    @leresche2816 10 місяців тому +1

    It is inspired by Flutter?

    • @RawCoding
      @RawCoding  10 місяців тому

      hiccup

    • @yourockst0ne
      @yourockst0ne 10 місяців тому

      @@RawCoding I see why he's asking, but I see what you are doing. It's like the ".NET MAUI Markup Community Toolkit" with their extension methods, they are trying to get rid of XAML to write UIs.

  • @rubananderson3880
    @rubananderson3880 7 місяців тому +1

    I really like your library but I think it's a bit verbose. If only it had a declarative syntax like JSX it'd be perfect. Is your library open source?

    • @RawCoding
      @RawCoding  7 місяців тому

      I agree, not sure how to do that with c# though.
      and yeah you can find it here: github.com/T0shik/HyperTextExpression

  • @mahmoudalaskalany
    @mahmoudalaskalany 10 місяців тому +7

    Man , i will never try this 😂

  • @TheNorthRemember
    @TheNorthRemember 7 місяців тому

    seeing this remindes me of html and php in one file

  • @Naton
    @Naton 9 місяців тому +3

    holy man please use dark mode

  • @ManderO9
    @ManderO9 10 місяців тому

    lmao, change underwear

  • @meJevin
    @meJevin 10 місяців тому

    😂😂😂

  • @amineberrabah6030
    @amineberrabah6030 10 місяців тому +9

    Rip separation of concern

  • @_b001
    @_b001 10 місяців тому +5

    I really love how web development has come full circle from seperation of concern to whatever this is 🙄🙄

    • @ivankovachev8835
      @ivankovachev8835 10 місяців тому +5

      You can thank that damn Javascript for that.

    • @harrybilsonia
      @harrybilsonia 10 місяців тому +4

      "whatever this is" is what the definition of REST api is

  • @Mhblabla
    @Mhblabla 10 місяців тому +21

    Abstracting HTML (and CSS/JS) behind a bunch of proprietary extension methods that I have to learn from scratch: yeah, right. Razor (or just pure SPA with REST backend) is light years better than this.

  • @nunyabuziness2700
    @nunyabuziness2700 10 місяців тому

    FIRST!!!!! IM FIRST IM FIRST!!!