diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3231313c080..702d9f53e78 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Ember Changelog
+### v3.5.0-beta.4 (Unreleased)
+
+- [#17003](https://github.com/emberjs/ember.js/pull/17003) [BUGFIX] Fix rendering of empty content with `{{{...}}}` and `htmlSafe`
+
### v3.5.0-beta.3 (September 24, 2018)
- [#16978](https://github.com/emberjs/ember.js/pull/16978) [BUGFIX] Properly teardown alias
@@ -15,6 +19,10 @@
- [#16877](https://github.com/emberjs/ember.js/pull/16877) [CLEANUP] Allow routes to be named "array" and "object"
- [#16907](https://github.com/emberjs/ember.js/pull/16907) Upgrade to TypeScript 3.0
+### v3.4.3 (September 25, 2018)
+
+- [#17003](https://github.com/emberjs/ember.js/pull/17003) [BUGFIX] Fix rendering of empty content with `{{{...}}}` and `htmlSafe`
+
### v3.4.2 (September 24, 2018)
- [#16860](https://github.com/emberjs/ember.js/pull/16860) [BUGFIX] Clear chains in ProxyMixin when destroyed
@@ -48,7 +56,7 @@
- [#16836](https://github.com/emberjs/ember.js/pull/16836/commits) [DOC] Fix Broken 3.3 API Documentation
-### v3.3.0 (July 16, 2018)
+### v3.3.0 (July 16, 2018)
- [#16687](https://github.com/emberjs/ember.js/pull/16687) [FEATURE] Implement optional jQuery integration (see [emberjs/rfcs#294](https://github.com/emberjs/rfcs/blob/master/text/0294-optional-jquery.md) for more details).
- [#16690](https://github.com/emberjs/ember.js/pull/16690) [DEPRECATION] [emberjs/rfcs#294](emberjs/rfcs#294) Deprecate accessing `jQuery.Event#originalEvent`.
diff --git a/package.json b/package.json
index 2ca2d207df4..9b28a0de784 100644
--- a/package.json
+++ b/package.json
@@ -66,14 +66,14 @@
"resolve": "^1.6.0"
},
"devDependencies": {
- "@glimmer/compiler": "^0.35.8",
+ "@glimmer/compiler": "^0.35.9",
"@glimmer/env": "^0.1.7",
- "@glimmer/interfaces": "^0.35.8",
- "@glimmer/node": "^0.35.8",
- "@glimmer/opcode-compiler": "^0.35.8",
- "@glimmer/program": "^0.35.8",
- "@glimmer/reference": "^0.35.8",
- "@glimmer/runtime": "^0.35.8",
+ "@glimmer/interfaces": "^0.35.9",
+ "@glimmer/node": "^0.35.9",
+ "@glimmer/opcode-compiler": "^0.35.9",
+ "@glimmer/program": "^0.35.9",
+ "@glimmer/reference": "^0.35.9",
+ "@glimmer/runtime": "^0.35.9",
"@types/qunit": "^2.5.0",
"@types/rsvp": "^4.0.1",
"amd-name-resolver": "^1.2.0",
diff --git a/packages/ember-glimmer/tests/integration/application/rendering-test.js b/packages/ember-glimmer/tests/integration/application/rendering-test.js
index 2e2966c7b04..c831a3983a4 100644
--- a/packages/ember-glimmer/tests/integration/application/rendering-test.js
+++ b/packages/ember-glimmer/tests/integration/application/rendering-test.js
@@ -503,5 +503,28 @@ moduleFor(
}, expectedBacktrackingMessage);
});
}
+
+ ['@test route templates with {{{undefined}}} [GH#14924] [GH#16172]']() {
+ this.router.map(function() {
+ this.route('first');
+ this.route('second');
+ });
+
+ this.addTemplate('first', 'first');
+ this.addTemplate('second', '{{{undefined}}}second');
+
+ return this.visit('/first')
+ .then(() => {
+ this.assertText('first');
+ return this.visit('/second');
+ })
+ .then(() => {
+ this.assertText('second');
+ return this.visit('/first');
+ })
+ .then(() => {
+ this.assertText('first');
+ });
+ }
}
);
diff --git a/packages/ember-glimmer/tests/integration/content-test.js b/packages/ember-glimmer/tests/integration/content-test.js
index df881e16d56..8fcc6d6ae4e 100644
--- a/packages/ember-glimmer/tests/integration/content-test.js
+++ b/packages/ember-glimmer/tests/integration/content-test.js
@@ -702,6 +702,22 @@ moduleFor(
this.assertTextNode(this.firstChild, content);
// this.takeSnapshot();
}
+
+ ['@test it can render empty safe strings [GH#16314]']() {
+ this.render('before {{value}} after', { value: htmlSafe('hello') });
+
+ this.assertHTML('before hello after');
+
+ this.assertStableRerender();
+
+ this.runTask(() => set(this.context, 'value', htmlSafe('')));
+
+ this.assertHTML('before after');
+
+ this.runTask(() => set(this.context, 'value', htmlSafe('hello')));
+
+ this.assertHTML('before hello after');
+ }
}
);
@@ -818,6 +834,50 @@ moduleFor(
this.assertContent('MaxJames');
}
+
+ ['@test empty content in trusted curlies [GH#14978]']() {
+ this.render('before {{{value}}} after', {
+ value: 'hello',
+ });
+
+ this.assertContent('before hello after');
+
+ this.runTask(() => this.rerender());
+
+ this.assertStableRerender();
+
+ this.runTask(() => set(this.context, 'value', undefined));
+
+ this.assertContent('before after');
+
+ this.runTask(() => set(this.context, 'value', 'hello'));
+
+ this.assertContent('before hello after');
+
+ this.runTask(() => set(this.context, 'value', null));
+
+ this.assertContent('before after');
+
+ this.runTask(() => set(this.context, 'value', 'hello'));
+
+ this.assertContent('before hello after');
+
+ this.runTask(() => set(this.context, 'value', ''));
+
+ this.assertContent('before after');
+
+ this.runTask(() => set(this.context, 'value', 'hello'));
+
+ this.assertContent('before hello after');
+
+ this.runTask(() => set(this.context, 'value', htmlSafe('')));
+
+ this.assertContent('before after');
+
+ this.runTask(() => set(this.context, 'value', 'hello'));
+
+ this.assertContent('before hello after');
+ }
}
);
diff --git a/packages/ember-glimmer/tests/integration/syntax/each-test.js b/packages/ember-glimmer/tests/integration/syntax/each-test.js
index 27e639e8464..7bfd42e0d43 100644
--- a/packages/ember-glimmer/tests/integration/syntax/each-test.js
+++ b/packages/ember-glimmer/tests/integration/syntax/each-test.js
@@ -2,7 +2,7 @@ import { get, set, notifyPropertyChange } from 'ember-metal';
import { applyMixins, strip } from '../../utils/abstract-test-case';
import { moduleFor, RenderingTest } from '../../utils/test-case';
import { A as emberA, ArrayProxy, RSVP } from 'ember-runtime';
-import { Component } from '../../utils/helpers';
+import { Component, htmlSafe } from '../../utils/helpers';
import { HAS_NATIVE_SYMBOL } from 'ember-utils';
import {
@@ -827,6 +827,32 @@ class EachTest extends AbstractEachTest {
this.assertText('');
}
+ ['@test empty trusted content clears properly [GH#16314]']() {
+ this.makeList(['hello']);
+
+ this.render(`before {{#each list as |value|}}{{{value}}}{{/each}} after`);
+
+ this.assertText('before hello after');
+
+ this.assertStableRerender();
+
+ this.runTask(() => this.pushObjects([null, ' world']));
+
+ this.assertText('before hello world after');
+
+ this.runTask(() => this.replace(1, 2, [undefined, ' world!']));
+
+ this.assertText('before hello world! after');
+
+ this.runTask(() => this.replace(1, 2, [htmlSafe(''), ' world!!']));
+
+ this.assertText('before hello world!! after');
+
+ this.replaceList(['hello']);
+
+ this.assertText('before hello after');
+ }
+
/* multi each */
['@test re-using the same variable with different {{#each}} blocks does not override each other']() {
diff --git a/yarn.lock b/yarn.lock
index 6094410541b..318a99e08a7 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,105 +2,105 @@
# yarn lockfile v1
-"@glimmer/compiler@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.35.8.tgz#1096f8d1abfbe2101c454bce476a6e829a3776a9"
+"@glimmer/compiler@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/compiler/-/compiler-0.35.9.tgz#3342f6249826258e1428e0566b21f64f878bce51"
dependencies:
- "@glimmer/interfaces" "^0.35.8"
- "@glimmer/syntax" "^0.35.8"
- "@glimmer/util" "^0.35.8"
- "@glimmer/wire-format" "^0.35.8"
+ "@glimmer/interfaces" "^0.35.9"
+ "@glimmer/syntax" "^0.35.9"
+ "@glimmer/util" "^0.35.9"
+ "@glimmer/wire-format" "^0.35.9"
-"@glimmer/encoder@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.35.8.tgz#ce57a9d60e49e2faef987c6cb22c31fb78bb0a48"
+"@glimmer/encoder@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/encoder/-/encoder-0.35.9.tgz#4aff747cc62c334eba7ed8918ed86c70b2d4f606"
"@glimmer/env@^0.1.7":
version "0.1.7"
resolved "https://registry.yarnpkg.com/@glimmer/env/-/env-0.1.7.tgz#fd2d2b55a9029c6b37a6c935e8c8871ae70dfa07"
-"@glimmer/interfaces@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.35.8.tgz#bd82fcb0a77959b17d5adeaf561fea9dfb3b9a9a"
+"@glimmer/interfaces@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.35.9.tgz#26b4fa0f2acfcab3b4309826068292a9e7a006df"
dependencies:
- "@glimmer/wire-format" "^0.35.8"
+ "@glimmer/wire-format" "^0.35.9"
-"@glimmer/low-level@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.35.8.tgz#0c16ed531a8d14b57a86862768f10072de876dfe"
+"@glimmer/low-level@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/low-level/-/low-level-0.35.9.tgz#9d2e755d39cbdc4161f0110ee55ba59d9245d342"
-"@glimmer/node@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.35.8.tgz#7ab3fbc114cf1a7b3d0c60db936c80c8b60c0af3"
+"@glimmer/node@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/node/-/node-0.35.9.tgz#1a9cb7333eacd007bc1882b3d5d20e0e575864a5"
dependencies:
- "@glimmer/interfaces" "^0.35.8"
- "@glimmer/runtime" "^0.35.8"
+ "@glimmer/interfaces" "^0.35.9"
+ "@glimmer/runtime" "^0.35.9"
simple-dom "^0.3.0"
-"@glimmer/opcode-compiler@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.35.8.tgz#85728a11d33d66c5cc06b8a4cb8a61771e6dc1db"
- dependencies:
- "@glimmer/encoder" "^0.35.8"
- "@glimmer/interfaces" "^0.35.8"
- "@glimmer/program" "^0.35.8"
- "@glimmer/reference" "^0.35.8"
- "@glimmer/util" "^0.35.8"
- "@glimmer/vm" "^0.35.8"
- "@glimmer/wire-format" "^0.35.8"
-
-"@glimmer/program@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.35.8.tgz#3dbf9b85a9c1b12fdaaf9fc2036c280e16df395f"
- dependencies:
- "@glimmer/encoder" "^0.35.8"
- "@glimmer/interfaces" "^0.35.8"
- "@glimmer/util" "^0.35.8"
-
-"@glimmer/reference@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.35.8.tgz#95283835698bc7ee5fef6208b9dc66c2bbad8a71"
- dependencies:
- "@glimmer/util" "^0.35.8"
-
-"@glimmer/runtime@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.35.8.tgz#4aaabe3682b01c77f47b95768b74d70d9e64d2a6"
- dependencies:
- "@glimmer/interfaces" "^0.35.8"
- "@glimmer/low-level" "^0.35.8"
- "@glimmer/program" "^0.35.8"
- "@glimmer/reference" "^0.35.8"
- "@glimmer/util" "^0.35.8"
- "@glimmer/vm" "^0.35.8"
- "@glimmer/wire-format" "^0.35.8"
-
-"@glimmer/syntax@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.35.8.tgz#52fa3075514851f5ffc2ea629d35716c9eebb7f2"
- dependencies:
- "@glimmer/interfaces" "^0.35.8"
- "@glimmer/util" "^0.35.8"
+"@glimmer/opcode-compiler@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/opcode-compiler/-/opcode-compiler-0.35.9.tgz#402c8618fc3c84650be8d91d25ab0b25da0177af"
+ dependencies:
+ "@glimmer/encoder" "^0.35.9"
+ "@glimmer/interfaces" "^0.35.9"
+ "@glimmer/program" "^0.35.9"
+ "@glimmer/reference" "^0.35.9"
+ "@glimmer/util" "^0.35.9"
+ "@glimmer/vm" "^0.35.9"
+ "@glimmer/wire-format" "^0.35.9"
+
+"@glimmer/program@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/program/-/program-0.35.9.tgz#57ceda2c5f7b4df64f417880724afa3d321eecde"
+ dependencies:
+ "@glimmer/encoder" "^0.35.9"
+ "@glimmer/interfaces" "^0.35.9"
+ "@glimmer/util" "^0.35.9"
+
+"@glimmer/reference@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/reference/-/reference-0.35.9.tgz#10e2ca42ef1b92ad195ce4d6b305bf256325fbb6"
+ dependencies:
+ "@glimmer/util" "^0.35.9"
+
+"@glimmer/runtime@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/runtime/-/runtime-0.35.9.tgz#d2358046e9d13c983180ff79734ac5d0d39fe310"
+ dependencies:
+ "@glimmer/interfaces" "^0.35.9"
+ "@glimmer/low-level" "^0.35.9"
+ "@glimmer/program" "^0.35.9"
+ "@glimmer/reference" "^0.35.9"
+ "@glimmer/util" "^0.35.9"
+ "@glimmer/vm" "^0.35.9"
+ "@glimmer/wire-format" "^0.35.9"
+
+"@glimmer/syntax@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.35.9.tgz#9710e3418d60436ce368acb4d3e9c7802defa6ca"
+ dependencies:
+ "@glimmer/interfaces" "^0.35.9"
+ "@glimmer/util" "^0.35.9"
handlebars "^4.0.6"
simple-html-tokenizer "^0.5.5"
-"@glimmer/util@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.35.8.tgz#ec2d7aa4897b77ba96275bb2ea803c6c6dcf0eef"
+"@glimmer/util@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.35.9.tgz#59e8bbfb2bb7a764d0098be49d083c200d113a61"
-"@glimmer/vm@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.35.8.tgz#2db9a0f7cb94340640253da339f91b09546179c3"
+"@glimmer/vm@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/vm/-/vm-0.35.9.tgz#8c54c675a625384f7ff0539b47841d877acf6b9f"
dependencies:
- "@glimmer/interfaces" "^0.35.8"
- "@glimmer/program" "^0.35.8"
- "@glimmer/util" "^0.35.8"
+ "@glimmer/interfaces" "^0.35.9"
+ "@glimmer/program" "^0.35.9"
+ "@glimmer/util" "^0.35.9"
-"@glimmer/wire-format@^0.35.8":
- version "0.35.8"
- resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.35.8.tgz#61f58bce456f7c9aca0d338c31b91aa74b911911"
+"@glimmer/wire-format@^0.35.9":
+ version "0.35.9"
+ resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.35.9.tgz#96f0c302583da3311303458ae9634b7fc72db9f4"
dependencies:
- "@glimmer/util" "^0.35.8"
+ "@glimmer/util" "^0.35.9"
"@types/acorn@^4.0.3":
version "4.0.3"