Releases: wimdeblauwe/htmx-spring-boot
4.0.1
What's Changed
- fix: Htmx response headers are now working again (#157)
Full Changelog: 4.0.0...4.0.1
3.6.3
4.0.0
What's Changed
- docs: Add links to the corresponding README.md for each released version by @wimdeblauwe in #151
- [fix] Annotations on exception handler methods do not work by @xhaggi in #153
- Upgrade to Spring Boot 3.4.0, remove deprecated code and mark HtmxView as deprecated by @xhaggi in #152
Upgrade notes
Spring Boot 3.4.0 baseline
This version uses Spring Boot 3.4.0 as the baseline to work with. Be sure to first update your Spring Boot version before updating this library.
HtmxView
is deprecated
HtmxView
was introduced in this library to make it possible to support Out of Band Swaps. However, in Spring Framework 6.2 (Which is part of Spring Boot 3.4.0) there is now support for HTML Fragments.
As an example, this kind of code:
@HxRequest
@GetMapping("/users")
public HtmxResponse getMainAndPartial(Model model){
model.addAttribute("users", userRepository.findAll());
model.addAttribute("count", userRepository.count());
return HtmxResponse.builder()
.view("users/list")
.view("users/count")
.build();
}
Should be replaced with:
@HxRequest
@GetMapping("/users")
public View users(Model model) {
model.addAttribute("users", userRepository.findAll());
model.addAttribute("count", userRepository.count());
return FragmentsRendering
.with("users/list")
.fragment("users/count")
.build();
}
or
@HxRequest
@GetMapping("/users")
public Collection<ModelAndView> users() {
return List.of(
new ModelAndView("users/list", Map.of("users", userRepository.findAll())),
new ModelAndView("users/count", Map.of("count", userRepository.count()))
);
}
Full Changelog: 3.6.2...4.0.0
3.6.2
This release adds support for annotations on exception handlers. It allows to do something like this:
@ExceptionHandler(Exception.class)
@HxReswap(HxSwapType.NONE)
public String handleException(Exception ex) {
return "error";
}
If there are annotations on the controller methods as well, then annotations on the exception handler take precedence if there is an exception.
Full Changelog: 3.6.1...3.6.2
3.6.1
What's Changed
Full Changelog: 3.6.0...3.6.1
3.6.0
What's Changed
- Handle flash attributes on htmx redirects by @xhaggi in #137
- Prepend context path to context relative URLs in htmx response headers by @xhaggi in #135
- Rewrite handler method argument and return type resolving by @xhaggi in #140
- Add missing "select" option from HX-Location by @xhaggi in #142
- Allow to configure whether @HxRequest also applies to boosted requests by @xhaggi in #143
Full Changelog: 3.5.1...3.6.0
3.5.1
What's Changed
- @HxPushUrl(true) now retreives the path from the request by @tschuehly in #129
New Contributors
- @tschuehly made their first contribution in #129
Full Changelog: 3.5.0...3.5.1
3.5.0
What's Changed
- Add support for processing HtmxResponse in the Model and as an Argument by @checketts in #128
Full Changelog: 3.4.1...3.5.0
3.4.1
What's Changed
- [fix] Invalid characters (CR/LF) in response header caused by customized Jackson ObjectMapper by @xhaggi in #123
Full Changelog: 3.4.0...3.4.1
3.4.0
What's Changed
- Update to Maven 3.9.6 by @Riggs333 in #111
- Remove spring plugin repository by @Nathan-Melaku in #114
- Remove commented out asciidoctor-maven-plugin in pom.xml by @Riggs333 in #116
- spring-boot 3.2.5 by @sullis in #113
- Add missing annotations for response headers by @xhaggi in #118
- Add extra info in README about using multiple values in hx-vals by @wimdeblauwe in #120
New Contributors
- @Riggs333 made their first contribution in #111
- @Nathan-Melaku made their first contribution in #114
Full Changelog: 3.3.0...3.4.0