Great demo Egil. I've been wanting to do something similar, and have started a Blazor + HTMX project that was going Ok, but I was ignorant of some of the power of HTMX.....so thanks. I look forward to reviewing you code in a bit more detail.
I've been researching combining HTMX and blazor/razor pages for a short while now, and it's interesting to see this livestream which shows me others are also seeing the potential here. I've come to this same question as you and have been experimenting with combining Razor Pages and HTMX, to test its viability for a production system. My first impressions are that htmx and razor pages work very well together. With razor pages, each page's model contains the request definitions that htmx will use for interactivity. Like the OnGet() method for example. It's almost like they were made to work together. I haven't had a chance to use it in production but so far in my personal testing it shows me huge potential.
We've been using this combination for a small internal website and we have the same experience as @seancpp. I started it as a Blazor Server app, but one of my team members wanted to experiment with HTMX and rewrote it using Razor pages. The biggest difference with regular Razor pages is just that the OnGet() methods now only render the full page for normal requests. For HTMX requests, they return partial pages that HTMX then inserts into the DOM as instructed, which naturally suits SPA designs. Although not specific to Razor pages, this difference is also relevant to browser caching: if you serve different content for HTMX requests and the header includes a Last-Modified timestamp, you should add "Vary: HX-Request" to ensure that browsers fetch the right cache entry. Otherwise, it also just works (TM).
Great demo Egil. I've been wanting to do something similar, and have started a Blazor + HTMX project that was going Ok, but I was ignorant of some of the power of HTMX.....so thanks. I look forward to reviewing you code in a bit more detail.
How much harder would it be to build this example using Razor Pages & HTMX and ignoring Blazor all together?
I've been researching combining HTMX and blazor/razor pages for a short while now, and it's interesting to see this livestream which shows me others are also seeing the potential here. I've come to this same question as you and have been experimenting with combining Razor Pages and HTMX, to test its viability for a production system.
My first impressions are that htmx and razor pages work very well together. With razor pages, each page's model contains the request definitions that htmx will use for interactivity.
Like the OnGet() method for example. It's almost like they were made to work together. I haven't had a chance to use it in production but so far in my personal testing it shows me huge potential.
We've been using this combination for a small internal website and we have the same experience as @seancpp. I started it as a Blazor Server app, but one of my team members wanted to experiment with HTMX and rewrote it using Razor pages. The biggest difference with regular Razor pages is just that the OnGet() methods now only render the full page for normal requests. For HTMX requests, they return partial pages that HTMX then inserts into the DOM as instructed, which naturally suits SPA designs. Although not specific to Razor pages, this difference is also relevant to browser caching: if you serve different content for HTMX requests and the header includes a Last-Modified timestamp, you should add "Vary: HX-Request" to ensure that browsers fetch the right cache entry. Otherwise, it also just works (TM).
Incredible!
What is the name of the track plying on the starting soon sequence?
😊😊😊
how about fixing all of this shit in blazor first?
+1
All these round robin technologies to get back to JavaScript client interactions that we have had for years. Fail!
Please slow down when you're talking. It Is very difficult to understand what you're saying because of your accent.