Skip to content

Releases: wimdeblauwe/htmx-spring-boot

5.0.0

27 Nov 20:35

Choose a tag to compare

Upgrade notes

Spring Boot 4

This release requires a Spring Boot 4.x baseline.

Removed annotations

These annotations have been removed: @HxRefresh, @HxRedirect and @HxLocation. You should instead return your view name with a special prefix:

Annotation View Name
@HxRefresh refresh:htmx
@HxRedirect redirect:htmx:/path
@HxLocation redirect:htmx:location:/path

What's Changed

  • [fix] repo url in pom.xml points to old name by @xhaggi in #158
  • [fix] broken HtmxResponse handling since 9cc7331 by @xhaggi in #157
  • [cleanup] remove deprecated classes HtmxView and HtmxViewMethodReturnValueHandler by @xhaggi in #172
  • Allow @HxRequest to ignore restore history requests and ignore them by default by @xhaggi in #171
  • Remove annotations HxRefresh, HxRedirect and HxLocation in favor of special views by @xhaggi in #176
  • Upgrade to Spring Boot 4.0.0-RC1 by @xhaggi in #175
  • build: Replace nexus-staging-maven-plugin with central-publishing-maven-plugin by @wimdeblauwe in #178
  • [fix] autoconfiguration not limited to servlet-based web application by @xhaggi in #181
  • [fix] showTarget and settle parameters of @HxReswap are mapped to wrong HtmxReswap fields during conversion by @xhaggi in #186
  • Add support for native htmx redirects in Spring Security by @lcnicolau in #169

New Contributors

Full Changelog: 4.0.0...5.0.0

Full Changelog: 4.0.2...5.0.0

4.0.2

25 Nov 08:59

Choose a tag to compare

What's Changed

  • Upgrade to Spring Boot 3.5.8 by @xhaggi in 5e3eea7
  • Handle htmx headers for @ResponseBody methods by @fchtngr in #183
  • [fix] autoconfiguration not limited to servlet-based web application by @xhaggi in #182
  • [fix] showTarget and settle parameters of @HxReswap are mapped to wrong HtmxReswap fields during conversion by @xhaggi in #187

Full Changelog: 4.0.1...4.0.2

5.0.0-rc.1

29 Oct 17:09

Choose a tag to compare

5.0.0-rc.1 Pre-release
Pre-release

Upgrade notes

Spring Boot 4

This release requires a Spring Boot 4.x baseline.

Removed annotations

These annotations have been removed: @HxRefresh, @HxRedirect and @HxLocation. You should instead return your view name with a special prefix:

Annotation View Name
@HxRefresh refresh:htmx
@HxRedirect redirect:htmx:/path
@HxLocation redirect:htmx:location:/path

What's Changed

  • Upgrade to Spring Boot 4.0.0-RC1 by @xhaggi in #175
  • [fix] repo url in pom.xml points to old name by @xhaggi in #158
  • [fix] broken HtmxResponse handling since 9cc7331 by @xhaggi in #157
  • [cleanup] remove deprecated classes HtmxView and HtmxViewMethodReturnValueHandler by @xhaggi in #172
  • Allow @HxRequest to ignore restore history requests and ignore them by default by @xhaggi in #171
  • Remove annotations HxRefresh, HxRedirect and HxLocation in favor of special views by @xhaggi in #176
  • build: Replace nexus-staging-maven-plugin with central-publishing-maven-plugin by @wimdeblauwe in #178

Full Changelog: 4.0.0...5.0.0-rc.1

4.0.1

05 Dec 21:30

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

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

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

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

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

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

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