forked from ember-learn/deprecation-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deprecation guide for RFC emberjs/rfcs#995
- Loading branch information
1 parent
d48502f
commit 542a718
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
content/ember/v5/deprecate-component-template-resolving.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
title: Component Template Resolving | ||
until: 6.0.0 | ||
since: 5.10.0 | ||
--- | ||
|
||
There are two types of paths to migrate off the old layouts | ||
- use a currently supported multi-file layout (keeping separate `js`, `ts`, and `hbs` files) | ||
- migrate the component entirely to the latest component format, `gjs`, `gts`, (aka `<template>`) | ||
|
||
There are some tools to help with this: | ||
- [Classic to Colocation](https://github.com/ember-codemods/ember-component-template-colocation-migrator) | ||
- [Convert pods to Colocation](https://github.com/ijlee2/ember-codemod-pod-to-octane) | ||
- [Convert to `<template>`](https://github.com/IgnaceMaes/ember-codemod-template-tag) | ||
|
||
|
||
Specifically, these layouts are no longer supported: | ||
|
||
<table style="width:100%"><thead><tr><th>Classic</th><th>Pods</th></thead> | ||
<tbody><tr><td style="vertical-align:top; width:50%;"> | ||
|
||
``` | ||
{app,addon}/ | ||
components/ | ||
foo.js | ||
namespace/ | ||
bar.js | ||
templates/ | ||
components/ | ||
foo.hbs | ||
namespace/ | ||
bar.hbs | ||
``` | ||
|
||
</td><td style="vertical-align:top"> | ||
|
||
``` | ||
{app,addon}/ | ||
components/ | ||
foo/ | ||
component.js | ||
template.hbs | ||
namespace/ | ||
bar/ | ||
component.js | ||
template.hbs | ||
``` | ||
|
||
</td></tr></tbody> | ||
</table> | ||
|
||
|
||
The above example(s) can be migrated to: | ||
|
||
``` | ||
{app,addon}/ | ||
components/ | ||
foo.js | ||
foo.hbs | ||
namespace/ | ||
bar.js | ||
bar.hbs | ||
``` | ||
|
||
Or using `--component-structure=nested` | ||
|
||
``` | ||
{app,addon}/ | ||
components/ | ||
foo/ | ||
index.js | ||
index.hbs | ||
namespace/ | ||
bar/ | ||
index.js | ||
index.hbs | ||
``` | ||
|
||
Note, however, that classic components _importing_ the `layout` and setting it on an `@ember/component` will still work. | ||
The key thing being deprecated is the runtime resolution of templates, so if there is an import involved, there is no runtime resolution. |