-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This upgrades to Handlebars 3.0 and makes backwards-incompatible changes to the ExpressHandlebars API. Since Handlebars had a major version bump, it seemed appropriate for this package to have a major version bump as well, so I took the liberty of refactoring some things. - Add `compilerOptions` config property which is passed along to `Handlebars.compile()` and `precompile()`. - Expose ExpressHandlebars metadata to the `data` channel during render (#101). This metadata is accessibile via `@data.ExpressHandlebars.*` - New "protected" hooks for AOP-ing template compilation and rendering, all of which can optionally return a Promise: - `_compileTemplate()` - `_precompileTemplate()` - `_renderTemplate()` For most apps this will be a drop-in replacement to v1 of this package, and using Handlebars 3.0 should be a drop-in replacement as well. That said, here's the changes that potentially break back-compat: - Removed using `prototype` props for default config values. - Removed `handlebarsVersion` from instances and `getHandlebarsSemver` static function on the `ExpressHandlebars` constructor. - Replaced undocumented `compileTemplate()` hook with the protected but supported `_compileTemplate()` and `_precompileTemplate()` hooks.
- Loading branch information
Showing
4 changed files
with
109 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters