Skip to content

Commit

Permalink
Support apps with Feature Flag ember-glimmer-remove-application-templ…
Browse files Browse the repository at this point in the history
…ate-wrapper enabled
  • Loading branch information
cibernox committed Jan 21, 2018
1 parent 70ef42c commit 65355f1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ export function visit() {
return owner.visit(...arguments);
})
.then(() => {
context.element = document.querySelector('#ember-testing > .ember-view');
// eslint-disable-next-line
if (EmberENV.FEATURES['ember-glimmer-remove-application-template-wrapper']) {
context.element = document.querySelector('#ember-testing');
} else {
context.element = document.querySelector('#ember-testing > .ember-view');
}
})
.then(settled);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ export default function setupRenderingContext(context) {
// In older Ember versions (2.4) the element itself is not stable,
// and therefore we cannot update the `this.element` until after the
// rendering is completed
context.element = getRootElement().querySelector('.ember-view');
// eslint-disable-next-line
if (EmberENV.FEATURES['ember-glimmer-remove-application-template-wrapper']) {
context.element = getRootElement();
} else {
context.element = getRootElement().querySelector('.ember-view');
}

return context;
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"ember-maybe-import-regenerator-for-testing": "^1.0.0",
"ember-native-dom-event-dispatcher": "^0.6.3",
"ember-resolver": "^4.0.0",
"ember-source": "~2.18.0",
"ember-source": "~3.0.0-beta.2",
"ember-source-channel-url": "^1.0.1",
"ember-try": "^0.2.23",
"eslint-config-prettier": "^2.6.0",
Expand Down
1 change: 1 addition & 0 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = function(environment) {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
'ember-glimmer-remove-application-template-wrapper': true,
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2788,9 +2788,9 @@ ember-source-channel-url@^1.0.1:
dependencies:
got "^8.0.1"

ember-source@~2.18.0:
version "2.18.0"
resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-2.18.0.tgz#f61cf2701d8aa94a6adee6d47b1d5a73a4cef5f6"
ember-source@~3.0.0-beta.2:
version "3.0.0-beta.3"
resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.0.0-beta.3.tgz#1f6dde5caaaceb49b09b5fafb5b0627692e2d56c"
dependencies:
broccoli-funnel "^2.0.1"
broccoli-merge-trees "^2.0.0"
Expand Down

0 comments on commit 65355f1

Please sign in to comment.