Skip to content

Commit 3ab4602

Browse files
authored
Merge branch 'main' into guide-for-deprecate-import-from-ember
2 parents 8d6afe3 + 73d9584 commit 3ab4602

File tree

8 files changed

+934
-1870
lines changed

8 files changed

+934
-1870
lines changed

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.11.0

app/templates/components/main-layout.hbs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
{{#each result.contents as |content|}}
1313
<DeprecationArticle @model={{content}}>
1414
<h3 id="{{id-for-deprecation (or content.displayId content.id) content.anchor}}">
15-
<a href="#{{id-for-deprecation (or content.displayId content.id) content.anchor}}" title={{content.title}} class="toc-anchor">
16-
§
17-
</a>
15+
<LinkTo @route="id" @model={{content.id}} title={{content.title}} class="toc-anchor">§</LinkTo>
1816
{{markdown-to-html
1917
content.title
2018
extensions="no-wrapper"

config/environment.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ module.exports = function (environment) {
3131
algoliaId: 'Y1OMR4C7MF',
3232
algoliaKey: '5d01c83734dc36754d9e94cbf6f8964d',
3333
},
34+
35+
'ember-showdown-shiki': {
36+
languages: [
37+
'javascript',
38+
'typescript',
39+
'handlebars',
40+
'json',
41+
'diff',
42+
'bash',
43+
],
44+
},
3445
};
3546

3647
if (environment === 'development') {

config/fastboot.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* global atob */
2+
module.exports = function () {
3+
return {
4+
buildSandboxGlobals(defaultGlobals) {
5+
return Object.assign({}, defaultGlobals, {
6+
atob: atob,
7+
});
8+
},
9+
};
10+
};
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)