Commits
Commits on Oct 29, 2022
-
Prettier v2 has the following breaking changes: * enforces spaces between `function` and params * enforces trailing commas by default
Copy the full SHA e534a91View commit details -
This is needed in order to use `globalThis`, see #1894. It also made it possible to remove some old polyfills and fallbacks.
Copy the full SHA f6ff3bfView commit details -
Copy the full SHA da41887View commit details -
Remove support for IE11 and dead browsers
Handlebars v5 will target modern browsers, while older browsers will still receive support via version 4.x.
Copy the full SHA 83baaa4View commit details
Commits on May 25, 2022
-
Copy the full SHA b14ff4aView commit details
Commits on Jan 2, 2022
-
Enable IDE code-highlighting for bin-file
By adding the `.js`-extension to the bin-file, IDEs will know that js code-highlighting should be applied to the file, which makes it easier for devs to read the code.
Copy the full SHA 30bd78dView commit details
Commits on Feb 15, 2021
-
# Conflicts: # components/bower.json # components/handlebars.js.nuspec # components/package.json # integration-testing/multi-nodejs-test/test.sh # package-lock.json # package.json
Copy the full SHA 6790c08View commit details -
[FEAT] Extract the Handlebars parser (#1713)
Extracts the parser to `@handlebars/parser`, where it can be shared between different implementations. This means that e.g. Glimmer/Ember will be able to iterate on new features without forcing Handlebars to adopt them immediately, and vice versa. All implementors will be able to absorb changes as it makes sense for them.
Chris Garrett committedFeb 15, 2021 Copy the full SHA 19bdaceView commit details
Commits on May 4, 2020
Commits on Apr 3, 2020
-
Revert "Switch cmd parser to latest minimist"
This reverts commit c2f1e62.
Copy the full SHA 3438891View commit details -
Copy the full SHA 0ec71dcView commit details -
Copy the full SHA c2f1e62View commit details
Commits on Apr 1, 2020
-
Copy the full SHA f8eade7View commit details -
Use tmp directory for files written during tests
- Add spec/tmp directory with .gitkeep file to indicate the folder is intentional - Add the folder contents to .gitignore - Use this folder to output the sourcemap file during bin tests. This file is a sideeffect of the main test
Copy the full SHA 4671c4bView commit details
Commits on Mar 31, 2020
-
chore: add unit tests for cli options (#1666)
- adds full unit tests for all cli options - demonstrates that nothing changes between minimist and yargs except a minor order change in the --help text - proves b9c4b25 works the same as before Co-authored-by: fabb <fabb@users.noreply.github.com>
Copy the full SHA 80c4516View commit details
Commits on Jan 13, 2020
-
# Conflicts: # components/bower.json # components/handlebars.js.nuspec # components/package.json # package.json
Copy the full SHA edfe6b8View commit details -
fix: don't wrap helpers that are not functions
- helpers should always be a function, but in #1639 one seems to be undefined. This was not a problem before 4.6 because helpers weren't wrapped then. Now, we must take care only to wrap helpers (when adding the "lookupProperty" function to the options), if they are really functions.
Copy the full SHA 9d5aa36View commit details
Commits on Jan 12, 2020
-
Copy the full SHA 3c1e252View commit details
Commits on Jan 10, 2020
-
feat: default options for controlling proto access
This commmit adds the runtime options - `allowProtoPropertiesByDefault` (boolean, default: false) and - `allowProtoMethodsByDefault` (boolean, default: false)` which can be used to allow access to prototype properties and functions in general. Specific properties and methods can still be disabled from access via `allowedProtoProperties` and `allowedProtoMethods` by setting the corresponding values to false. The methods `constructor`, `__defineGetter__`, `__defineSetter__`, `__lookupGetter__` and the property `__proto__` will be disabled, even if the allow...ByDefault-options are set to true. In order to allow access to those properties and methods, they have to be explicitly set to true in the 'allowedProto...'-options. A warning is logged when the a proto-access it attempted and denied by default (i.e. if no option is set by the user to make the access decision explicit)
Copy the full SHA 7af1c12View commit details
Commits on Jan 8, 2020
-
# Conflicts: # components/bower.json # components/handlebars.js.nuspec # components/package.json # package.json
Copy the full SHA 0c8230cView commit details -
Copy the full SHA d7f0dcfView commit details -
feat: access control to prototype properties via whitelist
Disallow access to prototype properties and methods by default. Access to properties is always checked via `Object.prototype.hasOwnProperty.call(parent, propertyName)`. New runtime options: - **allowedProtoMethods**: a string-to-boolean map of property-names that are allowed if they are methods of the parent object. - **allowedProtoProperties**: a string-to-boolean map of property-names that are allowed if they are properties but not methods of the parent object. ```js const template = handlebars.compile('{{aString.trim}}') const result = template({ aString: ' abc ' }) // result is empty, because trim is defined at String prototype ``` ```js const template = handlebars.compile('{{aString.trim}}') const result = template({ aString: ' abc ' }, { allowedProtoMethods: { trim: true } }) // result = 'abc' ``` Implementation details: The method now "container.lookupProperty" handles the prototype-checks and the white-lists. It is used in - JavaScriptCompiler#nameLookup - The "lookup"-helper (passed to all helpers as "options.lookupProperty") - The "lookup" function at the container, which is used for recursive lookups in "compat" mode Compatibility: - **Old precompiled templates work with new runtimes**: The "options.lookupPropery"-function is passed to the helper by a wrapper, not by the compiled templated. - **New templates work with old runtimes**: The template contains a function that is used as fallback if the "lookupProperty"-function cannot be found at the container. However, the runtime-options "allowedProtoProperties" and "allowedProtoMethods" only work with the newest runtime. BREAKING CHANGE: - access to prototype properties is forbidden completely by default
Copy the full SHA d03b6ecView commit details
Commits on Dec 14, 2019
-
# Conflicts: # Gruntfile.js # package-lock.json # package.json
Copy the full SHA d23ccf6View commit details -
Commits on Dec 2, 2019
-
chore: configure prettier and eslint
- add prettier to do formatting - add eslint-config-prettier to disable rules conflicting with prettier - remove eslint from grunt workflow - use lint-stage to lint and format on precommit - use eslint and prettier in travis directly - remove rules that are already part of the "recommended" ruleset That rational is that eslint and prettier should be run in Travis-CI, on commit and as IDE integration (highlighting errors directlry). They don't need to be run along with test-cases. Getting linting errors when running the tests because of missing semicolons is just annoying, but doesn't help the overall code-quality.
Copy the full SHA 1f61f21View commit details
Commits on Nov 18, 2019
-
fix(runtime.js): partials compile not caching (#1600)
Reintroduce "merge" function, no called "mergeIfNeeded", that only creates a new partials object if both "env.partials" and "options.partials" are set. closes #1598
Copy the full SHA 23d58e7View commit details