Skip to content

Commit c01db03

Browse files
authored
Merge pull request #1397 from MehulKChaudhari/mehulkc/v1-addon-content-for-types-deprecation-guide
add: contentFor types deprecation guide
2 parents 65ac033 + 2c3836d commit c01db03

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed

app/templates/index.hbs

+6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@
7878
@models={{array 'ember-cli' 'v5.x'}}
7979
>v5.x</LinkTo>
8080
</li>
81+
<li class='list-unstyled' data-test-ember-cli-6-link>
82+
<LinkTo
83+
@route='show'
84+
@models={{array 'ember-cli' 'v6.x'}}
85+
>v6.x</LinkTo>
86+
</li>
8187
</ul>
8288
</li>
8389
<li class='item list-unstyled'>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: V1 addon contentFor types
3+
since: 6.3.0
4+
until: 7.0.0
5+
---
6+
`app-prefix`, `app-suffix`, `tests-prefix`, and `tests-suffix` are deprecated as types passed to `contentFor`. See [RFC 1029](https://rfcs.emberjs.com/id/1029-deprecate-app-prefix) for more information.
7+
8+
#### app-prefix
9+
10+
Returning content from an addon's `contentFor()` hook for `type="app-prefix"` is deprecated. Addons will no longer be allowed to inject arbitrary javascript here. If you need to provide code that apps will run before booting, document that app authors should import and call your code at the start of their own `app.js` file.
11+
12+
#### app-suffix
13+
14+
Returning content from an addon's `contentFor()` hook for `type="app-suffix"` is deprecated. Addons will no longer be allowed to inject arbitrary javascript here. If you need to provide code that apps will run before booting, document that app authors should import and call your code at the start of their own `app.js` file.
15+
16+
If you were using app-suffix to overwrites modules provided by the app, that is intentionally not supported. Adjust your API to tell app authors to import your code and invoke it where appropriate.
17+
18+
#### tests-prefix
19+
20+
Returning content from an addon's `contentFor()` hook for `type="tests-prefix"` is deprecated. Addons will no longer be allowed to inject arbitrary javascript here. Provide utilities that users can import into their own test setup code instead.
21+
22+
#### tests-suffix
23+
24+
Returning content from an addon's `contentFor()` hook for `type="tests-suffix"` is deprecated. Addons will no longer be allowed to inject arbitrary javascript here. Provide utilities that users can import into their own test setup code instead.
25+
26+
#### vendor-prefix
27+
28+
Returning content from an addon's `contentFor()` hook for `type="vendor-prefix"` is deprecated. Addons will no longer be allowed to inject arbitrary javascript here. If you really need to run script (non-module) code, provides your own script via your addon's `/public` directory and either document that app authors should createa a `<script>` element in their HTML that includes it, or use `contentFor()` with one of the `type`s that appears in `index.html` to emit the scrip tag automatically. (`contentFor` targeting HTML is not deprecated, this deprecation only covers targeting javascript bundles.)
29+
30+
#### vendor-suffix
31+
32+
Returning content from an addon's `contentFor()` hook for `type="vendor-suffix"` is deprecated. Addons will no longer be allowed to inject arbitrary javascript here. If you really need to run script (non-module) code, provides your own script via your addon's `/public` directory and either document that app authors should createa a `<script>` element in their HTML that includes it, or use `contentFor()` with one of the `type`s that appears in `index.html` to emit the scrip tag automatically. (`contentFor` targeting HTML is not deprecated, this deprecation only covers targeting javascript bundles.)

ember-cli-build.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module.exports = function (defaults) {
3939
'/ember-cli/v2.x',
4040
'/ember-cli/v4.x',
4141
'/ember-cli/v5.x',
42+
'/ember-cli/v6.x',
4243
...getDeprecationFilenames(),
4344
],
4445
},

lib/content-docs-generator/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const contentFolders = [
1919
'ember-cli/v2',
2020
'ember-cli/v4',
2121
'ember-cli/v5',
22+
'ember-cli/v6',
2223
];
2324

2425
const jsonTrees = contentFolders.map(

tests/acceptance/visual-regression-test.js

+10
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ module('Acceptance | visual regression', function (hooks) {
100100

101101
await percySnapshot('ember-cli-5.x');
102102

103+
// v6.x Ember CLI
104+
await click('[data-test-main-deprecations-link]');
105+
await click('[data-test-ember-cli-6-link] > a');
106+
107+
assert
108+
.dom('[data-test-deprecations-added-in]')
109+
.hasText('Deprecations Added in Ember CLI 6.x');
110+
111+
await percySnapshot('ember-cli-6.x');
112+
103113
// v5.x Ember
104114
await click('[data-test-main-deprecations-link]');
105115
await click('[data-test-ember-5-link] > a');

0 commit comments

Comments
 (0)