Repository: ember-cli/ember-cli
Pull request #9023 (2020-02-10 15:59:43)

Update to use Ember + Ember Data 3.16.


Patch:
diff --git a/blueprints/app/files/package.json b/blueprints/app/files/package.json
index 9021fa1c9..ee6dde361 100644
--- a/blueprints/app/files/package.json
+++ b/blueprints/app/files/package.json
@@ -33,14 +33,14 @@
     "ember-cli-sri": "^2.1.1",
     "ember-cli-template-lint": "^1.0.0-beta.3",
     "ember-cli-uglify": "^3.0.0",
-    "ember-data": "~3.15.0",
+    "ember-data": "~3.16.0",
     "ember-export-application-global": "^2.0.1",
     "ember-fetch": "^7.0.0",
     "ember-load-initializers": "^2.1.1",
     "ember-maybe-import-regenerator": "^0.1.6",
     "ember-qunit": "^4.6.0",
     "ember-resolver": "^7.0.0",
-    "ember-source": "~3.15.0<% if (welcome) { %>",
+    "ember-source": "~3.16.0<% if (welcome) { %>",
     "ember-welcome-page": "^4.0.0<% } %>",
     "eslint-plugin-ember": "^7.7.1",
     "eslint-plugin-node": "^10.0.0",
diff --git a/lib/models/addon.js b/lib/models/addon.js
index e7be4cda6..bd03f4861 100644
--- a/lib/models/addon.js
+++ b/lib/models/addon.js
@@ -882,7 +882,7 @@ let addonProto = {
     let srcAfterPreprocessTreeHook = this._addonPreprocessTree('src', srcNamespacedTree);
 
     let srcAfterTemplatePreprocessing = srcAfterPreprocessTreeHook;
-    if (!isExperimentEnabled('DELAYED_TRANSPILATION') || registryHasPreprocessor(this.registry, 'template')) {
+    if (isExperimentEnabled('DELAYED_TRANSPILATION') === false && registryHasPreprocessor(this.registry, 'template')) {
       srcAfterTemplatePreprocessing = preprocessTemplates(srcAfterPreprocessTreeHook, {
         registry: this.registry,
         annotation: `Addon#treeForSrc(${this.name})`,
@@ -1214,7 +1214,7 @@ let addonProto = {
       let preprocessedTemplateTree = this._addonPreprocessTree('template', addonTree);
 
       let processedTemplateTree;
-      if (!isExperimentEnabled('DELAYED_TRANSPILATION') || registryHasPreprocessor(this.registry, 'template')) {
+      if (!isExperimentEnabled('DELAYED_TRANSPILATION')) {
         processedTemplateTree = preprocessTemplates(preprocessedTemplateTree, {
           annotation: `compileTemplates(${this.name})`,
           registry: this.registry,


Test patch:
diff --git a/tests/fixtures/addon/npm/package.json b/tests/fixtures/addon/npm/package.json
index 3fce47580..481c53d58 100644
--- a/tests/fixtures/addon/npm/package.json
+++ b/tests/fixtures/addon/npm/package.json
@@ -43,7 +43,7 @@
     "ember-maybe-import-regenerator": "^0.1.6",
     "ember-qunit": "^4.6.0",
     "ember-resolver": "^7.0.0",
-    "ember-source": "~3.15.0",
+    "ember-source": "~3.16.0",
     "ember-source-channel-url": "^2.0.1",
     "ember-try": "^1.4.0",
     "eslint-plugin-ember": "^7.7.1",
diff --git a/tests/fixtures/addon/yarn/package.json b/tests/fixtures/addon/yarn/package.json
index 17fb9ce1a..8fe5a299a 100644
--- a/tests/fixtures/addon/yarn/package.json
+++ b/tests/fixtures/addon/yarn/package.json
@@ -43,7 +43,7 @@
     "ember-maybe-import-regenerator": "^0.1.6",
     "ember-qunit": "^4.6.0",
     "ember-resolver": "^7.0.0",
-    "ember-source": "~3.15.0",
+    "ember-source": "~3.16.0",
     "ember-source-channel-url": "^2.0.1",
     "ember-try": "^1.4.0",
     "ember-welcome-page": "^4.0.0",
diff --git a/tests/fixtures/app/npm/package.json b/tests/fixtures/app/npm/package.json
index 52cdfc25b..a157556c3 100644
--- a/tests/fixtures/app/npm/package.json
+++ b/tests/fixtures/app/npm/package.json
@@ -33,14 +33,14 @@
     "ember-cli-sri": "^2.1.1",
     "ember-cli-template-lint": "^1.0.0-beta.3",
     "ember-cli-uglify": "^3.0.0",
-    "ember-data": "~3.15.0",
+    "ember-data": "~3.16.0",
     "ember-export-application-global": "^2.0.1",
     "ember-fetch": "^7.0.0",
     "ember-load-initializers": "^2.1.1",
     "ember-maybe-import-regenerator": "^0.1.6",
     "ember-qunit": "^4.6.0",
     "ember-resolver": "^7.0.0",
-    "ember-source": "~3.15.0",
+    "ember-source": "~3.16.0",
     "eslint-plugin-ember": "^7.7.1",
     "eslint-plugin-node": "^10.0.0",
     "loader.js": "^4.7.0",
diff --git a/tests/fixtures/app/yarn/package.json b/tests/fixtures/app/yarn/package.json
index 2093bcf4e..0c481fed4 100644
--- a/tests/fixtures/app/yarn/package.json
+++ b/tests/fixtures/app/yarn/package.json
@@ -33,14 +33,14 @@
     "ember-cli-sri": "^2.1.1",
     "ember-cli-template-lint": "^1.0.0-beta.3",
     "ember-cli-uglify": "^3.0.0",
-    "ember-data": "~3.15.0",
+    "ember-data": "~3.16.0",
     "ember-export-application-global": "^2.0.1",
     "ember-fetch": "^7.0.0",
     "ember-load-initializers": "^2.1.1",
     "ember-maybe-import-regenerator": "^0.1.6",
     "ember-qunit": "^4.6.0",
     "ember-resolver": "^7.0.0",
-    "ember-source": "~3.15.0",
+    "ember-source": "~3.16.0",
     "ember-welcome-page": "^4.0.0",
     "eslint-plugin-ember": "^7.7.1",
     "eslint-plugin-node": "^10.0.0",
diff --git a/tests/unit/broccoli/template-precompilation-test.js b/tests/unit/broccoli/template-precompilation-test.js
index 619a9b991..c58816b20 100644
--- a/tests/unit/broccoli/template-precompilation-test.js
+++ b/tests/unit/broccoli/template-precompilation-test.js
@@ -7,6 +7,8 @@ const expect = require('chai').expect;
 const BroccoliPlugin = require('broccoli-plugin');
 const walkSync = require('walk-sync');
 
+const { isExperimentEnabled } = require('../../../lib/experiments');
+
 const MockCLI = require('../../helpers/mock-cli');
 const Project = require('../../../lib/models/project');
 const Addon = require('../../../lib/models/addon');
@@ -56,6 +58,12 @@ describe('template preprocessors', function() {
   }
 
   describe('Addon', function() {
+    if (isExperimentEnabled('DELAYED_TRANSPILATION')) {
+      // these tests fundamentally require running template transpilation
+      // against the addon's own `addon/` tree
+      return;
+    }
+
     beforeEach(async function() {
       input = await createTempDir();
       let MockAddon = Addon.extend({