Skip to content

Commit

Permalink
Only opt-in to colocation when using octane edition.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Sep 15, 2019
1 parent 791bde4 commit 72012c8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ember-addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const path = require('path');
const utils = require('./utils');
const logger = require('heimdalljs-logger')('ember-cli-htmlbars');
const hasEdition = require('@ember/edition-utils').has;

let registryInvocationCounter = 0;

Expand Down Expand Up @@ -30,8 +31,10 @@ module.exports = {

let hasValidBabelVersion = hasBabel && semver.gte(babelVersion, '7.11.0');
let hasValidEmberCLIVersion = semver.gte(emberCLIVersion, '3.12.0-beta.2');
let hasOctane = hasEdition('octane');

this._cachedShouldColocateTemplates = hasValidBabelVersion && hasValidEmberCLIVersion;
this._cachedShouldColocateTemplates =
hasOctane && hasValidBabelVersion && hasValidEmberCLIVersion;

return this._cachedShouldColocateTemplates;
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"test:node:debug": "mocha debug node-tests/*.js"
},
"dependencies": {
"@ember/edition-utils": "^1.1.1",
"babel-plugin-htmlbars-inline-precompile": "^2.1.0",
"broccoli-debug": "^0.6.5",
"broccoli-persistent-filter": "^2.3.1",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,11 @@
resolved "https://registry.yarnpkg.com/@ember-data/rfc395-data/-/rfc395-data-0.0.4.tgz#ecb86efdf5d7733a76ff14ea651a1b0ed1f8a843"
integrity sha512-tGRdvgC9/QMQSuSuJV45xoyhI0Pzjm7A9o/MVVA3HakXIImJbbzx/k/6dO9CUEQXIyS2y0fW6C1XaYOG7rY0FQ==

"@ember/edition-utils@^1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@ember/edition-utils/-/edition-utils-1.1.1.tgz#d5732c3da593f202e6e1ac6dbee56a758242403f"
integrity sha512-GEhri78jdQp/xxPpM6z08KlB0wrHfnfrJ9dmQk7JeQ4XCiMzXsJci7yooQgg/IcTKCM/PxE/IkGCQAo80adMkw==

"@ember/optional-features@^0.7.0":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@ember/optional-features/-/optional-features-0.7.0.tgz#f65a858007020ddfb8342f586112750c32abd2d9"
Expand Down

0 comments on commit 72012c8

Please sign in to comment.