-
In a recent Quarkus Insights, Qute and Qute fragments were showcased. I'm not very familiar with Qute itself but it looks very promising and I think I want to use it at my company given the chance. So with simplicity in mind, my question is: why would I use a fragment when I can just use hx-boost instead? Not only it's easier to use, but it also promotes web standards and builds on top of them. Take for example this snippet <form hx-boost="true" action="/example" method="post">
<input name="email" type="email" placeholder="Enter email...">
<button>Submit</button>
</form> Suppose the user disables JS, the default behavior of Once you start introducing things like fragments you lose this ability. Sure, boosting means you're fetching the whole page, but there's a difference between
The second use case is the default case for hx-boost, meaning you're not reloading scripts and stylesheets in the The only extra cost is the chunks of markdown contained in your If the advantage of fragments is just being a good citizen of the web and not wasting those extra bytes, then I can't argue, fair enough. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
/cc @mkouba (qute) |
Beta Was this translation helpful? Give feedback.
-
I think that both the hx-boost and the fragments (the idea is described in this essay) have different use cases. It's not one or the other.
I checked our tests, and found this one and another one. So yes, fragments can be nested. But again, you don't need to use it. It depends on your specific use case.
It aims to as simple as possible, but not simpler 😉. In other words, it's always a trade-off between being flexible/powerful and simple/convenient. CC @ia3andy |
Beta Was this translation helpful? Give feedback.
I think that both the hx-boost and the fragments (the idea is described in this essay) have different use cases. It's not one or the other.
I checked our tests, and found this one and another one. So yes, fragments can be nested. But again, you don't need to use it. It depends on your specific use case.
It aims to as simple as possible, but not simpler 😉. In other words, it's always a trade-off b…