Skip to content

Commit

Permalink
Update jte to version 3.1.4 (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospereira authored Nov 8, 2023
1 parent f2acb04 commit d61cf55
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spock = "2.3-groovy-4.0"
managed-freemarker = "2.3.32"
managed-handlebars = "4.3.1"
managed-jstachio = "1.3.3"
managed-jte = "2.3.2"
managed-jte = "3.1.4"
managed-rocker = "1.4.0"
managed-soy = "2023-09-13"
managed-thymeleaf = "3.1.2.RELEASE"
Expand Down
9 changes: 4 additions & 5 deletions src/main/docs/guide/views/templates/jte.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Micronaut Views Jte includes api:views.jte.JteViewsRenderer[] which uses
the https://jte.gg[Jte] Java-based template engine.
Micronaut Views Jte includes api:views.jte.JteViewsRenderer[] which uses https://jte.gg[jte] (**J**ava **T**emplate **E**ngine), a
secure and lightweight template engine for Java and Kotlin.

Add the `micronaut-views-jte` dependency to your classpath.

Expand All @@ -15,11 +15,11 @@ include::{testsviewsJte}/resources/views/home.jte[]

=== Compiling Templates

Jte templates may be precompiled at build time. This can be done by a https://github.com/casid/jte/blob/master/DOCUMENTATION.md#gradle[Gradle plugin] or https://github.com/casid/jte/blob/master/DOCUMENTATION.md#maven[Maven plugin]. If not precompiled, the application will need a JDK so it can compile templates at runtime.
Jte templates may be precompiled at build time. This can be done by a https://jte.gg/pre-compiling/#gradle[Gradle plugin] or https://jte.gg/pre-compiling/#maven[Maven plugin]. If not precompiled, the application will need a JDK so it can compile templates at runtime.

=== Dynamic Reloading

When 'dynamic' is enabled (see below), JTE will load templates from the project source directory, and will reload them after changes.
When `dynamic` is enabled (see below), jte will load templates from the project source directory, and will reload them after changes.

=== Configuration

Expand All @@ -29,7 +29,6 @@ include::{includedir}configurationProperties/io.micronaut.views.jte.JteViewsRend

== .kte (Kotlin) templates


To use `.kte` (Kotlin) templates include the dependency:.

dependency:jte-kotlin[groupId="gg.jte"]
1 change: 0 additions & 1 deletion test-suite-graal/test-suite-graal-jte/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ dependencies {
jte {
sourceDirectory = file('src/main/resources/views').toPath()
generate()
generateNativeImageResources = false
}

tasks.getByName("inspectRuntimeClasspath") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public interface JteViewsRendererConfiguration {
String getDynamicSourcePath();

/**
* When using dynamic templates, build them with binary content (see https://github.com/casid/jte/blob/master/DOCUMENTATION.md#binary-rendering-for-max-throughput).
* When using dynamic templates, build them with binary content
* (see <a href="https://jte.gg/binary-rendering/">jte Binary Rendering docs</a>).
* (When using precompiled templates, this setting is determined by the build configuration.)
* @return true to enable building binary content
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import io.micronaut.views.ViewsConfiguration;
import jakarta.inject.Singleton;

import java.io.Writer;
import java.nio.file.Paths;

/**
Expand Down Expand Up @@ -66,8 +65,8 @@ public PlainHtmlTemplateOutput(TemplateOutput delegate) {
}

@Override
public Writer getWriter() {
return delegate.getWriter();
public void setContext(String tagName, String attributeName) {
// no-op
}

@Override
Expand All @@ -76,8 +75,8 @@ public void writeContent(String value) {
}

@Override
public void setContext(String tagName, String attributeName) {
// no-op
public void writeContent(String value, int beginIndex, int endIndex) {
delegate.writeContent(value, beginIndex, endIndex);
}

@Override
Expand Down Expand Up @@ -154,5 +153,10 @@ public void writeUserContent(Number value) {
public void writeUserContent(Character value) {
delegate.writeUserContent(value);
}

@Override
public void writeUnsafeContent(String value) {
delegate.writeUnsafeContent(value);
}
}
}

0 comments on commit d61cf55

Please sign in to comment.