Skip to content

Releases: wimdeblauwe/htmx-spring-boot

4.0.1

05 Dec 21:30
Compare
Choose a tag to compare

What's Changed

  • fix: Htmx response headers are now working again (#157)

Full Changelog: 4.0.0...4.0.1

3.6.3

05 Dec 21:26
Compare
Choose a tag to compare

What's Changed

  • fix: Htmx response headers are now working again

Full Changelog: 3.6.2...3.6.3

4.0.0

29 Nov 07:09
Compare
Choose a tag to compare

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

28 Nov 19:23
Compare
Choose a tag to compare

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

19 Nov 19:08
Compare
Choose a tag to compare

What's Changed

  • [fix] string-based redirections with flash attributes not working by @xhaggi in #146

Full Changelog: 3.6.0...3.6.1

3.6.0

17 Nov 10:18
Compare
Choose a tag to compare

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

10 Sep 06:30
Compare
Choose a tag to compare

What's Changed

  • @HxPushUrl(true) now retreives the path from the request by @tschuehly in #129

New Contributors

Full Changelog: 3.5.0...3.5.1

3.5.0

28 Aug 20:42
Compare
Choose a tag to compare

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

18 Jun 07:09
Compare
Choose a tag to compare

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

30 May 19:24
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 3.3.0...3.4.0