Skip to content

Commit 72e31d9

Browse files
committed
Cleanup unused options
This is cleanup as an extension to #749. These options stopped really being used at that point. In the unused options is a complete evaluated copy of the whole ember-template-compiler.js, which is how I noticed this. Loading all that is unnecessary work.
1 parent 60d499b commit 72e31d9

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

lib/ember-addon-main.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,9 @@ module.exports = {
5858
return this._cachedShouldColocateTemplates;
5959
},
6060

61-
// This method is monkey patched by CSS Blocks,
62-
// Please coordinate with @chriseppstein if you need to change it.
63-
transpileTree(inputTree, htmlbarsOptions) {
61+
transpileTree(inputTree) {
6462
const TemplateCompiler = require('./template-compiler-plugin');
65-
66-
return new TemplateCompiler(inputTree, htmlbarsOptions, this._requiresModuleApiPolyfill);
63+
return new TemplateCompiler(inputTree);
6764
},
6865

6966
setupPreprocessorRegistry(type, registry) {
@@ -85,7 +82,6 @@ module.exports = {
8582
);
8683

8784
let shouldColocateTemplates = this._addon._shouldColocateTemplates();
88-
let htmlbarsOptions = this._addon.htmlbarsOptions();
8985

9086
let inputTree = debugTree(tree, '01-input');
9187

@@ -95,14 +91,7 @@ module.exports = {
9591
inputTree = debugTree(new ColocatedTemplateProcessor(inputTree), '02-colocated-output');
9692
}
9793

98-
this._addon.logger.debug(`setup *.hbs compiler with ${htmlbarsOptions.pluginNames}`);
99-
let output = debugTree(
100-
this._addon.transpileTree(inputTree, {
101-
isProduction,
102-
...htmlbarsOptions,
103-
}),
104-
'03-output'
105-
);
94+
let output = debugTree(this._addon.transpileTree(inputTree), '03-output');
10695

10796
let checker = new VersionChecker(this._addon.project).for('ember-cli', 'npm');
10897
let requiresBabelTree = checker.lt('3.13.0');

lib/template-compiler-plugin.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ const Filter = require('broccoli-persistent-filter');
44
const jsStringEscape = require('js-string-escape');
55

66
class TemplateCompiler extends Filter {
7-
constructor(inputTree, options = {}) {
8-
if (!('persist' in options)) {
9-
options.persist = true;
10-
}
11-
super(inputTree, options);
7+
constructor(inputTree) {
8+
super(inputTree, { persist: true });
129
}
1310

1411
baseDir() {

0 commit comments

Comments
 (0)