1
- import type { InternalFactory , InternalOwner , RegisterOptions } from '@ember/-internals/owner' ;
1
+ import type { InternalFactory , InternalOwner } from '@ember/-internals/owner' ;
2
2
import { isFactory } from '@ember/-internals/owner' ;
3
3
import { assert } from '@ember/debug' ;
4
4
import { _instrumentStart } from '@ember/instrumentation' ;
@@ -42,7 +42,6 @@ import { default as uniqueId } from './helpers/unique-id';
42
42
43
43
import { mountHelper } from './syntax/mount' ;
44
44
import { outletHelper } from './syntax/outlet' ;
45
- import { DEPRECATIONS , deprecateUntil } from '@ember/-internals/deprecations' ;
46
45
47
46
function instrumentationPayload ( name : string ) {
48
47
return { object : `component:${ name } ` } ;
@@ -56,29 +55,6 @@ function componentFor(
56
55
return owner . factoryFor ( fullName ) || null ;
57
56
}
58
57
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
-
82
58
type LookupResult =
83
59
| {
84
60
component : InternalFactory < object > ;
@@ -93,11 +69,7 @@ type LookupResult =
93
69
layout : TemplateFactory ;
94
70
} ;
95
71
96
- function lookupComponentPair (
97
- owner : InternalOwner ,
98
- name : string ,
99
- options ?: RegisterOptions
100
- ) : Nullable < LookupResult > {
72
+ function lookupComponentPair ( owner : InternalOwner , name : string ) : Nullable < LookupResult > {
101
73
let component = componentFor ( name , owner ) ;
102
74
103
75
if ( isFactory ( component ) && component . class ) {
@@ -108,12 +80,10 @@ function lookupComponentPair(
108
80
}
109
81
}
110
82
111
- let layout = layoutFor ( name , owner , options ) ;
112
-
113
- if ( component === null && layout === null ) {
83
+ if ( component === null ) {
114
84
return null ;
115
85
} else {
116
- return { component, layout } as LookupResult ;
86
+ return { component, layout : null } as LookupResult ;
117
87
}
118
88
}
119
89
0 commit comments