Skip to content

Commit

Permalink
Merge pull request #1155 from Windvis/chore/ensure-safe-component-cla…
Browse files Browse the repository at this point in the history
…ss-no-op

Turn ensureSafeComponent into a no-op for class values on Ember 3.25+
  • Loading branch information
ef4 authored Mar 8, 2022
2 parents 515a5ad + 734d5ca commit f15f5f5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/util/addon/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { assert, deprecate } from '@ember/debug';
import { getOwner } from '@ember/application';
import { dependencySatisfies, macroCondition } from '@embroider/macros';
import {
isCurriedComponentDefinition,
lookupCurriedComponentDefinition,
Expand Down Expand Up @@ -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);
}
}

0 comments on commit f15f5f5

Please sign in to comment.