I’m excited to announce the release of Spring ViewComponent v0.7.0 today.

You can grab the release from Maven Central by following the instructions at: https://github.com/tschuehly/spring-view-component#installation

The two biggest changes to this release is the annotation processor for processing ViewComponents at build time and a new awesome way to create a ViewContext.

Annotation Processor

Previously the templates were processed at request time by parsing them with jsoup and then transforming the view:action attributes after rendering the templates was finished.

This was complicated as we needed to deal with HTML parsing and figuring out what ViewComponent the view:action attribute was in and severely impacted performance, as this was done on each request and not just once.

Now a java annotation processor will process the templates at build time to translate the view:action attributes to hx- attributes.

But hot reloading the templates also still works as I integrated a Spring Devtools FileSystem Watcher to parse the templates at development time.

Creating a ViewContext

Previously we created a ViewContext by calling the ViewContext constructor and passing ViewProperties.

This will now be replaced by creating a dedicated record that needs to implement the ViewContext interface. This will enable type checking of templates in the future.

This simplifies the @param annotation inside JTE templates and the @thymesVar comment inside Thymeleaf templates immensely!

If you have any questions just open an issue in the GitHub Repository!