Releases: casid/jte
1.10.0
Features
- #72 GraalVM native-image support, more details and how to use here. Kudos to @edward3h for this contribution!
- #81 A new jte extension for the Gradle plugin removes lots of boilerplate. Make sure to have a look at the updated examples. Big thanks to @edward3h for contributing this extension!
Fixes
1.9.0
- #67
DirectoryCodeResolverno longer does file watching. This removes a problematiccom.sun.niodependency and was likely not used by 99% of jte users. In case you need the file watching on your project, please add thejte-watcherdependency as described here. - #61 You may now configure the class path used by the compiler via
TemplateEngine::setClassPath - #65 modification times are only stored for existing files in DirectoryCodeResolver
- Empty values for localization keys now result in null Content, since it makes no sense to render them.
- #68 fixed Gradle path setup in examples
1.8.0
This release adds the optional jte-kotlin module.
It can compile .kte template files, which use Kotlin instead of Java as expression language. See #57 for more background information.
This is how the example.jte file from the front page looks like as example.kte:
@import org.example.Page
@param page:Page
<head>
@if(page.description != null)
<meta name="description" content="${page.description}">
@endif
<title>${page.title}</title>
</head>
<body>
<h1>${page.title}</h1>
<p>Welcome to my example page!</p>
</body>To compile templates with Kotlin as expression language, you need to add the jte-kotlin module to your project:
<dependency>
<groupId>gg.jte</groupId>
<artifactId>jte-kotlin</artifactId>
<version>1.8.0</version>
</dependency>
Since 1.8.0 both Maven and Gradle plugins can precompile jte and kte files. You can seamlessly call jte templates from kte templates and vice versa. This might be handy if you'd like to migrate the expression language of existing jte templates from Java to Kotlin.
The IntelliJ plugin is pretty far already to support kte files (https://github.com/casid/jte-intellij/tree/kotlin-support). There's still one issue with unresolved backwards references. If anyone has an idea why this doesn't work with Kotlin injections (https://intellij-support.jetbrains.com/hc/en-us/community/posts/360008349720-Kotlin-references-in-MultiHostInjector-are-not-working-correctly), I'm very happy about any hint :-) Regardless there's gonna be a first beta release of the IntelliJ plugin with Kotlin support next week!
Other bugfixes and improvements:
1.7.0
- Binary templates for maximum rendering throughput
- Gradle Plugin to precompile/generate templates (thanks @iRebbok for contributing!)
- #52 Add hasTemplate method to TemplateEngine
- #51 generate/precompile returns list of generated/precompiled java files.
1.6.0
1.5.2
1.5.1
1.5.0
- #25 Fix compilation with too long constant strings.
- Small performance optimization: Use forHtmlContent to escape HTML tag body contents, since we know that we are not within an HTML attribute.
- #34 Allow to pass compiler arguments to template compiler.
- Add first draft of hot reload for precompiled template engines.
- #35 allow to configure parent class loader for jte templates.
- Remove experimental feature null safe template mode.
1.4.0
- HTML attributes with a single output that evaluates to an empty string, null, or false, are not rendered. For instance,
<span data-title="${null}">Info</span>, will result in<span>Info</span>. The existing feature for HTML boolean attributes is unaffected by this, e.g.<input required="${true}"still renders as<input required>and<input required="${false}">results in<input>. - Content block output in html attributes is escaped. For instance,
<span data-title="@`This is "the way"!`">Info</span>will be rendered as<span data-title="This is "the way"!">Info</span>(See these unit tests for detailled examples) - #22 HTML, CSS and js comments are omitted with
ContentType.Html - Experimental utility to concat CSS classes, located in
gg.jte.html.support.HtmlSupport - Allow composition of different HTML policies.
- Optional HTML policy that forbids single quoted HTML attributes. (
gg.jte.html.policy.PreventSingleQuotedAttributes) - #20 Optional HTML policy to forbid inline event handlers (
gg.jte.html.policy.PreventInlineEventHandlers) - #10 improve trimming of control structures, it now also works with
ContentType.Html - Fix import statement in css file being misinterpreted as jte import.
- Compilation error if parameters are passed to a tag without parameters.
- #24 Better error message for param declared without name
- #15 Allow ClassLoader to be provided to ResourceCodeResolver
- Map of parameter name, parameter class can be obtained for each jte template. (
gg.jte.TemplateEngine#getParamInfo)
Maven plugin
- #10 trimControlStructures can be enabled
- Custom HTML policy can be defined in CompilerMojo, with
htmlPolicyClass.
1.3.0
- #11 Suppress imports after output was already written
- Fix ommitted comment if it's the first control structure after parameters
- #10 Initial insert of experimental feature trimControlStructures (please don't use in production yet!)
- Added
gg.jte.WriterOutput - Improved error message if template is called with wrong parameter
- Wrap arguments passed to Content parameters of templates if the passed type is not
gg.jte.Content, in order to allow incremental migration to jte