Skip to content

Commit 1c8c812

Browse files
committed
Updated code for removal of DEPRECATE_COMPONENT_TEMPLATE_RESOLVING
1 parent bb84789 commit 1c8c812

File tree

1 file changed

+4
-34
lines changed

1 file changed

+4
-34
lines changed

packages/@ember/-internals/glimmer/lib/resolver.ts

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { InternalFactory, InternalOwner, RegisterOptions } from '@ember/-internals/owner';
1+
import type { InternalFactory, InternalOwner } from '@ember/-internals/owner';
22
import { isFactory } from '@ember/-internals/owner';
33
import { assert } from '@ember/debug';
44
import { _instrumentStart } from '@ember/instrumentation';
@@ -42,7 +42,6 @@ import { default as uniqueId } from './helpers/unique-id';
4242

4343
import { mountHelper } from './syntax/mount';
4444
import { outletHelper } from './syntax/outlet';
45-
import { DEPRECATIONS, deprecateUntil } from '@ember/-internals/deprecations';
4645

4746
function instrumentationPayload(name: string) {
4847
return { object: `component:${name}` };
@@ -56,29 +55,6 @@ function componentFor(
5655
return owner.factoryFor(fullName) || null;
5756
}
5857

59-
function layoutFor(
60-
name: string,
61-
owner: InternalOwner,
62-
options?: RegisterOptions
63-
): Nullable<Template> {
64-
if (DEPRECATIONS.DEPRECATE_COMPONENT_TEMPLATE_RESOLVING.isRemoved) {
65-
return null;
66-
}
67-
68-
let templateFullName = `template:components/${name}` as const;
69-
70-
let result = (owner.lookup(templateFullName, options) as Template) || null;
71-
72-
if (result) {
73-
deprecateUntil(
74-
`Components with separately resolved templates are deprecated. Migrate to either co-located js/ts + hbs files or to gjs/gts. Tried to lookup '${templateFullName}'.`,
75-
DEPRECATIONS.DEPRECATE_COMPONENT_TEMPLATE_RESOLVING
76-
);
77-
}
78-
79-
return result;
80-
}
81-
8258
type LookupResult =
8359
| {
8460
component: InternalFactory<object>;
@@ -93,11 +69,7 @@ type LookupResult =
9369
layout: TemplateFactory;
9470
};
9571

96-
function lookupComponentPair(
97-
owner: InternalOwner,
98-
name: string,
99-
options?: RegisterOptions
100-
): Nullable<LookupResult> {
72+
function lookupComponentPair(owner: InternalOwner, name: string): Nullable<LookupResult> {
10173
let component = componentFor(name, owner);
10274

10375
if (isFactory(component) && component.class) {
@@ -108,12 +80,10 @@ function lookupComponentPair(
10880
}
10981
}
11082

111-
let layout = layoutFor(name, owner, options);
112-
113-
if (component === null && layout === null) {
83+
if (component === null) {
11484
return null;
11585
} else {
116-
return { component, layout } as LookupResult;
86+
return { component, layout: null } as LookupResult;
11787
}
11888
}
11989

0 commit comments

Comments
 (0)