Quantcast

Thymeleaf 3.0.5 JUST PUBLISHED

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Thymeleaf 3.0.5 JUST PUBLISHED

danielfernandez
Administrator

Thymeleaf 3.0.5 (3.0.5.RELEASE) has been just published.

This is a maintenance release with some bugfixing and minor changes, and should work as a drop-in replacement for 3.0.x versions. Have a look at our Download Page to learn how to obtain it.


THYMELEAF 3.0.5 CHANGE LOG

Changes to the Thymeleaf CORE:

  • Fixed possible bad parsing of comment start/end delimiters in JavaScript and CSS inlining when the 2K buffer used at the Text Parser happened to end in the middle of a JavaScript/CSS text literal.
  • Fixed bad behaviour of th:remove="all-but-first" in combination with a th:each on a zero-element collection.
  • Fixed custom HTML5 elements with no suffix in their names ("<tag->", which are allowed by the Custom Element spec) provoking an exception.
  • Fixed bad interaction of literal parsing in javascript inlining introduced in 3.0.4, causing inlined expressions containing literals ('...') to not be adequately parsed, and therefore not executed at all.
  • Improved startup times at the template engine by means of lazy initialization of dialect artifacts.
  • Added '/content()' selector to Markup Selector syntax so that the whole contents of a fragment can be selected, excluding the matched tag.
  • Updated AttoParser dependency to 2.0.3.RELEASE.

Changes to the Thymeleaf SPRING integration packages:

  • Improved startup times at the template engine by means of lazy initialization of dialect artifacts.
  • Improve behaviour of SpringContextUtils.getApplicationContext(): avoided cast exception when ApplicationContext is not available.
  • Added support for rendering Server-Sent Events (SSE) with content-type "text/event-stream" in Spring 5 WebFlux when Thymeleaf is executing in reactive-friendly data-driven mode.
  • Updated Spring Framework dependency to 5.0.0.M5 in the thymeleaf-spring5 module.

If you are interested, you can have a look at the list of issues on GitHub:

And of course we invite you to visit the project website at http://www.thymeleaf.org


CHANGES TO THE SPRING 5 INTEGRATION MODULE (Web MVC and WebFlux)

The updated thymeleaf-spring5 module (version 3.0.5.M3) introduces new support for producing Sever-Sent Events (SSE) when Thymeleaf is used for rendering the view of an HTTP request with content type "Accept: text/event-stream" and what is executed is a template containing an iteration (th:each) on a reactive data-driver variable (a Flux<?>).

In scenarios in which the JSON received at the browser via SSE events is parsed and then used to render fragments of HTML (DOM) by means of a client-side template engine, Thymeleaf could completely save this client-side processing step by sending already-rendered HTML from the server instead of JSON, using exactly the same template code used for normal server-side HTML rendering.

Read more about the SSE Specification and the format of SSE events here: https://www.w3.org/TR/eventsource/

Read more about how Thymeleaf implements HTML SSE rendering support here: https://github.com/thymeleaf/thymeleaf-spring/issues/133 and have a look at an example sandbox application here: https://github.com/thymeleaf/thymeleafsandbox-sse-webflux.

How does Thymeleaf operate in a reactive-friendly way for Spring 5 WebFlux?

Remember that, when used with Spring 5 WebFlux, Thymeleaf can operate in one of three reactive-friendly modes:

  • Full, producing all output in memory and sending it as a single output buffer.
  • Chunked, producing output in buffers (chunks) of a configurable maximum size.
  • Data-Driven, making Thymeleaf work as an integrated part of a stream of data, which it renders into HTML in a way fully sensible to reactive back-pressure.

Read more about these reactive-friendly operation modes at the thymeleaf-spring5 JavaDocs.

Also, note that there are other two additional sandbox applications prepared to serve as examples of the general thymeleaf-spring5 integration with Spring 5 WebFlux:

  • thymeleafsandbox-stsm-reactive, equivalent to the STSM sample application but using Spring 5, Spring Boot 2.0 and the new Spring WebFlux framework. This sandbox is mainly meant to test form binding.
  • thymeleafsandbox-biglist-reactive, using Spring 5, Spring Boot 2.0 and the new Spring WebFlux framework. This sandbox is meant to test the rendering of large amounts of data.

WHERE DID THYMELEAF 3.0.4 GO?

You've probably noticed that we are jumping from 3.0.3.RELEASE to 3.0.5.RELEASE. The reason is, once we had all the 3.0.4 artifacts prepared and pushed to the repositories, and just before we could even announce the new version, we were reported a bug introduced in 3.0.4. This was a nasty recession in a quite common JavaScript inlining scenario, for which unluckily enough we seemed to be lacking a test case -- and we have more than 2,800! :(

So we decided to stop it all, fix the bug, and release 3.0.5.RELEASE right away. Sorry for the version jump!


Regards,
Daniel.

Loading...