Skip to content

Remove unneeded restriction around creating sub-applications #20910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions packages/@ember/-internals/views/lib/system/event_dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,6 @@ export default class EventDispatcher extends EmberObject {
`You cannot use the same root element (${specifiedRootElement}) multiple times in an Ember.Application`,
!rootElement.classList.contains(ROOT_ELEMENT_CLASS)
);
assert(
'You cannot make a new Ember.Application using a root element that is a descendent of an existing Ember.Application',
(() => {
let target = rootElement.parentNode;
while (target instanceof Element) {
if (target.classList.contains(ROOT_ELEMENT_CLASS)) {
return false;
}

target = target.parentNode;
}

return true;
})()
);
assert(
'You cannot make a new Ember.Application using a root element that is an ancestor of an existing Ember.Application',
!rootElement.querySelector(ROOT_ELEMENT_SELECTOR)
Expand Down
10 changes: 0 additions & 10 deletions packages/@ember/application/tests/application_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,6 @@ moduleFor(
});
}

[`@test you cannot make a new application that is a descendant of an existing application`]() {
expectAssertion(() => {
runTask(() =>
this.createSecondApplication({
rootElement: '#one-child',
})
);
});
}

[`@test you cannot make a new application that is a duplicate of an existing application`]() {
expectAssertion(() => {
runTask(() =>
Expand Down