Skip to content

Commit b401e23

Browse files
authored
Merge pull request #1378 from NullVoxPopuli/guide-for-no-template-resolution
Deprecation guide for non-co-located components
2 parents 9f6f5e0 + 647f302 commit b401e23

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: Component Template Resolving
3+
until: 6.0.0
4+
since: 5.10.0
5+
---
6+
7+
There are two types of paths to migrate off the old layouts
8+
- use a currently supported multi-file layout (keeping separate `js`, `ts`, and `hbs` files)
9+
- migrate the component entirely to the latest component format, `gjs`, `gts`, (aka `<template>`)
10+
11+
There are some tools to help with this:
12+
- [Classic to Colocation](https://github.com/ember-codemods/ember-component-template-colocation-migrator)
13+
- [Convert pods to Colocation](https://github.com/ijlee2/ember-codemod-pod-to-octane)
14+
15+
Specifically, these layouts are no longer supported:
16+
17+
<table style="width:100%"><thead><tr><th>Classic</th><th>Pods</th></thead>
18+
<tbody><tr><td style="vertical-align:top; width:50%;">
19+
20+
```
21+
{app,addon}/
22+
components/
23+
foo.js
24+
namespace/
25+
bar.js
26+
templates/
27+
components/
28+
foo.hbs
29+
namespace/
30+
bar.hbs
31+
```
32+
33+
</td><td style="vertical-align:top">
34+
35+
```
36+
{app,addon}/
37+
components/
38+
foo/
39+
component.js
40+
template.hbs
41+
namespace/
42+
bar/
43+
component.js
44+
template.hbs
45+
```
46+
47+
</td></tr></tbody>
48+
</table>
49+
50+
51+
The above example(s) can be migrated to:
52+
53+
```
54+
{app,addon}/
55+
components/
56+
foo.js
57+
foo.hbs
58+
namespace/
59+
bar.js
60+
bar.hbs
61+
```
62+
63+
Or using `--component-structure=nested`
64+
65+
```
66+
{app,addon}/
67+
components/
68+
foo/
69+
index.js
70+
index.hbs
71+
namespace/
72+
bar/
73+
index.js
74+
index.hbs
75+
```
76+
77+
Note, however, that classic components _importing_ the `layout` and setting it on an `@ember/component` will still work.
78+
The key thing being deprecated is the runtime resolution of templates, so if there is an import involved, there is no runtime resolution.

0 commit comments

Comments
 (0)