Skip to content

Releases: casid/jte

1.10.0

08 May 08:32

Choose a tag to compare

Features

Fixes

  • #77 Prevent Kotlin compiler to leak file handles
  • #75 Better generics handling in Kotlin templates
  • #80 Improvements for trimControlStructures

1.9.0

12 Mar 10:03

Choose a tag to compare

  • #67 DirectoryCodeResolver no longer does file watching. This removes a problematic com.sun.nio dependency and was likely not used by 99% of jte users. In case you need the file watching on your project, please add the jte-watcher dependency 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

28 Feb 17:04

Choose a tag to compare

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:

  • #63 package name of template classes can be specified
  • #63 better hot reload experience with generated template sources
  • #60 Gradle plugin no longer includes source sets which caused problems on some builds
  • #52 Fix hasTemplate method with DirectoryCodeResolver

1.7.0

19 Feb 17:16

Choose a tag to compare

  • 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

10 Feb 20:02

Choose a tag to compare

  • Support for Java 8

1.5.2

09 Feb 04:30

Choose a tag to compare

  • #50 fix parsing of attributes without parameters
  • Add automatic module names
  • Use latest version of org.owasp.encoder (1.2.3)

1.5.1

06 Feb 07:32

Choose a tag to compare

  • #47 add setting htmlCommentsPreserved to preserve comments with ContentType.Html.
  • #46 do not fail build for empty HTML attributes, even if they are not boolean.
  • #39 fix error message for wrong param with precompiled classes.

1.5.0

13 Dec 16:19

Choose a tag to compare

  • #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

30 Oct 06:48

Choose a tag to compare

  • 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 &#34;the way&#34;!">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

19 Sep 16:05

Choose a tag to compare

  • #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