jknack / handlebars.java

Logic-less and semantic Mustache templates with Java
http://jknack.github.io/handlebars.java
Other
1.47k stars 382 forks source link

Will the Nashorn deprecation affect handlebars.java? #696

Open jkissel opened 5 years ago

jkissel commented 5 years ago

Hi, with Java 11, the Nashorn script engine was deprecated and marked for removal (see JEP 335).

Thanks for this great library. I hope we can continue using them in the future.

TJReinert commented 5 years ago

Not the creator, however the JDK11 community has stated that Java 11 will NOT remove Nashorn. it has only been stated that it will be deprecated. There is no need to worry at this time.

See this tweet by Mark Reinhold, Chief Architect, Java Platform Group. https://twitter.com/mreinhold/status/1006550983072104448

jkissel commented 5 years ago

Yes, I know. But Java 11 is supported only til 2022. So we're probably gonna use something like Pebble Templates, which does not have that dependency, and hope to be future-proof with that.

TJReinert commented 5 years ago

Understood. I know many were worried about the nashorn deal until they saw that tweet.

We may need to fork and undertake that ourselves. I have not seen much activity from the creator or many pull requests being merged.

agentgt commented 5 years ago

@jkissel I think you are confusing some things.

Handlebars.java is pure Java. It only dispatches to the Javascript Engine if and only if you want to use Javascript helpers.

Thus the core library doesn't have a strong dependency on nashorn. I even bet the current version of handlebars.java works fine in JDK 11 albeit I haven't tested.

The bigger issue might be modules and reflection which eliminates proper java 9 profiles and graal vm native-image respectively. Pebble Templates probably has similar issues so ... if I was you I wouldn't drop Handlebars.java just because of the Nashorn.

If you really want to future proof I would look into Rocker which compiles templates into templates into Java.