wimdeblauwe / htmx-spring-boot

Spring Boot and Thymeleaf helpers for working with htmx
Apache License 2.0
436 stars 41 forks source link

Add before/after code examples #38

Closed waldyrious closed 1 year ago

waldyrious commented 1 year ago

I really liked the before/after comparison shown in your Devoxx presentation, starting at 39:33.

For example, for processors, instead of:

<button th:attr="hx-get=|/refresh-button/${device.id}|,
                 hx-target=|#device-info-${device.id}|,
                 hx-indicator=|#device-info-${device.id}|"
        hx-swap="outerHTML"
        class="...">
</button>

...the syntax is made cleaner with

<button hx:get="|/refresh-button/${device.id}|"
        hx:target="|#device-info-${device.id}|"
        hx:indicator="|#device-info-${device.id}|"
        hx-swap="outerHTML"
        class="...">
</button>

I think it would be nice to include an example or two of such before/after code in the README, to motivate usage of this tool.

wimdeblauwe commented 1 year ago

Thanks for taking the time to write this. However, I think this is more suited for a blog post for example. It did make me realize I had not written a blog post about this library yet, so I did now: https://www.wimdeblauwe.com/blog/2022/12/11/release-1.0.0-and-2.0.0-of-htmx-spring-boot-thymeleaf/

waldyrious commented 1 year ago

I'm glad this prompted you to write the blog post! I am however curious why you think such a motivation/introduction section would not belong to the permanent documentation of the project. It sounds pretty natural to me to include the "what" and the "why" of a project in its documentation, before diving into the "how".