Skip to content

Commit

Permalink
Cleanup unused options
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ef4 committed Dec 20, 2023
1 parent 60d499b commit 72e31d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
17 changes: 3 additions & 14 deletions lib/ember-addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,9 @@ module.exports = {
return this._cachedShouldColocateTemplates;
},

// This method is monkey patched by CSS Blocks,
// Please coordinate with @chriseppstein if you need to change it.
transpileTree(inputTree, htmlbarsOptions) {
transpileTree(inputTree) {
const TemplateCompiler = require('./template-compiler-plugin');

return new TemplateCompiler(inputTree, htmlbarsOptions, this._requiresModuleApiPolyfill);
return new TemplateCompiler(inputTree);
},

setupPreprocessorRegistry(type, registry) {
Expand All @@ -85,7 +82,6 @@ module.exports = {
);

let shouldColocateTemplates = this._addon._shouldColocateTemplates();
let htmlbarsOptions = this._addon.htmlbarsOptions();

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

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

this._addon.logger.debug(`setup *.hbs compiler with ${htmlbarsOptions.pluginNames}`);
let output = debugTree(
this._addon.transpileTree(inputTree, {
isProduction,
...htmlbarsOptions,
}),
'03-output'
);
let output = debugTree(this._addon.transpileTree(inputTree), '03-output');

let checker = new VersionChecker(this._addon.project).for('ember-cli', 'npm');
let requiresBabelTree = checker.lt('3.13.0');
Expand Down
7 changes: 2 additions & 5 deletions lib/template-compiler-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ const Filter = require('broccoli-persistent-filter');
const jsStringEscape = require('js-string-escape');

class TemplateCompiler extends Filter {
constructor(inputTree, options = {}) {
if (!('persist' in options)) {
options.persist = true;
}
super(inputTree, options);
constructor(inputTree) {
super(inputTree, { persist: true });
}

baseDir() {
Expand Down

0 comments on commit 72e31d9

Please sign in to comment.