diff --git a/packages/spacebars-tests/template_tests.js b/packages/spacebars-tests/template_tests.js index 3db4c1674e..c96153c4cb 100644 --- a/packages/spacebars-tests/template_tests.js +++ b/packages/spacebars-tests/template_tests.js @@ -675,6 +675,7 @@ Tinytest.add('spacebars - templates - no data context', function (test) { Tinytest.add('spacebars - templates - isolate', function (test) { var tmpl = Template.spacebars_template_test_isolate; + Meteor._suppress_log(1); // we print a deprecation notice var div = renderToDiv(tmpl); test.equal(canonicalizeHtml(div.innerHTML), 'hello'); @@ -684,6 +685,7 @@ Tinytest.add('spacebars - templates - isolate', function (test) { Tinytest.add('spacebars - templates - constant', function (test) { var tmpl = Template.spacebars_template_test_constant; + Meteor._suppress_log(1); // we print a deprecation notice var div = renderToDiv(tmpl); test.equal(canonicalizeHtml(div.innerHTML), 'hello'); diff --git a/packages/ui/base.js b/packages/ui/base.js index 9b41ca0864..4352cfa96c 100644 --- a/packages/ui/base.js +++ b/packages/ui/base.js @@ -348,4 +348,6 @@ UI.Component.notifyParented = function () { }; // past compat -UI.Component.preserve = function () {}; +UI.Component.preserve = function () { + Meteor._debug("The 'preserve' method on templates is now unnecessary and deprecated."); +}; diff --git a/packages/ui/fields.js b/packages/ui/fields.js index fe454067f2..b95a13b9b1 100644 --- a/packages/ui/fields.js +++ b/packages/ui/fields.js @@ -12,20 +12,23 @@ var lookupComponentProp = function (comp, prop) { }; // Component that's a no-op when used as a block helper like -// `{{#foo}}...{{/foo}}`. -var noOpComponent = Component.extend({ - kind: 'NoOp', - render: function () { - return this.__content; - } -}); +// `{{#foo}}...{{/foo}}`. Prints a warning that it is deprecated. +var noOpComponent = function (name) { + return Component.extend({ + kind: 'NoOp', + render: function () { + Meteor._debug("{{#" + name + "}} is now unnecessary and deprecated."); + return this.__content; + } + }); +}; // This map is searched first when you do something like `{{#foo}}` in // a template. var builtInComponents = { // for past compat: - 'constant': noOpComponent, - 'isolate': noOpComponent + 'constant': noOpComponent("constant"), + 'isolate': noOpComponent("isolate") }; _extend(UI.Component, {