diff --git a/package.json b/package.json index 8a4a7f5b8ca..60c27cc8b36 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "debug": "^4.1.1", "ember-cli": "~3.26.1", "ember-cli-app-version": "^5.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-blueprint-test-helpers": "^0.19.1", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-htmlbars": "^5.1.2", diff --git a/packages/-ember-data/ember-cli-build.js b/packages/-ember-data/ember-cli-build.js index 379977383ff..73124edf3ea 100644 --- a/packages/-ember-data/ember-cli-build.js +++ b/packages/-ember-data/ember-cli-build.js @@ -16,6 +16,7 @@ module.exports = function (defaults) { }, 'ember-cli-babel': { throwUnlessParallelizable: true, + includeExternalHelpers: true, }, 'ember-cli-terser': { exclude: ['assets/dummy.js', 'assets/tests.js', 'assets/test-support.js', 'dist/docs/*', 'docs/*'], diff --git a/packages/-ember-data/package.json b/packages/-ember-data/package.json index afc346590c6..024587675af 100644 --- a/packages/-ember-data/package.json +++ b/packages/-ember-data/package.json @@ -33,7 +33,7 @@ "@ember/string": "^1.0.0", "@glimmer/env": "^0.1.7", "broccoli-merge-trees": "^4.2.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-typescript": "^4.1.0", "ember-inflector": "^4.0.1" }, @@ -98,4 +98,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/adapter/package.json b/packages/adapter/package.json index c534005c622..b7371419bdb 100644 --- a/packages/adapter/package.json +++ b/packages/adapter/package.json @@ -22,7 +22,7 @@ "@ember-data/store": "3.29.0-alpha.3", "@ember/edition-utils": "^1.2.0", "@ember/string": "^1.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-test-info": "^1.0.0", "ember-cli-typescript": "^4.1.0" }, @@ -59,4 +59,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/canary-features/package.json b/packages/canary-features/package.json index 4cb950033b7..6a8b52a0e67 100644 --- a/packages/canary-features/package.json +++ b/packages/canary-features/package.json @@ -14,7 +14,7 @@ }, "scripts": {}, "dependencies": { - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-typescript": "^4.1.0" }, "devDependencies": { @@ -45,4 +45,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/debug/package.json b/packages/debug/package.json index cadf3513860..456eac23b1d 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -20,7 +20,7 @@ "@ember-data/private-build-infra": "3.29.0-alpha.3", "@ember/edition-utils": "^1.2.0", "@ember/string": "^1.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-test-info": "^1.0.0", "ember-cli-typescript": "^4.1.0" }, @@ -57,4 +57,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/model/package.json b/packages/model/package.json index b32eb192770..d259bc91cfc 100644 --- a/packages/model/package.json +++ b/packages/model/package.json @@ -24,7 +24,7 @@ "@ember/edition-utils": "^1.2.0", "@ember/string": "^1.0.0", "ember-cache-primitive-polyfill": "^1.0.1", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-string-utils": "^1.1.0", "ember-cli-test-info": "^1.0.0", "ember-cli-typescript": "^4.1.0", @@ -64,4 +64,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/private-build-infra/package.json b/packages/private-build-infra/package.json index 72bce0fe82b..f53e3397514 100644 --- a/packages/private-build-infra/package.json +++ b/packages/private-build-infra/package.json @@ -27,7 +27,7 @@ "broccoli-rollup": "^4.1.1", "calculate-cache-key-for-tree": "^2.0.0", "chalk": "^4.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-path-utils": "^1.0.0", "ember-cli-string-utils": "^1.1.0", "ember-cli-typescript": "^4.1.0", @@ -48,4 +48,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/private-build-infra/src/addon-build-config-for-data-package.js b/packages/private-build-infra/src/addon-build-config-for-data-package.js index cb17ebdad64..d9c0918773f 100644 --- a/packages/private-build-infra/src/addon-build-config-for-data-package.js +++ b/packages/private-build-infra/src/addon-build-config-for-data-package.js @@ -2,6 +2,7 @@ const calculateCacheKeyForTree = require('calculate-cache-key-for-tree'); const Funnel = require('broccoli-funnel'); const merge = require('broccoli-merge-trees'); const BroccoliDebug = require('broccoli-debug'); +const VersionChecker = require('ember-cli-version-checker'); const rollupPrivateModule = require('./utilities/rollup-private-module'); @@ -159,6 +160,8 @@ function addonBuildConfigForDataPackage(PackageName) { let babel = this.addons.find((addon) => addon.name === 'ember-cli-babel'); let externalDeps = this.externalDependenciesForPrivateModule(); + const host = this._findHost(); + // don't print this for consumers if (this.isDevelopingAddon()) { // eslint-disable-next-line no-console @@ -168,11 +171,15 @@ function addonBuildConfigForDataPackage(PackageName) { )}']` ); } + let checker = new VersionChecker(this.project); + let emberVersion = checker.for('ember-source'); let privateTree = rollupPrivateModule(tree, { packageName: PackageName, babelCompiler: babel, babelOptions: this.options.babel, + emberVersion: emberVersion, + emberCliBabelOptions: host.options && host.options['ember-cli-babel'] ? host.options['ember-cli-babel'] : {}, onWarn: this._suppressUneededRollupWarnings.bind(this), externalDependencies: this.externalDependenciesForPrivateModule(), destDir: this.getOutputDirForVersion(), diff --git a/packages/private-build-infra/src/utilities/rollup-private-module.js b/packages/private-build-infra/src/utilities/rollup-private-module.js index b2740694a5f..ef946ccf4f1 100644 --- a/packages/private-build-infra/src/utilities/rollup-private-module.js +++ b/packages/private-build-infra/src/utilities/rollup-private-module.js @@ -12,12 +12,53 @@ module.exports = function rollupPrivateModule(tree, options) { destDir: '-private', }); + const emberCliBabelOptions = { + // we leave our output as valid ES + // for the consuming app's config to transpile as desired + // so we don't want to compileModules to amd here + compileModules: false, + + // we never need this on our own stuff + disableEmberDataPackagesPolyfill: true, + + // TODO for the embroider world we want to leave our -private module + // as an es module and only transpile the few things we genuinely care about. + // ideally this would occur as a pre-publish step so that consuming apps would + // just see a `-private.js` file and not pay any additional costs. + // CURRENTLY we transpile the -private module fully acccording to the + // consuming app's config, so we must leave these enabled. + disablePresetEnv: false, + disableDebugTooling: false, + disableDecoratorTransforms: false, + + throwUnlessParallelizable: true, + + // consuming app will take care of this if needed, + // we don't need to also include + includePolyfill: false, + + // defer to consuming app's selection + // necessary as only consuming app can set this, must only have + // one copy + includeExternalHelpers: options.emberCliBabelOptions.includeExternalHelpers || false, + + extensions: ['js', 'ts'], + }; + + // and we don't want + // to convert imports to globals when real modules is possible + // this is necessary because compileModules: false forces globals + // conversion without it. + if (options.emberVersion.gte('3.27.0')) { + // TODO should we just set this all the time? + // yes, this needs to be "false" to disable it in 3.27+ + // when compileModules is false (which it is) + emberCliBabelOptions.disableEmberModulesAPIPolyfill = false; + } + let privateTree = babelCompiler.transpileTree(debugTree(withPrivate, 'babel-private:input'), { babel: babelOptions, - 'ember-cli-babel': { - compileModules: false, - extensions: ['js', 'ts'], - }, + 'ember-cli-babel': emberCliBabelOptions, }); privateTree = debugTree(privateTree, 'babel-private:output'); @@ -27,7 +68,7 @@ module.exports = function rollupPrivateModule(tree, options) { output: [ { file: `${packageName}/-private.js`, - format: babelCompiler.shouldCompileModules() ? 'amd' : 'es', + format: 'amd', amd: { id: `${packageName}/-private` }, exports: 'named', }, diff --git a/packages/record-data/package.json b/packages/record-data/package.json index 2eb596d6ec6..62997a89823 100644 --- a/packages/record-data/package.json +++ b/packages/record-data/package.json @@ -24,7 +24,7 @@ "@ember-data/private-build-infra": "3.29.0-alpha.3", "@ember-data/store": "3.29.0-alpha.3", "@ember/edition-utils": "^1.2.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-test-info": "^1.0.0", "ember-cli-typescript": "^4.1.0" }, @@ -70,4 +70,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/serializer/package.json b/packages/serializer/package.json index 85173af96b7..c60cf97d9c5 100644 --- a/packages/serializer/package.json +++ b/packages/serializer/package.json @@ -20,7 +20,7 @@ "dependencies": { "@ember-data/private-build-infra": "3.29.0-alpha.3", "@ember-data/store": "3.29.0-alpha.3", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-test-info": "^1.0.0", "ember-cli-typescript": "^4.1.0" }, @@ -58,4 +58,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/store/package.json b/packages/store/package.json index 412c22a67ea..5fee67e499b 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -21,7 +21,7 @@ "@ember-data/private-build-infra": "3.29.0-alpha.3", "@ember/string": "^1.0.0", "@glimmer/tracking": "^1.0.4", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-path-utils": "^1.0.0", "ember-cli-typescript": "^4.1.0" }, @@ -58,4 +58,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/unpublished-adapter-encapsulation-test-app/package.json b/packages/unpublished-adapter-encapsulation-test-app/package.json index dda66da9fd5..e7b50b4e55d 100644 --- a/packages/unpublished-adapter-encapsulation-test-app/package.json +++ b/packages/unpublished-adapter-encapsulation-test-app/package.json @@ -31,7 +31,7 @@ "broccoli-asset-rev": "^3.0.0", "ember-cli": "~3.26.1", "ember-cli-app-version": "^5.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-htmlbars": "^5.1.2", "ember-cli-inject-live-reload": "^2.0.2", @@ -55,4 +55,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/unpublished-debug-encapsulation-test-app/package.json b/packages/unpublished-debug-encapsulation-test-app/package.json index 85ea10e6996..b5c32fdccec 100644 --- a/packages/unpublished-debug-encapsulation-test-app/package.json +++ b/packages/unpublished-debug-encapsulation-test-app/package.json @@ -30,7 +30,7 @@ "broccoli-asset-rev": "^3.0.0", "ember-cli": "~3.26.1", "ember-cli-app-version": "^5.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-htmlbars": "^5.1.2", "ember-cli-inject-live-reload": "^2.0.2", @@ -54,4 +54,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/unpublished-fastboot-test-app/package.json b/packages/unpublished-fastboot-test-app/package.json index 04110556e5a..a6043cf7a7e 100644 --- a/packages/unpublished-fastboot-test-app/package.json +++ b/packages/unpublished-fastboot-test-app/package.json @@ -35,7 +35,7 @@ "broccoli-asset-rev": "^3.0.0", "ember-cli": "~3.26.1", "ember-cli-app-version": "^5.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-fastboot": "^2.2.1", "ember-cli-fastboot-testing": "^0.2.3", @@ -70,4 +70,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/unpublished-model-encapsulation-test-app/package.json b/packages/unpublished-model-encapsulation-test-app/package.json index 2805992432c..dc81602162a 100644 --- a/packages/unpublished-model-encapsulation-test-app/package.json +++ b/packages/unpublished-model-encapsulation-test-app/package.json @@ -31,7 +31,7 @@ "broccoli-asset-rev": "^3.0.0", "ember-cli": "~3.26.1", "ember-cli-app-version": "^5.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-htmlbars": "^5.1.2", "ember-cli-inject-live-reload": "^2.0.2", @@ -55,4 +55,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/unpublished-record-data-encapsulation-test-app/package.json b/packages/unpublished-record-data-encapsulation-test-app/package.json index 7381efb8d44..7c94152f2d2 100644 --- a/packages/unpublished-record-data-encapsulation-test-app/package.json +++ b/packages/unpublished-record-data-encapsulation-test-app/package.json @@ -31,7 +31,7 @@ "broccoli-asset-rev": "^3.0.0", "ember-cli": "~3.26.1", "ember-cli-app-version": "^5.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-htmlbars": "^5.1.2", "ember-cli-inject-live-reload": "^2.0.2", @@ -55,4 +55,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/unpublished-relationship-performance-test-app/package.json b/packages/unpublished-relationship-performance-test-app/package.json index a051ae87cd2..c4a4ba37d89 100644 --- a/packages/unpublished-relationship-performance-test-app/package.json +++ b/packages/unpublished-relationship-performance-test-app/package.json @@ -26,7 +26,7 @@ "broccoli-asset-rev": "^3.0.0", "ember-cli": "~3.26.1", "ember-cli-app-version": "^5.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-htmlbars": "^5.1.2", "ember-cli-inject-live-reload": "^2.0.2", @@ -53,4 +53,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/unpublished-serializer-encapsulation-test-app/package.json b/packages/unpublished-serializer-encapsulation-test-app/package.json index 0df87fe6517..50eb08259c7 100644 --- a/packages/unpublished-serializer-encapsulation-test-app/package.json +++ b/packages/unpublished-serializer-encapsulation-test-app/package.json @@ -30,7 +30,7 @@ "broccoli-asset-rev": "^3.0.0", "ember-cli": "~3.26.1", "ember-cli-app-version": "^5.0.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-dependency-checker": "^3.2.0", "ember-cli-htmlbars": "^5.1.2", "ember-cli-inject-live-reload": "^2.0.2", @@ -54,4 +54,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/packages/unpublished-test-infra/package.json b/packages/unpublished-test-infra/package.json index 41e4bddffde..3ebbf805fee 100644 --- a/packages/unpublished-test-infra/package.json +++ b/packages/unpublished-test-infra/package.json @@ -19,7 +19,7 @@ "dependencies": { "@ember-data/private-build-infra": "3.29.0-alpha.3", "@ember/edition-utils": "^1.2.0", - "ember-cli-babel": "^7.26.3", + "ember-cli-babel": "^7.26.6", "ember-cli-blueprint-test-helpers": "^0.19.2", "ember-cli-typescript": "^4.1.0", "ember-get-config": "^0.2.4", @@ -55,4 +55,4 @@ "node": "12.16.2", "yarn": "1.22.4" } -} +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index d3c601fa617..073405ecd56 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6627,7 +6627,7 @@ ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.3.0, ember-cli-babel@^6.8.1: ember-cli-version-checker "^2.1.2" semver "^5.5.0" -ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.0, ember-cli-babel@^7.1.2, ember-cli-babel@^7.11.0, ember-cli-babel@^7.12.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.19.0, ember-cli-babel@^7.20.5, ember-cli-babel@^7.22.1, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.2, ember-cli-babel@^7.26.3, ember-cli-babel@^7.4.0, ember-cli-babel@^7.7.3, ember-cli-babel@^7.8.0: +ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.0, ember-cli-babel@^7.1.2, ember-cli-babel@^7.11.0, ember-cli-babel@^7.12.0, ember-cli-babel@^7.13.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.19.0, ember-cli-babel@^7.20.5, ember-cli-babel@^7.22.1, ember-cli-babel@^7.23.0, ember-cli-babel@^7.23.1, ember-cli-babel@^7.26.2, ember-cli-babel@^7.4.0, ember-cli-babel@^7.7.3, ember-cli-babel@^7.8.0: version "7.26.4" resolved "https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-7.26.4.tgz#b73d53592c05479814ca1770b3b849d4e01a87f0" integrity sha512-GibwLrBUVj8DxNMnbE5PObEIeznX6ohOdYHoSMmTkCBuXa/I9amRGIjBhNlDbAJj+exVKKZoEGAdrV13gnyftQ== @@ -6660,6 +6660,39 @@ ember-cli-babel@^7.0.0, ember-cli-babel@^7.1.0, ember-cli-babel@^7.1.2, ember-cl rimraf "^3.0.1" semver "^5.5.0" +ember-cli-babel@^7.26.6: + version "7.26.6" + resolved "https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-7.26.6.tgz#322fbbd3baad9dd99e3276ff05bc6faef5e54b39" + integrity sha512-040svtfj2RC35j/WMwdWJFusZaXmNoytLAMyBDGLMSlRvznudTxZjGlPV6UupmtTBApy58cEF8Fq4a+COWoEmQ== + dependencies: + "@babel/core" "^7.12.0" + "@babel/helper-compilation-targets" "^7.12.0" + "@babel/plugin-proposal-class-properties" "^7.13.0" + "@babel/plugin-proposal-decorators" "^7.13.5" + "@babel/plugin-transform-modules-amd" "^7.13.0" + "@babel/plugin-transform-runtime" "^7.13.9" + "@babel/plugin-transform-typescript" "^7.13.0" + "@babel/polyfill" "^7.11.5" + "@babel/preset-env" "^7.12.0" + "@babel/runtime" "7.12.18" + amd-name-resolver "^1.3.1" + babel-plugin-debug-macros "^0.3.4" + babel-plugin-ember-data-packages-polyfill "^0.1.2" + babel-plugin-ember-modules-api-polyfill "^3.5.0" + babel-plugin-module-resolver "^3.2.0" + broccoli-babel-transpiler "^7.8.0" + broccoli-debug "^0.6.4" + broccoli-funnel "^2.0.2" + broccoli-source "^2.1.2" + clone "^2.1.2" + ember-cli-babel-plugin-helpers "^1.1.1" + ember-cli-version-checker "^4.1.0" + ensure-posix-path "^1.0.2" + fixturify-project "^1.10.0" + resolve-package-path "^3.1.0" + rimraf "^3.0.1" + semver "^5.5.0" + ember-cli-blueprint-test-helpers@^0.19.1, ember-cli-blueprint-test-helpers@^0.19.2: version "0.19.2" resolved "https://registry.npmjs.org/ember-cli-blueprint-test-helpers/-/ember-cli-blueprint-test-helpers-0.19.2.tgz#9e563cd81ab39931253ced0982c5d02475895401"