Skip to content

Commit f46bf12

Browse files
author
Robert Jackson
committed
Remove setEdition requirement for colocation.
Changes the `_cachedShouldColocateTemplates` logic to require the following: * `ember-cli-babel` >= 7.11.0 * `ember-cli` >= 3.12.0-beta.2 * `ember-source` >= 3.13.0 In the future, when we have a `setComponentTemplate` and `templateOnly` polyfill we can update the `ember-source` requirement to also check for the polyfill.
1 parent a728d22 commit f46bf12

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/ember-addon-main.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const path = require('path');
44
const utils = require('./utils');
5-
const hasEdition = require('@ember/edition-utils').has;
65

76
let registryInvocationCounter = 0;
87

@@ -30,6 +29,9 @@ module.exports = {
3029
let hasBabel = babel !== undefined;
3130
let babelVersion = hasBabel && babel.pkg.version;
3231

32+
let ember = this.project.addons.find(a => a.name === 'ember-source');
33+
let emberVersion = ember !== undefined && ember.pkg.version;
34+
3335
// using this.project.emberCLIVersion() allows us to avoid issues when `npm
3436
// link` is used; if this addon were linked and we did something like
3537
// `require('ember-cli/package').version` we would get our own ember-cli
@@ -38,13 +40,16 @@ module.exports = {
3840

3941
let hasValidBabelVersion = hasBabel && semver.gte(babelVersion, '7.11.0');
4042
let hasValidEmberCLIVersion = semver.gte(emberCLIVersion, '3.12.0-beta.2');
41-
let hasOctane = hasEdition('octane');
43+
44+
// once a polyfill is written, we will need to update this logic to check
45+
// for _either_ `[email protected]` or the polyfill
46+
let hasValidEmberVersion = semver.gte(emberVersion, '3.13.0');
4247

4348
this._cachedShouldColocateTemplates =
44-
hasOctane && hasValidBabelVersion && hasValidEmberCLIVersion;
49+
hasValidEmberVersion && hasValidBabelVersion && hasValidEmberCLIVersion;
4550

4651
this.logger.info(
47-
`Colocation processing: ${this._cachedShouldColocateTemplates} (hasOctane: ${hasOctane}; hasValidEmberCLIVersion: ${hasValidEmberCLIVersion}; hasValidBabelVersion: ${hasValidBabelVersion};`
52+
`Colocation processing: ${this._cachedShouldColocateTemplates} (hasValidEmberVersion: ${hasValidEmberVersion} hasValidEmberCLIVersion: ${hasValidEmberCLIVersion}; hasValidBabelVersion: ${hasValidBabelVersion};`
4853
);
4954

5055
return this._cachedShouldColocateTemplates;

0 commit comments

Comments
 (0)