.NET 8 Amazing New Feature: Minimal APIs + Blazor + HTMX

preview_player
Показать описание
The new way to build web apps in .NET 8: Minimal APIs + Razor components + HTMX.

Рекомендации по теме
Комментарии
Автор

That was pretty cool. Thanks for the demo!

fieryscorpion
Автор

Love the simplicity of this. Thanks for sharing!

codyclay
Автор

Amazing!
As a Blazor developer who loves SSR, I'm very interested in this combination. Please keep us updated with such great stuff.
Thank you.

AmerBakeer
Автор

Wow. This is awesome. 

Thanks for putting the pieces of the puzzle together. And for sharing the code.

vincentcifello
Автор

Thank you this looks amazing, definitely gonna try it out.

Motion
Автор

This is fantastic! Thanks for sharing! One thing to try, is to get the form validation working more like Blazor/JQuery Validation where it will revalidate the form inputs on blur.

MrStupiuno
Автор

The only problem I see now is how I can convince others to use htmx with this setup instead of the (imho) current complex state of Blazor. Thank you for the inspiration! I was already using htmx with razor pages, though the whole Partial setup is less ideal.

timohermans
Автор

Cool idea, nice execution. I thought from the title that it uses Blazor in some capacity.

maacpiash
Автор

It's amazing what you can build with HTMX, I have an offline-first app built in this way (with a lighter lib that I made) and one part is extremely interactive with lots of moving parts. I thought I would need to reach for a front end lib for that part, but nope, this pattern delivers just fine!

dovh
Автор

i feel like this is the stack i have been waiting for. To rely on HTMX for 95% of CRUD operations, and then use interactivity mode for 'islands' that need it like notifications or chat bot windows, and do be able to do it all in C#. so cool

jameswilkinson
Автор

This is awesome. I've been using HTMX + Razor Pages with pretty amazing results, but my one beef with it is that partial views have limited re-usability; you can't create "wrapper" components that can accept children like you can with Blazor components, so it looks like this completes the missing piece of the puzzle for me!

I've also built a project with Blazor (server side) and whilst it was a fairly productive experience in the end, there's a bit of a learning curve with the lifecycle stuff as you mentioned - this looks much more simple.

davemasters
Автор

the code in the Github link does not match up with the video demo code

chrisg
Автор

I know this is months after you originally posted, but do you know of any good resources for handling Identity/Auth with this approach?

JeffCaldwell-nemo_omen
Автор

Have you ran into a problem with navigation while using htmx? For example if I do an hx-get="/todos" hx-trigger-"click" hx-target="#todos", it will work fine...but if I navigate away and then back it doesnt call the endpoint from that point on until I refresh the page. Am I missing something?

williammcroberts
Автор

Seems far more intuitive than the traditional use of hooks from blazor and mixing logic inside your pages!

zagoskintoto
Автор

with htmx can't you replace the outer div of the component? so perhaps your components itself contain the thmx attributes / actions? for example: <Timer RefreshRate="2" /> and set the htmx 'every 2s" inside the component. makes the component fully dependent on htmx, i know. But if your going down this path anyway :)

stijnnel
Автор

So, how is this better than Razor pages? Are components easier to work with than partials?

dovh
Автор

Hey how do you handle Antiforgery token outside of form with htmx (for eg post request after clicking one of divs on grid)?

adrian_franczak
Автор

Is there a big advantage using this over MVC with HTMX?

renebu
Автор

So you basically replace SignalR with HTMX and use Blazor Components in a super static way. Why not use Template strings and interpolation instead?

TillmannHuebner