handlebars.java icon indicating copy to clipboard operation
handlebars.java copied to clipboard

Will the Nashorn deprecation affect handlebars.java?

Open jkissel opened this issue 6 years ago • 4 comments

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

  • Do you think, this will affect handlebars.java? Are there changes planned related to this issue?
  • Do you have a recommendation for users of handlerbars.java like "Use Rhino instead of Nashorn."?

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

jkissel avatar Apr 02 '19 17:04 jkissel

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

TJReinert avatar May 14 '19 18:05 TJReinert

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.

jkissel avatar May 15 '19 08:05 jkissel

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.

TJReinert avatar May 15 '19 10:05 TJReinert

@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.

agentgt avatar Jun 05 '19 15:06 agentgt