mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Log deprecation notice for {{#isolate}}, {{#constant}}, preserve
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
@@ -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.");
|
||||
};
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user