Join GitHub today
[MAJOR FEAT] New event-based template processing engine #389
Thymeleaf 3.0 builds around a completely new template processing engine, codenamed aurora, developed with the aim of improving its execution performance and reducing its memory footprint, especially in scenarios that were heavily penalized until 2.1 like the generation of big amounts of output markup as a consequence of the execution of iterations on very large collections.
In order to achieve these goals, Thymeleaf 3.0 abandons most of its DOM-oriented processing mechanisms and turns into an event-based template processor that responds to template parser/cache events by processing the template markup or text and immediately producing its output, even before new events coming from input for the same template are processed. This results in streamlined processing, much more efficient than the Thymeleaf 2.1 processing architecture which required each of the phases --1. parsing, 2. processing, 3. output-- to be completely finished before the next phase could even start.
The central component of this new processing engine will be the
The event model
The new event model in Thymeleaf 3.0 is defined by a series of interfaces at the
There are 11 interfaces modeling the basic template events, all extendig (at different depth levels) the
Also, there are 3 interfaces that allow working on groups of events, a.k.a. models:
Taking into consideration the existence of these
From the diagram above we can see how Thymeleaf 3.0 allows the creation of processors (grouped in dialects as usual), executed in the template processing phase, that act both on specific events (single