Skip to content

Commit

Permalink
Merge pull request #357 from mydea/update-babel-plugin-ember-modules-…
Browse files Browse the repository at this point in the history
…api-polyfill
  • Loading branch information
rwjblue authored Jul 30, 2020
2 parents a869cce + 8ab9d45 commit ade2188
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ a shared module, reducing app size overall. This option is available _only_ to
the root application, because it is a global configuration value due to the fact
that there can only be one version of helpers included.

Note that there is currently no way to whitelist or blacklist helpers, so all
Note that there is currently no way to allow or ignore helpers, so all
helpers will be included, even ones which are not used. If your app is small,
this could add to overall build size, so be sure to check.

Expand Down Expand Up @@ -233,7 +233,7 @@ let app = new EmberApp(defaults, {
#### Modules

Older versions of Ember CLI (`< 2.12`) use its own ES6 module transpiler.
Because of that, this plugin disables Babel module compilation by blacklisting
Because of that, this plugin disables Babel module compilation by ignoring
that transform when running under affected ember-cli versions. If you find that
you want to use the Babel module transform instead of the Ember CLI one, you'll
have to explicitly set `compileModules` to `true` in your configuration. If
Expand Down
22 changes: 11 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,9 @@ module.exports = {
if (addonOptions.disableEmberModulesAPIPolyfill) { return; }

if (this._emberVersionRequiresModulesAPIPolyfill()) {
const blacklist = this._getEmberModulesAPIBlacklist();
const ignore = this._getEmberModulesAPIIgnore();

return [[require.resolve('babel-plugin-ember-modules-api-polyfill'), { blacklist }]];
return [[require.resolve('babel-plugin-ember-modules-api-polyfill'), { ignore }]];
}
},

Expand Down Expand Up @@ -607,26 +607,26 @@ module.exports = {
return false;
},

_getEmberModulesAPIBlacklist() {
const blacklist = {
_getEmberModulesAPIIgnore() {
const ignore = {
'@ember/debug': ['assert', 'deprecate', 'warn'],
'@ember/application/deprecations': ['deprecate'],
};

if (this._shouldBlacklistEmberString()) {
blacklist['@ember/string'] = [
if (this._shouldIgnoreEmberString()) {
ignore['@ember/string'] = [
'fmt', 'loc', 'w',
'decamelize', 'dasherize', 'camelize',
'classify', 'underscore', 'capitalize',
'setStrings', 'getStrings', 'getString'
];
}

if (this._shouldBlacklistJQuery()) {
blacklist['jquery'] = ['default'];
if (this._shouldIgnoreJQuery()) {
ignore['jquery'] = ['default'];
}

return blacklist;
return ignore;
},

_isProjectName(dependency) {
Expand All @@ -640,7 +640,7 @@ module.exports = {
)
},

_shouldBlacklistEmberString() {
_shouldIgnoreEmberString() {
let packageName = '@ember/string';
if (this._isProjectName(packageName)) { return true; }
if (this._isTransitiveDependency(packageName)) { return false; }
Expand All @@ -650,7 +650,7 @@ module.exports = {
return checker.exists();
},

_shouldBlacklistJQuery() {
_shouldIgnoreJQuery() {
let packageName = '@ember/jquery';
if (this._isProjectName(packageName)) { return true; }
if (this._isTransitiveDependency(packageName)) { return false; }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"amd-name-resolver": "^1.2.1",
"babel-plugin-debug-macros": "^0.3.3",
"babel-plugin-ember-data-packages-polyfill": "^0.1.2",
"babel-plugin-ember-modules-api-polyfill": "^2.13.4",
"babel-plugin-ember-modules-api-polyfill": "^3.0.0",
"babel-plugin-module-resolver": "^3.1.1",
"broccoli-babel-transpiler": "^7.5.0",
"broccoli-debug": "^0.6.4",
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2204,13 +2204,20 @@ babel-plugin-ember-data-packages-polyfill@^0.1.2:
dependencies:
"@ember-data/rfc395-data" "^0.0.4"

babel-plugin-ember-modules-api-polyfill@^2.12.0, babel-plugin-ember-modules-api-polyfill@^2.13.4, babel-plugin-ember-modules-api-polyfill@^2.6.0:
babel-plugin-ember-modules-api-polyfill@^2.12.0, babel-plugin-ember-modules-api-polyfill@^2.6.0:
version "2.13.4"
resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-2.13.4.tgz#cf62bc9bfd808c48d810d5194f4329e9453bd603"
integrity sha512-uxQPkEQAzCYdwhZk16O9m1R4xtCRNy4oEUTBrccOPfzlIahRZJic/JeP/ZEL0BC6Mfq6r55eOg6gMF/zdFoCvA==
dependencies:
ember-rfc176-data "^0.3.13"

babel-plugin-ember-modules-api-polyfill@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-3.0.0.tgz#570e5992fda2516a933b8a512925e36a1ce1908c"
integrity sha512-enuGb9M4XYX2+OwfhoergyHqyYMj9btcWgX7f7Mq2k23ULGmj7wWU76AxwbhhT0dodjL6j5mju41Kh3Hm18uZA==
dependencies:
ember-rfc176-data "^0.3.13"

babel-plugin-htmlbars-inline-precompile@^0.2.5:
version "0.2.6"
resolved "https://registry.yarnpkg.com/babel-plugin-htmlbars-inline-precompile/-/babel-plugin-htmlbars-inline-precompile-0.2.6.tgz#c00b8a3f4b32ca04bf0f0d5169fcef3b5a66d69d"
Expand Down

0 comments on commit ade2188

Please sign in to comment.