Skip to content

v4.6.0

Choose a tag to compare

@LebCit LebCit released this 03 Jun 01:26
· 4 commits to main since this release

πŸš€ LiteNode v4.6.0 - Template Engine Enhancements

πŸ†• New Features

Enhanced Template Includes

  • βœ… #include now works inside #each loops 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!