The latest version of FreshMarker, the Java template engine, is now available. Version 2.0.0 introduces several improvements, new features, and a more streamlined foundation with an emphasis on cleaner templating capabilities.
New Features and Improvements
- Range Built-ins: Additions like
is_limited
andis_unlimited
for better handling of ranges. - Extended Temporal Support: add
HOURS
,MINUTES
, andSECONDS
for improved time handling. - New Operators
- Relational operators now also for temporal and string types.
- Null-safe Built-In operator (
?!
) for better null handling. - Spaceship operator (
<=>
) for three-way comparisons. - Concat operator (
~
) for simplifying string concatenation. - Elvis Operator (?:) as an alternativ to the default operator.
- Structured Primitives: Support for primitive types with attributes.
- Expanded Literal Support: Non-primitive values can now be used in sequence and hash literals.
Breaking Changes
- The plugin mechanism and all associated deprecated functionalities have been removed.
- All previously deprecated features and built-ins are no longer available.
- Alternate null-safe operators (
!!
,->
,→
) have been removed, replaced by?!
.
Deprecations
Several built-ins have been marked for deprecation in this version in favor of structured primitives:
- Version-related:
major
,minor
, andpatch
. - Locale-related:
lang
,language
,language_name
,country
,country_name
. - Enum-related:
ordinal
.
Bug Fix
- Corrected the parameter order in the
join
built-in.
Why Upgrade to FreshMarker 2.0.0?
This release introduces new capabilities and enhancements while removing deprecated and legacy features. It lays the groundwork for more efficient and modern templating workflows. We encourage users to try out the new version and provide feedback to help shape future improvements.