From e17274b15c29e2f392d11e012c04553f6d4e4765 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Mon, 19 May 2025 10:34:44 -0400 Subject: [PATCH 1/3] Remove unneeded restriction around creating sub-applications --- .../views/lib/system/event_dispatcher.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/packages/@ember/-internals/views/lib/system/event_dispatcher.ts b/packages/@ember/-internals/views/lib/system/event_dispatcher.ts index db3512393fc..30082d5c385 100644 --- a/packages/@ember/-internals/views/lib/system/event_dispatcher.ts +++ b/packages/@ember/-internals/views/lib/system/event_dispatcher.ts @@ -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) From 420d454a94b088ba17f5c209af30dfee77066227 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Mon, 19 May 2025 10:45:14 -0400 Subject: [PATCH 2/3] Remove test that is no longer relevant --- packages/@ember/application/tests/application_test.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/@ember/application/tests/application_test.js b/packages/@ember/application/tests/application_test.js index 71fdd5c2fa7..e6336b685fc 100644 --- a/packages/@ember/application/tests/application_test.js +++ b/packages/@ember/application/tests/application_test.js @@ -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(() => From 16e9ebbea7c1d2934e626e60fd24674c5e9b02bb Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:31:44 -0400 Subject: [PATCH 3/3] Remove another assert --- .../@ember/-internals/views/lib/system/event_dispatcher.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/@ember/-internals/views/lib/system/event_dispatcher.ts b/packages/@ember/-internals/views/lib/system/event_dispatcher.ts index 30082d5c385..091792fab6f 100644 --- a/packages/@ember/-internals/views/lib/system/event_dispatcher.ts +++ b/packages/@ember/-internals/views/lib/system/event_dispatcher.ts @@ -13,7 +13,6 @@ import type { ActionState } from '@ember/-internals/glimmer/lib/modifiers/action */ const ROOT_ELEMENT_CLASS = 'ember-application'; -const ROOT_ELEMENT_SELECTOR = `.${ROOT_ELEMENT_CLASS}`; /** `Ember.EventDispatcher` handles delegating browser events to their @@ -162,11 +161,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 an ancestor of an existing Ember.Application', - !rootElement.querySelector(ROOT_ELEMENT_SELECTOR) - ); - rootElement.classList.add(ROOT_ELEMENT_CLASS); assert(