handlebars.js v4.0.0 Release Notes
Release Date: 2015-09-01 // over 8 years ago-
- #1082 - Decorators and Inline Partials (@kpdecker)
- #1076 - Implement partial blocks (@kpdecker)
- #1087 - Fix #each when last object entry has empty key (@denniskuczynski)
- #1084 - Bump uglify version to fix vulnerability (@John-Steidley)
- #1068 - Fix typo (@0xack13)
- ๐ #1060 - #1056 Fixed grammar for nested raw blocks (@ericbn)
- โก๏ธ #1052 - Updated year in License (@maqnouch)
- โ๏ธ #1037 - Fix minor typos in README (@tomxtobin)
- #1032 - Is it possible to render a partial without the parent scope? (@aputinski)
- โ #1019 - Fixes typo in tests (@aymerick)
- #1016 - Version mis-match (@mayankdedhia)
- #1023 - is it possible for nested custom helpers to communicate between each other?
- #893 - [Proposal] Section blocks.
- #792 - feature request: inline partial definitions
- #583 - Parent path continues to drill down depth with multiple conditionals
- #404 - Add named child helpers that can be referenced by block helpers
- Escape = in HTML content - 83b8e84
- โฌ๏ธ Drop AST constructors in favor of JSON - 95d84ba
- Pass container rather than exec as context - 9a2d1d6
- โ Add ignoreStandalone compiler option - ea3a5a1
- ๐ Ignore empty when iterating on sparse arrays - 06d515a
- โ Add support for string and stdin precompilation - 0de8dac
- Simplify object assignment generation logic - 77e6bfc
- Bulletproof AST.helpers.helperExpression - 93b0760
- Always return string responses - 8e868ab
- Pass undefined fields to helpers in strict mode - 5d4b8da
- Avoid depth creation when context remains the same - 279e038
- ๐ Improve logging API - 9a49d35
- ๐ Fix with operator in no @data mode - 231a8d7
- ๐ Allow empty key name in each iteration - 1bb640b
- โ Add with block parameter support - 2a85106
- ๐ Fix escaping of non-javascript identifiers - 410141c
- ๐ Fix location information for programs - 93faffa
Compatibility notes:
- ๐ Depthed paths are now conditionally pushed on to the stack. If the helper uses the same context, then a new stack is not created. This leads to behavior that better matches expectations for helpers like
if
that do not seem to alter the context. Any instances of../
in templates will need to be checked for the correct behavior under 4.0.0. In general templates will either reduce the number of../
instances or leave them as is. See #1028. - The
=
character is now HTML escaped. This closes a potential exploit case when using unquoted attributes, i.e.<div foo={{bar}}>
. In general it's recommended that attributes always be quoted when their values are generated from a mustache to avoid any potential exploit surfaces. - AST constructors have been dropped in favor of plain old javascript objects
- The runtime version has been increased. Precompiled templates will need to use runtime of at least 4.0.0.