diff --git a/components/bower.json b/components/bower.json index 82d7ad1d..55eca01a 100644 --- a/components/bower.json +++ b/components/bower.json @@ -1,6 +1,6 @@ { "name": "handlebars", - "version": "4.0.7", + "version": "4.0.8", "main": "handlebars.js", "license": "MIT", "dependencies": {} diff --git a/components/handlebars.js.nuspec b/components/handlebars.js.nuspec index 1a785122..8de33981 100644 --- a/components/handlebars.js.nuspec +++ b/components/handlebars.js.nuspec @@ -2,7 +2,7 @@ handlebars.js - 4.0.7 + 4.0.8 handlebars.js Authors https://github.com/wycats/handlebars.js/blob/master/LICENSE https://github.com/wycats/handlebars.js/ diff --git a/lib/handlebars/base.js b/lib/handlebars/base.js index 615661e2..a684797c 100644 --- a/lib/handlebars/base.js +++ b/lib/handlebars/base.js @@ -4,7 +4,7 @@ import {registerDefaultHelpers} from './helpers'; import {registerDefaultDecorators} from './decorators'; import logger from './logger'; -export const VERSION = '4.0.7'; +export const VERSION = '4.0.8'; export const COMPILER_REVISION = 7; export const REVISION_CHANGES = { diff --git a/lib/handlebars/runtime.js b/lib/handlebars/runtime.js index 583d4350..60f8e244 100644 --- a/lib/handlebars/runtime.js +++ b/lib/handlebars/runtime.js @@ -221,7 +221,8 @@ export function invokePartial(partial, context, options) { options.data = createFrame(options.data); // Wrapper function to get access to currentPartialBlock from the closure let fn = options.fn; - partialBlock = options.data['partial-block'] = function partialBlockWrapper(context, options) { + partialBlock = options.data['partial-block'] = function partialBlockWrapper(context, options = {}) { + // Restore the partial-block from the closure for the execution of the block // i.e. the part inside the block of the partial call. options.data = createFrame(options.data); diff --git a/release-notes.md b/release-notes.md index b4d3ec07..36bec789 100644 --- a/release-notes.md +++ b/release-notes.md @@ -2,7 +2,15 @@ ## Development -[Commits](https://github.com/nknapp/handlebars.js/compare/v4.0.7...master) +[Commits](https://github.com/nknapp/handlebars.js/compare/v4.0.8...master) + +## v4.0.8 - May 2nd, 2017 +- [#1341](https://github.com/wycats/handlebars.js/issues/1341) [#1342](https://github.com/wycats/handlebars.js/issues/1342) Allow partial-blocks to be executed without "options" ([@nknapp](https://github.com/nknapp)) - a00c598 + +Compatibility notes: +- No breaking changes + +[Commits](https://github.com/nknapp/handlebars.js/compare/v4.0.7...v4.0.8) ## v4.0.7 - April 29th, 2017 - [#1319](https://github.com/wycats/handlebars.js/issues/1319): Fix context-stack when calling block-helpers on null values ([@nknapp](https://github.com/nknapp)) - c8f4b57 diff --git a/spec/regressions.js b/spec/regressions.js index e922169d..d51765c1 100644 --- a/spec/regressions.js +++ b/spec/regressions.js @@ -293,4 +293,13 @@ describe('Regressions', function() { var string = '{{#each list}}{{#unless ./prop}}parent={{../value}} {{/unless}}{{/each}}'; shouldCompileTo(string, { value: 'parent', list: [ null, 'a'] }, 'parent=parent parent=parent ', ''); }); + + it('GH-1341: 4.0.7 release breaks {{#if @partial-block}} usage', function() { + var string = 'template {{>partial}} template'; + var partials = { + partialWithBlock: '{{#if @partial-block}} block {{> @partial-block}} block {{/if}}', + partial: '{{#> partialWithBlock}} partial {{/partialWithBlock}}' + }; + shouldCompileToWithPartials(string, [{}, {}, partials], true, 'template block partial block template'); + }); }); diff --git a/tasks/publish.js b/tasks/publish.js index 55ea20a7..38039c6d 100644 --- a/tasks/publish.js +++ b/tasks/publish.js @@ -15,14 +15,22 @@ module.exports = function(grunt) { git.commitInfo(function(err, info) { grunt.log.writeln('tag: ' + info.tagName); + var files = []; + + // Publish the master as "latest" and with the commit-id if (info.isMaster) { + files.push('-latest'); + files.push('-' + info.head); + } + + // Publish tags by their tag-name + if (info.tagName && semver.valid(info.tagName)) { + files.push('-' + info.tagName); + } + + if (files.length > 0) { initSDK(); - - var files = ['-latest', '-' + info.head]; - if (info.tagName && semver.valid(info.tagName)) { - files.push('-' + info.tagName); - } - + grunt.log.writeln('publishing files: ' + JSON.stringify(files)); publish(fileMap(files), done); } else { // Silently ignore for branches