From 734d5cafaa5498d84479804dfdfc8fd42d1b22ac Mon Sep 17 00:00:00 2001 From: Sam Van Campenhout Date: Mon, 7 Mar 2022 19:09:37 +0100 Subject: [PATCH] Turn ensureSafeComponent into a no-op for class values on Ember 3.25+ --- packages/util/addon/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/util/addon/index.js b/packages/util/addon/index.js index c4a1010b8..b57088d93 100644 --- a/packages/util/addon/index.js +++ b/packages/util/addon/index.js @@ -1,5 +1,6 @@ import { assert, deprecate } from '@ember/debug'; import { getOwner } from '@ember/application'; +import { dependencySatisfies, macroCondition } from '@embroider/macros'; import { isCurriedComponentDefinition, lookupCurriedComponentDefinition, @@ -49,7 +50,11 @@ function ensureRegistered(klass, owner) { } function handleClass(klass, thingWithOwner) { - let owner = getOwner(thingWithOwner); - let nonce = ensureRegistered(klass, owner); - return lookupCurriedComponentDefinition(nonce, owner); + if (macroCondition(dependencySatisfies('ember-source', '>=3.25.0-beta'))) { + return klass; + } else { + let owner = getOwner(thingWithOwner); + let nonce = ensureRegistered(klass, owner); + return lookupCurriedComponentDefinition(nonce, owner); + } }