ember-cli-htmlbars
Advanced tools
Comparing version 4.0.4 to 4.0.5
@@ -0,1 +1,12 @@ | ||
## v4.0.5 (2019-10-04) | ||
#### :bug: Bug Fix | ||
* [#324](https://github.com/ember-cli/ember-cli-htmlbars/pull/324) More fixes for proper babel plugin deduplication. ([@rwjblue](https://github.com/rwjblue)) | ||
#### :memo: Documentation | ||
* [#323](https://github.com/ember-cli/ember-cli-htmlbars/pull/323) Ensure deprecation message shows correct heirarchy. ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 1 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
## v4.0.4 (2019-10-02) | ||
@@ -2,0 +13,0 @@ |
@@ -94,4 +94,4 @@ 'use strict'; | ||
if (legacyInlinePrecompileAddon !== undefined) { | ||
let heirarchy = ['ember-cli-htmlbars-inline-precompile']; | ||
let pointer = this; | ||
let heirarchy = []; | ||
let pointer = legacyInlinePrecompileAddon; | ||
while (pointer.parent) { | ||
@@ -143,33 +143,11 @@ heirarchy.push(pointer.pkg.name); | ||
let modules = { | ||
'ember-cli-htmlbars': 'hbs', | ||
'ember-cli-htmlbars-inline-precompile': 'default', | ||
'htmlbars-inline-precompile': 'default', | ||
}; | ||
if (pluginInfo.canParallelize) { | ||
logger.debug('using parallel API with for babel inline precompilation plugin'); | ||
let parallelBabelInfo = { | ||
requireFile: path.join(__dirname, 'require-from-worker'), | ||
buildUsing: 'build', | ||
params: { | ||
templateCompilerPath, | ||
parallelConfigs: pluginInfo.parallelConfigs, | ||
modules, | ||
}, | ||
}; | ||
// parallelBabelInfo will not be used in the cache unless it is explicitly included | ||
let cacheKey = utils.makeCacheKey( | ||
templateCompilerPath, | ||
let htmlbarsInlinePrecompilePlugin = utils.buildParalleizedBabelPlugin( | ||
pluginInfo, | ||
JSON.stringify(parallelBabelInfo) | ||
templateCompilerPath | ||
); | ||
babelPlugins.push({ | ||
_parallelBabel: parallelBabelInfo, | ||
baseDir: () => __dirname, | ||
cacheKey: () => cacheKey, | ||
}); | ||
babelPlugins.push(htmlbarsInlinePrecompilePlugin); | ||
} else { | ||
@@ -182,3 +160,2 @@ logger.debug('NOT using parallel API with for babel inline precompilation plugin'); | ||
templateCompilerPath, | ||
modules, | ||
}); | ||
@@ -185,0 +162,0 @@ |
@@ -10,2 +10,8 @@ 'use strict'; | ||
const INLINE_PRECOMPILE_MODULES = Object.freeze({ | ||
'ember-cli-htmlbars': 'hbs', | ||
'ember-cli-htmlbars-inline-precompile': 'default', | ||
'htmlbars-inline-precompile': 'default', | ||
}); | ||
function isInlinePrecompileBabelPluginRegistered(plugins) { | ||
@@ -44,2 +50,23 @@ return plugins.some(plugin => { | ||
function buildParalleizedBabelPlugin(pluginInfo, templateCompilerPath) { | ||
let parallelBabelInfo = { | ||
requireFile: require.resolve('./require-from-worker'), | ||
buildUsing: 'build', | ||
params: { | ||
templateCompilerPath, | ||
parallelConfigs: pluginInfo.parallelConfigs, | ||
modules: INLINE_PRECOMPILE_MODULES, | ||
}, | ||
}; | ||
// parallelBabelInfo will not be used in the cache unless it is explicitly included | ||
let cacheKey = makeCacheKey(templateCompilerPath, pluginInfo, JSON.stringify(parallelBabelInfo)); | ||
return { | ||
_parallelBabel: parallelBabelInfo, | ||
baseDir: () => __dirname, | ||
cacheKey: () => cacheKey, | ||
}; | ||
} | ||
function buildOptions(projectConfig, templateCompilerPath, pluginInfo) { | ||
@@ -176,3 +203,3 @@ let EmberENV = projectConfig.EmberENV || {}; | ||
require.resolve('babel-plugin-htmlbars-inline-precompile'), | ||
{ precompile, modules: options.modules }, | ||
{ precompile, modules: INLINE_PRECOMPILE_MODULES }, | ||
'ember-cli-htmlbars:inline-precompile', | ||
@@ -262,2 +289,3 @@ ]; | ||
isInlinePrecompileBabelPluginRegistered, | ||
buildParalleizedBabelPlugin, | ||
}; |
{ | ||
"name": "ember-cli-htmlbars", | ||
"version": "4.0.4", | ||
"version": "4.0.5", | ||
"description": "A library for adding htmlbars to ember CLI", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41393
782