diff --git a/lib/ember-addon-main.js b/lib/ember-addon-main.js index 1502734b..ea2e625a 100644 --- a/lib/ember-addon-main.js +++ b/lib/ember-addon-main.js @@ -83,6 +83,7 @@ module.exports = { inputTree = debugTree(new ColocatedTemplateProcessor(inputTree), '02-colocated-output'); } + this._addon.logger.debug(`setup *.hbs compiler with ${htmlbarsOptions.pluginNames}`); const TemplateCompiler = require('./template-compiler-plugin'); return debugTree(new TemplateCompiler(inputTree, htmlbarsOptions), '03-output'); }, @@ -152,7 +153,9 @@ module.exports = { let templateCompilerPath = this.templateCompilerPath(); if (pluginInfo.canParallelize) { - this.logger.debug('using parallel API with for babel inline precompilation plugin'); + this.logger.debug( + `using babel inline precompilation plugin (parallelized) with ${pluginInfo.pluginNames}` + ); let htmlbarsInlinePrecompilePlugin = utils.buildParalleizedBabelPlugin( pluginInfo, @@ -161,7 +164,9 @@ module.exports = { babelPlugins.push(htmlbarsInlinePrecompilePlugin); } else { - this.logger.debug('NOT using parallel API with for babel inline precompilation plugin'); + this.logger.debug( + `using babel inline precompilation plugin (NON-parallelized) with ${pluginInfo.pluginNames}` + ); this.logger.debug('Prevented by these plugins: ' + pluginInfo.unparallelizableWrappers); let htmlBarsPlugin = utils.setup(pluginInfo, { diff --git a/lib/utils.js b/lib/utils.js index ceb9aacd..80c7015f 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -85,6 +85,7 @@ function buildOptions(projectConfig, templateCompilerPath, pluginInfo) { templateCompiler: require(templateCompilerPath), templateCompilerPath: templateCompilerPath, + pluginNames: pluginInfo.pluginNames, plugins: { ast: pluginInfo.plugins, }, @@ -220,6 +221,7 @@ function makeCacheKey(templateCompilerPath, pluginInfo, extra) { function setupPlugins(wrappers) { let plugins = []; let cacheKeys = []; + let pluginNames = []; let parallelConfigs = []; let unparallelizableWrappers = []; let dependencyInvalidation = false; @@ -233,6 +235,8 @@ function setupPlugins(wrappers) { wrapper = plugin[wrapper.buildUsing](wrapper.params); } + pluginNames.push(wrapper.name ? wrapper.name : 'unknown plugin'); + if (wrapper.parallelBabel) { parallelConfigs.push(wrapper.parallelBabel); } else { @@ -267,6 +271,7 @@ function setupPlugins(wrappers) { return { plugins, + pluginNames, cacheKeys, parallelConfigs, canParallelize, diff --git a/node-tests/utils_test.js b/node-tests/utils_test.js index 994494dc..c7900b91 100644 --- a/node-tests/utils_test.js +++ b/node-tests/utils_test.js @@ -42,6 +42,7 @@ describe('utils', function () { assert.deepStrictEqual(actual, { plugins: [], + pluginNames: [], cacheKeys: [], parallelConfigs: [], canParallelize: true, @@ -53,6 +54,7 @@ describe('utils', function () { it('canParallelize for 1+ plugins with "parallelBabel" property', function () { let pluginWrappers = [ { + name: 'first', plugin() {}, cacheKey() { return this.parallelBabel; @@ -60,6 +62,7 @@ describe('utils', function () { parallelBabel: 'something', }, { + name: 'second', plugin() {}, cacheKey() { return this.parallelBabel; @@ -72,6 +75,7 @@ describe('utils', function () { assert.deepStrictEqual(actual, { plugins: pluginWrappers.map((w) => w.plugin), + pluginNames: ['first', 'second'], cacheKeys: ['something', 'something else'], parallelConfigs: ['something', 'something else'], canParallelize: true, @@ -103,6 +107,7 @@ describe('utils', function () { assert.deepStrictEqual(actual, { plugins: pluginWrappers.map((w) => w.plugin), + pluginNames: ['first', 'second'], cacheKeys: ['something', 'something else'], parallelConfigs: ['something'], canParallelize: false,