Skip to content

Commit 6fa5784

Browse files
committed
Drop template deprecation gathering
This was broken long ago by a change in ember-cli-htmlbars. There is a plan to bring it back, but remove it for now since the codepath is not doing anything for most codebases.
1 parent f6cd0c4 commit 6fa5784

2 files changed

Lines changed: 0 additions & 147 deletions

File tree

generate-deprecations-tree.js

Lines changed: 0 additions & 54 deletions
This file was deleted.

index.js

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
module.exports = {
44
name: require('./package').name,
55

6-
init() {
7-
this._super.init && this._super.init.apply(this, arguments);
8-
9-
this._templateDeprecations = [];
10-
},
11-
126
_shouldInclude() {
137
// the presence of `this.app.tests` shows that we are in one of:
148
//
@@ -52,91 +46,4 @@ module.exports = {
5246

5347
return mergeTrees([tree, configTree], { overwrite: true });
5448
},
55-
56-
_findHtmlbarsPreprocessor(registry) {
57-
var plugins = registry.load('template');
58-
59-
return plugins.filter(function (plugin) {
60-
return plugin.name === 'ember-cli-htmlbars';
61-
})[0];
62-
},
63-
64-
_monkeyPatch_EmberDeprecate(htmlbarsCompilerPreprocessor) {
65-
if (!htmlbarsCompilerPreprocessor._addon) {
66-
// not a new enough ember-cli-htmlbars to monkey patch
67-
// we need 1.0.3
68-
return;
69-
}
70-
var addonContext = this;
71-
var originalHtmlbarsOptions =
72-
htmlbarsCompilerPreprocessor._addon.htmlbarsOptions;
73-
var logToNodeConsole = this.project.config(
74-
process.env.EMBER_ENV
75-
).logTemplateLintToConsole;
76-
77-
htmlbarsCompilerPreprocessor._addon.htmlbarsOptions = function () {
78-
var options = originalHtmlbarsOptions.apply(this, arguments);
79-
var Ember = options.templateCompiler._Ember;
80-
81-
if (Ember.Debug && Ember.Debug.registerDeprecationHandler) {
82-
Ember.Debug.registerDeprecationHandler(function (
83-
message,
84-
options,
85-
next
86-
) {
87-
addonContext._templateDeprecations.push({
88-
message: JSON.stringify(message),
89-
test: false,
90-
options: JSON.stringify(options),
91-
});
92-
93-
if (logToNodeConsole) {
94-
next();
95-
}
96-
});
97-
}
98-
99-
var originalDeprecate = options.templateCompiler._Ember.deprecate;
100-
Ember.deprecate = function (message, test, options) {
101-
var noDeprecation;
102-
103-
if (typeof test === 'function') {
104-
noDeprecation = test();
105-
} else {
106-
noDeprecation = test;
107-
}
108-
109-
if (!noDeprecation) {
110-
addonContext._templateDeprecations.push({
111-
message: JSON.stringify(message),
112-
test: !!test,
113-
options: JSON.stringify(options),
114-
});
115-
}
116-
117-
if (logToNodeConsole) {
118-
return originalDeprecate.apply(this, arguments);
119-
}
120-
};
121-
122-
return options;
123-
};
124-
},
125-
126-
setupPreprocessorRegistry(type, registry) {
127-
if (type === 'parent') {
128-
var htmlbarsCompilerPreprocessor =
129-
this._findHtmlbarsPreprocessor(registry);
130-
131-
this._monkeyPatch_EmberDeprecate(htmlbarsCompilerPreprocessor);
132-
}
133-
},
134-
135-
lintTree(type, tree) {
136-
if (type === 'template') {
137-
var TemplateLinter = require('./generate-deprecations-tree');
138-
139-
return new TemplateLinter(this, tree);
140-
}
141-
},
14249
};

0 commit comments

Comments
 (0)