Repository navigation
Comparing changes
Open a pull request
base repository: handlebars-lang/handlebars.js
base: v4.7.9
head repository: handlebars-lang/handlebars.js
compare: v4.7.10
- 13 commits
- 34 files changed
- 3 contributors
Commits on Mar 26, 2026
-
Fix Composer component definition
This aligns the Composer component with https://github.com/components/handlebars.js/blob/master/composer.json
Configuration menu - View commit details
-
Copy full SHA for 6714e07 - Browse repository at this point
Copy the full SHA 6714e07View commit details -
Fix Ruby component publishing documentation
Docker images has to use root because it tries to write to `/.local` which would fail otherwise.
Configuration menu - View commit details
-
Copy full SHA for d069c1c - Browse repository at this point
Copy the full SHA d069c1cView commit details
Commits on Oct 5, 2026
-
Update the minimist dependency to the latest 1.2.x release. Also sync the version in package-lock.json with package.json, which the v4.7.9 release commit did not update.
Configuration menu - View commit details
-
Copy full SHA for ea8ed82 - Browse repository at this point
Copy the full SHA ea8ed82View commit details -
Clarify that --root does not restrict filesystem access
The `--root` option only strips a prefix from template names, but its description could be read as limiting which files the CLI reads. State explicitly that it is not a filesystem boundary.
Configuration menu - View commit details
-
Copy full SHA for 0fcf25c - Browse repository at this point
Copy the full SHA 0fcf25cView commit details -
Validate AST values in the compiler instead of the parser
Instead of validating the AST in the parser, the compiler now checks every AST value that it writes into generated code: path depths and parts, literal values, content strings, hash pair keys and block params, including in stringParams and trackIds mode. The checks now sit where the values are used, so ASTs changed after parsing are covered too. A missing `depth` is treated as 0 and a missing or partial `loc` no longer breaks compilation or error reporting, because hand-built ASTs often omit both. The docs and type definitions now state that `compile` and `precompile` turn an AST into code, so the AST must come from the application itself and never from untrusted input. Fixes GHSA-8r5x-fm3f-whwj.
Configuration menu - View commit details
-
Copy full SHA for 703fdcc - Browse repository at this point
Copy the full SHA 703fdccView commit details -
Only dispatch known node types in the Compiler and Visitor
`Compiler#accept` and `Visitor#accept` call the method named by `node.type`. A crafted type such as `accept`, `constructor` or `pushParam` could therefore call an unrelated method with the node as its argument. The Compiler now accepts only node types the parser produces. A Visitor also accepts types for which a subclass or instance defines its own handler, but never methods of `Visitor` or `Object.prototype`.
Configuration menu - View commit details
-
Copy full SHA for 7d501a5 - Browse repository at this point
Copy the full SHA 7d501a5View commit details -
Only compile partials that are template strings
`resolvePartial` treated any value with a truthy `call` property as a compiled partial, so an object from context data could reach `env.compile()` and be compiled as a template. Only functions are now treated as compiled partials, and only strings are compiled at render time. Anything else is rejected with an error. A function partial that returns nothing now throws a clear error instead of being passed on to the compiler. Partials registered as an AST are no longer compiled; pass them through `Handlebars.compile()` first.
Configuration menu - View commit details
-
Copy full SHA for c28ee7a - Browse repository at this point
Copy the full SHA c28ee7aView commit details -
Don't trust special properties on context data
A prototype's own `constructor` (e.g. `Function.prototype.constructor`) passed the own-property check in `lookupProperty`. With prototype method access enabled (e.g. `allowProtoMethodsByDefault`), templates could reach the `Function` constructor through `__proto__`. Such lookups now go through the prototype-access checks, which deny `constructor` unless explicitly allowed. `escapeExpression` called `toHTML` on any value with such a property, so context data with a non-function `toHTML` key, e.g. from parsed JSON, made rendering throw. Only values with a callable `toHTML` are now treated as SafeStrings. Fixes GHSA-p8wg-vrv2-v86f.
Configuration menu - View commit details
-
Copy full SHA for ceec388 - Browse repository at this point
Copy the full SHA ceec388View commit details -
Escape
<!--and<scriptin precompiled outputPrecompiled templates are often inlined in `<script>` tags. Strings in the generated code containing `</script` could end the script element early, and `<!--` followed by `<script` could keep it from ending where intended. `quotedString` now escapes the `<` of these sequences as `\u003C`, and the JavaScript compiler uses it instead of `JSON.stringify` for lookup names, partial indents and tracked ids. Source locations, which include the `srcName` option, and the template names written by the CLI are escaped the same way. `quotedString` now builds on `JSON.stringify`, so it also escapes control characters and surrogates, and it skips escaping entirely when a string has nothing to escape, which is true of almost every lookup name. Compilation doesn't slow down. The `nameLookup` example in the compiler API docs now quotes with `quotedString` as well, and the docs say that overrides must do the same. Fixes GHSA-xw65-4hp5-5hc7.
Configuration menu - View commit details
-
Copy full SHA for 609d1b1 - Browse repository at this point
Copy the full SHA 609d1b1View commit details -
Iterate lazily in #each and strip whitespace in linear time
`#each` collected every value of an iterable before rendering the block. It now renders each value as it goes, like `for...of`, and closes the iterator if the block throws, so generators can run their cleanup code. Values added to the iterable while the block renders, e.g. to a `Set`, are now visited too, as with `for...of`. The regexes that find trailing whitespace in whitespace control were retried at every position of a whitespace run, which takes quadratic time on long runs. They are now anchored so that matching takes linear time.
Configuration menu - View commit details
-
Copy full SHA for 812c226 - Browse repository at this point
Copy the full SHA 812c226View commit details -
Sanitize the source map URL when minifying
The CLI strips line terminators from the `--map` value before writing it into the sourceMappingURL comment. With `--min`, uglify drops that comment and writes its own from the raw value, so a newline in it ended the comment and the rest of the value ran as JavaScript. The sanitized value is now passed to uglify as well. The comment also kept a raw "<", so a value containing `</script` or `<!--` could end or change the parsing of an enclosing <script> element. "<" is now percent-encoded, which keeps the URL pointing to the same file.
Configuration menu - View commit details
-
Copy full SHA for f37c599 - Browse repository at this point
Copy the full SHA f37c599View commit details -
handlebars-lang committedOct 5, 2026 Configuration menu - View commit details
-
Copy full SHA for e47b236 - Browse repository at this point
Copy the full SHA e47b236View commit details -
handlebars-lang committedOct 5, 2026 Configuration menu - View commit details
-
Copy full SHA for 45ce152 - Browse repository at this point
Copy the full SHA 45ce152View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v4.7.9...v4.7.10