v4.6.0
π LiteNode v4.6.0 - Template Engine Enhancements
π New Features
Enhanced Template Includes
- β
#includenow works inside#eachloops with proper context inheritance - β Loop variables and current context automatically available in included templates
- β Enables modular, reusable template components within iterations
Powerful Date Formatting
- π Locale Support: Custom month/weekday names for internationalization
- π Extended Tokens: 20+ format tokens (YYYY/yyyy, MMMM/MMM, dddd/ddd, A/a, Z)
- π Timezone Handling: Automatic timezone offset calculation and display
- β° AM/PM Formatting: Both uppercase (A) and lowercase (a) meridiem support
- π Backward Compatible: Existing dateFormat usage continues to work
π Usage Examples
Template Includes in Loops
{{#each posts}}
{{ #include("./post-card.html") }} <!-- Now works! -->
{{/each}}Advanced Date Formatting
// French locale example
{{createdAt | dateFormat("dddd D MMMM YYYY", false, frenchLocale)}}
// β "mercredi 14 fΓ©vrier 2024"
// Timezone-aware formatting
{{publishedAt | dateFormat("YYYY-MM-DD HH:mm Z", false)}}
// β "2024-02-14 08:30 +05:30"π§ Breaking Changes
None - all changes are backward compatible
π οΈ Technical Improvements
- Enhanced StatementParser to handle includes within each loops
- Improved context inheritance in template evaluation
- Extended builtInFilters with comprehensive date formatting
This release showcases significant template engine improvements that make LiteNode much more powerful for building dynamic, internationalized web applications!