Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5,440 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thymeleaf Modernised

An experimental, Java 26-only fork of Thymeleaf tailored to ReAI's Spring MVC templates. It preserves the template syntax used by ReAI while deliberately discarding compatibility layers, template modes, dialect features, and runtime overhead that the application does not use.

This is not a general-purpose replacement for upstream Thymeleaf. Its compatibility contract is the ReAI template corpus, not the complete Thymeleaf API.

Requirements

  • Java 26 or newer
  • Spring Framework 7
  • Jakarta Servlet 6.1

Modules

  • org.thymeleaf:thymeleaf:4.0.0-SNAPSHOT: HTML-only core runtime
  • org.thymeleaf:thymeleaf-spring6:4.0.0-SNAPSHOT: synchronous Spring MVC integration
  • org.thymeleaf:thymeleaf-compiler:4.0.0-SNAPSHOT: build-time HTML and SpringEL validation

The core and Spring artifact names remain compatible with Spring Boot's existing dependency graph, so applications can select this fork with dependency resolution rules without changing their templates or imports.

Build

./mvnw -DskipTests clean install

The output uses Java 26 class files and cannot run on an older JVM.

Build-time template validation

TemplateCompilerMain accepts one or more template roots. It parses every HTML template with the same parser as the runtime and parses ${...}, *{...}, [[...]], and [(...)] SpringEL expressions. Invalid markup or expressions fail the build with the source path, line, and column. Templates are processed concurrently on virtual threads.

java -cp "thymeleaf-compiler-and-runtime-classpath" \
  org.thymeleaf.compiler.TemplateCompilerMain src/main/resources/templates

ReAI invokes this entry point from Gradle before processResources, so errors appear during a normal application build.

This validates syntax and expression grammar. It cannot prove model property types without a typed model contract, so it is not yet a complete JTE-style type checker.

Deliberately unsupported

  • Java 25 and older
  • XML, text, CSS, and raw template modes; JavaScript exists only for th:inline="javascript"
  • WebFlux, reactive rendering, Spring WebFlow, and javax.servlet
  • OGNL and legacy Spring compatibility paths
  • Decoupled legacy distribution, examples, integration-test matrix, and old build profiles
  • Standard processors and expression utility objects absent from ReAI templates
  • Soft-reference and bounded FIFO caches

The runtime uses hard-reference concurrent caches and SpringEL's adaptive bytecode compiler, which deoptimises polymorphic expressions when their runtime types change. ReAI formats dates and numbers and performs complex view logic in Kotlin, so those reflective template helpers are intentionally absent.

Publishing

Snapshots publish to GitHub Packages. Maven deployment expects GITHUB_ACTOR and GITHUB_TOKEN in the environment and a matching github server entry in Maven settings.

./mvnw --settings .mvn/settings.xml -DskipTests deploy

The maven branch also exposes the same snapshot as an anonymous, read-only Maven repository for ReAI builds:

https://raw.githubusercontent.com/beint-no/thymeleaf-modernised/maven

License and provenance

This fork is derived from Thymeleaf 3.1.5.RELEASE and remains available under the Apache License 2.0. See LICENSE.txt and NOTICE.txt.

About

Experimental Java 26-only Thymeleaf runtime with build-time template validation for ReAI

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages