wimdeblauwe / htmx-spring-boot

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

Separate functionalities into modules #64

Closed xhaggi closed 11 months ago

xhaggi commented 11 months ago

As discussed in https://github.com/wimdeblauwe/htmx-spring-boot-thymeleaf/discussions/63 and to push things forward a bit, this PR separates the core and Thymeleaf functionality into modules. Since this changes the whole project structure, I bumped the project to the next major version 3.0.0-SNAPSHOT.

The following modules are now available:

I have moved all tests to their corresponding modules and renamed the auto configuration classes to HtmxMvcAutoConfiguration and HtmxThymeleafAutoConfiguration so that they are following the naming convention. I also moved the org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc.imports configuration into the test scope.

wimdeblauwe commented 11 months ago

Thank you for this! There are some conflicts now that will need to be resolved. I wanted to release 2.2.0 first to get those changes out before we restructure the whole library.

wimdeblauwe commented 11 months ago

According to https://docs.github.com/en/repositories/creating-and-managing-repositories/renaming-a-repository we could rename this repository to htmx-spring-boot as well as we could be supporting other templating engines in the future as well. WDYT?

checketts commented 11 months ago

I like the idea of renaming if it is no long Thymeleaf specific

xhaggi commented 11 months ago

Thank you for this! There are some conflicts now that will need to be resolved. I wanted to release 2.2.0 first to get those changes out before we restructure the whole library.

Sure. I think I will get to that tomorrow.

According to https://docs.github.com/en/repositories/creating-and-managing-repositories/renaming-a-repository we could rename this repository to htmx-spring-boot as well as we could be supporting other templating engines in the future as well. WDYT?

Ah, I didn't know this was a common naming convention for third-party Spring Boot modules. I will name the modules this way.

xhaggi commented 11 months ago

Back to work. Rebased, all conflicts are resolved and the parent and modules are now named htmx-spring-boot-parent, htmx-spring-boot, htmx-spring-boot-thymeleaf. I decided to update the spring-boot-starter-parent to the latest version 3.1.2. and therefore I added a new line to the Spring Boot compatibility table in the README.md.

wimdeblauwe commented 11 months ago

Ah, I didn't know this was a common naming convention for third-party Spring Boot modules.

I have no idea if it is the "official way", but just a proposal from my side.

xhaggi commented 11 months ago

It is mentioned in the Spring Boot documentation, but under Creating Your Own Starter - Naming

You should make sure to provide a proper namespace for your starter. Do not start your module names with spring-boot, even if you use a different Maven groupId. We may offer official support for the thing you auto-configure in the future. As a rule of thumb, you should name a combined module after the starter. For example, assume that you are creating a starter for "acme" and that you name the auto-configure module acme-spring-boot and the starter acme-spring-boot-starter. If you only have one module that combines the two, name it acme-spring-boot-starter.

wimdeblauwe commented 11 months ago

@xhaggi Thank you for your work on this. Version 3.0.0 is now released with this split of the modules.

xhaggi commented 11 months ago

I’m glad I could help with it 😁