Skip to content

Commit 542a718

Browse files
committed
Add deprecation guide for RFC emberjs/rfcs#995
1 parent d48502f commit 542a718

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
- [Convert to `<template>`](https://github.com/IgnaceMaes/ember-codemod-template-tag)
15+
16+
17+
Specifically, these layouts are no longer supported:
18+
19+
<table style="width:100%"><thead><tr><th>Classic</th><th>Pods</th></thead>
20+
<tbody><tr><td style="vertical-align:top; width:50%;">
21+
22+
```
23+
{app,addon}/
24+
components/
25+
foo.js
26+
namespace/
27+
bar.js
28+
templates/
29+
components/
30+
foo.hbs
31+
namespace/
32+
bar.hbs
33+
```
34+
35+
</td><td style="vertical-align:top">
36+
37+
```
38+
{app,addon}/
39+
components/
40+
foo/
41+
component.js
42+
template.hbs
43+
namespace/
44+
bar/
45+
component.js
46+
template.hbs
47+
```
48+
49+
</td></tr></tbody>
50+
</table>
51+
52+
53+
The above example(s) can be migrated to:
54+
55+
```
56+
{app,addon}/
57+
components/
58+
foo.js
59+
foo.hbs
60+
namespace/
61+
bar.js
62+
bar.hbs
63+
```
64+
65+
Or using `--component-structure=nested`
66+
67+
```
68+
{app,addon}/
69+
components/
70+
foo/
71+
index.js
72+
index.hbs
73+
namespace/
74+
bar/
75+
index.js
76+
index.hbs
77+
```
78+
79+
Note, however, that classic components _importing_ the `layout` and setting it on an `@ember/component` will still work.
80+
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)