Skip to content

Releases: wimdeblauwe/htmx-spring-boot

5.1.0

Choose a tag to compare

@wimdeblauwe wimdeblauwe released this 14 Mar 16:09

What's Changed

  • Make swap style optional and add support to define “none” for scroll and show in HX-Reswap by @xhaggi in #191
  • Add support for automatic CSRF token injection by @lcnicolau in #188
  • Upgrade to Spring Boot 4.0.3 by @wimdeblauwe in #192
  • Do not serialize null values with hx-vals by @wimdeblauwe in #195

Full Changelog: 5.0.0...5.1.0

4.0.3

Choose a tag to compare

@wimdeblauwe wimdeblauwe released this 14 Mar 16:03

What's Changed

Full Changelog: 4.0.2...4.0.3

5.0.0

Choose a tag to compare

@wimdeblauwe wimdeblauwe released this 27 Nov 20:35

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

Choose a tag to compare

@xhaggi xhaggi released this 25 Nov 08:59

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

5.0.0-rc.1 Pre-release
Pre-release

Choose a tag to compare

@wimdeblauwe wimdeblauwe released this 29 Oct 17:09

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

Choose a tag to compare

@wimdeblauwe wimdeblauwe released this 05 Dec 21:30

What's Changed

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

Full Changelog: 4.0.0...4.0.1

3.6.3

Choose a tag to compare

@wimdeblauwe wimdeblauwe released this 05 Dec 21:26

What's Changed

  • fix: Htmx response headers are now working again

Full Changelog: 3.6.2...3.6.3

4.0.0

Choose a tag to compare

@wimdeblauwe wimdeblauwe released this 29 Nov 07:09

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

Choose a tag to compare

@wimdeblauwe wimdeblauwe released this 28 Nov 19:23

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

Choose a tag to compare

@wimdeblauwe wimdeblauwe released this 19 Nov 19:08

What's Changed

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

Full Changelog: 3.6.0...3.6.1