Usssh, now I’ve done it. I actually have to talk about htmx and blazor next monday. So I need all you folks help, what are the libraries you are using? What are the good and bad things about that combo?
@egil oh, btw I've written some blog posts about integrating web components with Htmx. You're 99% right, but it depends on the component and how it conveys value back to the server.
@egil neat. A technique I've learned with Htmx is to think in terms of Forms. Since any click/submit bubbles up and submits a form, it tends to be easier to think about it that way.
Forms also represent logical units, so you don't have to figure out how to get values bundled up and sent together.
@brtkdotse@egil This might be controversial, but here are my thoughts on why you technically may want to use #Blazor and #htmx together and why you wouldn't.
I have social reasons why you may want to prefer one over the other, too. But that's more opinion ;)
@brtkdotse@khalidabuhakmeh I agree with all your points actually. That’s also why my library Htmxor will solve all the points in the “reason not to” list. I am heavily modifying the component discovery logic, as well as the renderer, to make it’s aware of how htmx works.
@patriksvensson@khalidabuhakmeh@brtkdotse yeah I have looked at your stuff too. Have a custom HtmxContext that has a HtmxRequest and a HtmxResponse properties that provides access to incoming and outgoing headers. The context can be accessed in components. That's my best solution for now.
@egil@patriksvensson@brtkdotse If I were the god-king of Razor, I’d let you define “directive helpers”. These directive helpers would act like attributes on a Blazor component and let you define functionality.
@khalidabuhakmeh@patriksvensson@brtkdotse something like that is almost possible. Cannot do custom directives until the razor compiler team enables that, but this is possible for the headers that are static (i.e., won't change based on request):
Add comment