Replies: 1 comment
-
My experience has been the same especially in the context of HTMX such gives markup clearer intent. Id love to be able to use PUT, PATCH, and DELETE on routable components. Maybe the component can take an attribute like we do in API controllers eg:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As an avid Blazor user, I really love the component model. I think creating applications this way makes it very scalable and easy to build.
For basic applications, we often don't need full interactivity that is provided by hefty technologies such as WASM or SignalR. A lot of the time, we can do this simply with a technology such as HTMX on the front end. While I appreciate the steps in the right direction with enhanced navigation in Blazor, I feel like it is a bit of a half step. Working with HTMX, I believe it's method of adding attributes to HTML elements for ALL HTTP method (GET, POST, PUT, DELETE) allows engineers to easily see exactly what buttons and forms do.
I have built a proof of concept for this utilizing HTMX, MinimalAPIs, and RazorComponentResult. The only major problem with this is that you basically have to use Razor Component as slightly advanced view templates, and you have to handle all of the logic inside the API handlers. Allowing me to have a method called
HandlePut
andHandleDelete
inside my Razor component would allow me to completely remove Minimal APIs from my project and streamline the whole process.PS. I am aware I can do this with MVC, but that is so 2010. Yes, I know I can also do basically the same thing with Razor Pages, but their "component" model is not as nice to work with as Blazor.
Beta Was this translation helpful? Give feedback.
All reactions