Skip to content

Commit 7045818

Browse files
authored
Merge branch 'master' into nvp/trustHTML
2 parents b3342ff + 6fa07d5 commit 7045818

File tree

456 files changed

+50182
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

456 files changed

+50182
-165
lines changed

.stylelintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# compiled output
55
/dist/
66
/public/assets
7+
/public/downloads
78

89
# addons
910
/.node_modules.ember-try/

guides/release/code-editors/index.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,6 @@ Shortcuts to navigate related files with Ember.js projects.
102102
[Ember Tools](https://github.com/AndrewRadev/ember_tools.vim) -
103103
Various tools for working with Ember.js projects.
104104

105-
## Atom
106-
107-
Atom is hackable text editor for the 21st Century.
108-
109-
[atom-ide-ember](https://github.com/josa42/atom-ide-ember) -
110-
Atom package to use the Ember Language Server.
111-
112-
[emberjs-atom](https://atom.io/packages/emberjs-atom) -
113-
Atom autocomplete and snippets for Ember.js.
114-
115-
[atom-ember-snippets](https://github.com/mattmcmanus/atom-ember-snippets) -
116-
Ember.js ES6, EmberData & Handlebars snippets for Atom editor.
117-
118-
[language-ember-htmlbars](https://atom.io/packages/language-ember-htmlbars) -
119-
Add Ember template syntax highlighting and indentation to Atom
120-
121105
## Sublime Text
122106

123107
A sophisticated text editor for code, markup and prose.
@@ -127,9 +111,3 @@ Ember CLI snippets for Sublime Text 3.
127111

128112
[ember-component-template-split-view](https://github.com/mmitchellgarcia/ember-component-template-split-view) -
129113
Super simple Sublime Text plugin that will let you open corresponding template or route files with Ember.js components.
130-
131-
## CodeLobster IDE
132-
133-
CodeLobster IDE is a smart free cross-platform editor.
134-
135-
[CodeLobster IDE plug-in for Ember](http://www.codelobster.com/emberjs.html) gives autocomplete and tooltips for Ember.js functions, context and dynamic help.

guides/release/components/template-tag-format.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ import { concat } from '@ember/helper';
174174
import { fn } from '@ember/helper';
175175
import { get } from '@ember/helper';
176176
import { hash } from '@ember/helper';
177+
import { uniqueId } from '@ember/helper';
177178

178179
// Built-in modifiers
179180
import { on } from '@ember/modifier';

guides/release/routing/controllers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### What is a Controller?
22

3-
A [Controller](https://api.emberjs.com/ember/release/classes/Ember.Controller) is routable object which receives a single property from the Route – `model` – which is the return value of the Route's [`model()`](https://api.emberjs.com/ember/release/classes/Route/methods/model?anchor=model) method.
3+
A [Controller](https://api.emberjs.com/ember/release/classes/Ember.Controller) is a routable object which receives a single property from the Route – `model` – which is the return value of the Route's [`model()`](https://api.emberjs.com/ember/release/classes/Route/methods/model?anchor=model) method.
44

55
The model is passed from the Route to the Controller by default using the [`setupController()`](https://api.emberjs.com/ember/release/classes/Route/methods/setupController?anchor=setupController) function. The Controller is then often used to decorate the model with display properties such as retrieving the full name from a name model.
66

guides/release/routing/linking-between-routes.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,34 @@ will be given the `active` CSS class. For example, if you were at the URL
9191
</ul>
9292
```
9393

94+
The CSS class name used for active classes can be customized for a single use of `<LinkTo />` by passing an `@activeClass` argument:
95+
96+
```handlebars {data-filename=app/templates/photos.hbs}
97+
<ul>
98+
{{#each this.photos as |p|}}
99+
<li>
100+
<LinkTo @route="photos.edit" @model={{p}} @activeClass="font-bold">{{p.title}}</LinkTo>
101+
</li>
102+
{{/each}}
103+
</ul>
104+
```
105+
106+
will result in:
107+
108+
```html
109+
<ul>
110+
<li>
111+
<a href="/photos/1">Happy Kittens</a>
112+
</li>
113+
<li>
114+
<a href="/photos/2" class="font-bold">Puppy Running</a>
115+
</li>
116+
<li>
117+
<a href="/photos/3">Mountain Landscape</a>
118+
</li>
119+
</ul>
120+
```
121+
94122
### Multiple Dynamic Segments
95123

96124
Sometimes, you may need to generate links for nested routes which can

guides/release/tutorial/part-1/orientation.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ To verify that your installation was successful, run:
2424

2525
```shell
2626
$ ember --version
27-
ember-cli: 6.0.1
28-
node: 18.20.5
27+
ember-cli: 6.4.0
28+
node: 18.20.8
2929
os: linux x64
3030
```
3131

@@ -38,13 +38,11 @@ We can create a new project using Ember CLI's `new` command. It follows the patt
3838
```shell
3939
$ ember new super-rentals --lang en
4040
installing app
41-
Ember CLI v6.0.1
41+
Ember CLI v6.4.0
4242

4343
Creating a new Ember app in /home/runner/work/super-rentals-tutorial/super-rentals-tutorial/dist/code/super-rentals:
4444
create .editorconfig
4545
create .ember-cli
46-
create .eslintignore
47-
create .eslintrc.js
4846
create .github/workflows/ci.yml
4947
create .prettierignore
5048
create .prettierrc.js
@@ -53,9 +51,11 @@ Creating a new Ember app in /home/runner/work/super-rentals-tutorial/super-renta
5351
create .template-lintrc.js
5452
create .watchmanconfig
5553
create README.md
54+
create /home/runner/work/super-rentals-tutorial/super-rentals-tutorial/dist/code/super-rentals/eslint.config.mjs
5655
create app/app.js
5756
create app/components/.gitkeep
5857
create app/controllers/.gitkeep
58+
create app/deprecation-workflow.js
5959
create app/helpers/.gitkeep
6060
create app/index.html
6161
create app/models/.gitkeep
@@ -123,6 +123,7 @@ super-rentals
123123
│ ├── templates
124124
│ │ └── application.hbs
125125
│ ├── app.js
126+
│ ├── deprecation-workflow.js
126127
│ ├── index.html
127128
│ └── router.js
128129
├── config
@@ -144,8 +145,6 @@ super-rentals
144145
├── .editorconfig
145146
├── .ember-cli
146147
├── .eslintcache
147-
├── .eslintignore
148-
├── .eslintrc.js
149148
├── .gitignore
150149
├── .prettierignore
151150
├── .prettierrc.js
@@ -155,6 +154,7 @@ super-rentals
155154
├── .watchmanconfig
156155
├── README.md
157156
├── ember-cli-build.js
157+
├── eslint.config.mjs
158158
├── package.json
159159
├── package-lock.json
160160
└── testem.js

guides/release/tutorial/part-2/ember-data.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,17 +334,22 @@ Let's start customizing the things that didn't work for us by default. Specifica
334334
335335
The first thing we want to do is have our builder respect a configurable default host and/or namespace. Adding a namespace prefix happens to be pretty common across Ember apps, so EmberData provides a global config mechanism for host and namespace. Typically you will want to do this either in your store file or app file.
336336
337-
```js { data-filename="app/app.js" data-diff="+5,+6,+7,+8,+9" }
337+
```js { data-filename="app/app.js" data-diff="+6,+7,+8,+9,+10" }
338338
import Application from '@ember/application';
339339
import Resolver from 'ember-resolver';
340340
import loadInitializers from 'ember-load-initializers';
341341
import config from 'super-rentals/config/environment';
342+
import { importSync, isDevelopingApp, macroCondition } from '@embroider/macros';
342343
import { setBuildURLConfig } from '@ember-data/request-utils';
343344

344345
setBuildURLConfig({
345346
namespace: 'api',
346347
});
347348

349+
if (macroCondition(isDevelopingApp())) {
350+
importSync('./deprecation-workflow');
351+
}
352+
348353
export default class App extends Application {
349354
modulePrefix = config.modulePrefix;
350355
podModulePrefix = config.podModulePrefix;

guides/v6.3.0/contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ At the top of the page (for the package, method, or class), you will find the wo
3131

3232
You can open the link to find a comment block. Make a pull request to update the comment block. The API Guides may take a few weeks to update while the future release is finalized.
3333

34-
Here is an example of updating a method. At the top of the section for [`store.createRecord()`](https://api.emberjs.com/ember-data/5.4.0/classes/Store/methods/createRecord?anchor=createRecord), you can find the words "Defined in."
34+
Here is an example of updating a method. At the top of the section for [`store.createRecord()`](https://api.emberjs.com/ember-data/5.3.12/classes/Store/methods/createRecord?anchor=createRecord), you can find the words "Defined in."
3535

3636
Next to the words is, once again, the link to the source code [`ds-model-store.ts`](https://github.com/emberjs/data/blob/master/packages/store/addon/-private/system/ds-model-store.ts).
3737

guides/v6.3.0/in-depth-topics/native-classes-in-depth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ after overriding. This allows the super class method to continue operating as it
720720
normally would.
721721

722722
One common example is when overriding the
723-
[`normalizeResponse()`](https://api.emberjs.com/ember-data/5.4.0/classes/JSONAPISerializer/methods/normalizeResponse?anchor=normalizeResponse)
723+
[`normalizeResponse()`](https://api.emberjs.com/ember-data/5.3.12/classes/JSONAPISerializer/methods/normalizeResponse?anchor=normalizeResponse)
724724
hook in one of EmberData's serializers.
725725

726726
A handy shortcut for this is to use a "spread operator", like `...arguments`:

guides/v6.3.0/models/creating-updating-and-deleting-records.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Creating Records
22

33
You can create records by calling the
4-
[`createRecord()`](https://api.emberjs.com/ember-data/5.4.0/classes/Store/methods/createRecord?anchor=createRecord)
4+
[`createRecord()`](https://api.emberjs.com/ember-data/5.3.12/classes/Store/methods/createRecord?anchor=createRecord)
55
method on the store.
66

77
```javascript
@@ -28,7 +28,7 @@ this.store.findRecord('post', 1).then(function(post) {
2828
## Persisting Records
2929

3030
Records in EmberData are persisted on a per-instance basis.
31-
Call [`save()`](https://api.emberjs.com/ember-data/5.4.0/classes/Model/methods/save?anchor=save)
31+
Call [`save()`](https://api.emberjs.com/ember-data/5.3.12/classes/Model/methods/save?anchor=save)
3232
on any instance of `Model` and it will make a network request.
3333

3434
EmberData takes care of tracking the state of each record for
@@ -60,10 +60,10 @@ store.findRecord('post', 1).then(function(post) {
6060

6161
You can tell if a record has outstanding changes that have not yet been
6262
saved by checking its
63-
[`hasDirtyAttributes`](https://api.emberjs.com/ember-data/5.4.0/classes/Model/properties/hasDirtyAttributes?anchor=hasDirtyAttributes)
63+
[`hasDirtyAttributes`](https://api.emberjs.com/ember-data/5.3.12/classes/Model/properties/hasDirtyAttributes?anchor=hasDirtyAttributes)
6464
property. You can also see which parts of
6565
the record were changed and what the original value was using the
66-
[`changedAttributes()`](https://api.emberjs.com/ember-data/5.4.0/classes/Model/methods/changedAttributes?anchor=changedAttributes)
66+
[`changedAttributes()`](https://api.emberjs.com/ember-data/5.3.12/classes/Model/methods/changedAttributes?anchor=changedAttributes)
6767
method. `changedAttributes` returns an object, whose keys are the changed
6868
properties and values are an array of values `[oldValue, newValue]`.
6969

@@ -75,7 +75,7 @@ person.hasDirtyAttributes; // => true
7575
person.changedAttributes(); // => { isAdmin: [false, true] }
7676
```
7777

78-
At this point, you can either persist your changes via `save()` or you can roll back your changes using [`rollbackAttributes()`](https://api.emberjs.com/ember-data/5.4.0/classes/Model/methods/rollbackAttributes?anchor=rollbackAttributes).
78+
At this point, you can either persist your changes via `save()` or you can roll back your changes using [`rollbackAttributes()`](https://api.emberjs.com/ember-data/5.3.12/classes/Model/methods/rollbackAttributes?anchor=rollbackAttributes).
7979

8080
```javascript
8181
person.hasDirtyAttributes; // => true
@@ -105,7 +105,7 @@ the errors from saving a blog post in your template:
105105

106106
## Promises
107107

108-
[`save()`](https://api.emberjs.com/ember-data/5.4.0/classes/Model/methods/save?anchor=save) returns
108+
[`save()`](https://api.emberjs.com/ember-data/5.3.12/classes/Model/methods/save?anchor=save) returns
109109
a promise, which makes it easy to asynchronously handle success and failure
110110
scenarios. Here's a common pattern:
111111

@@ -126,10 +126,10 @@ try {
126126

127127
## Deleting Records
128128

129-
Deleting records is as straightforward as creating records. Call [`deleteRecord()`](https://api.emberjs.com/ember-data/5.4.0/classes/Model/methods/deleteRecord?anchor=deleteRecord)
129+
Deleting records is as straightforward as creating records. Call [`deleteRecord()`](https://api.emberjs.com/ember-data/5.3.12/classes/Model/methods/deleteRecord?anchor=deleteRecord)
130130
on any instance of `Model`. This flags the record as `isDeleted`. The
131131
deletion can then be persisted using `save()`. Alternatively, you can use
132-
the [`destroyRecord`](https://api.emberjs.com/ember-data/5.4.0/classes/Model/methods/destroyRecord?anchor=destroyRecord) method to delete and persist at the same time.
132+
the [`destroyRecord`](https://api.emberjs.com/ember-data/5.3.12/classes/Model/methods/destroyRecord?anchor=destroyRecord) method to delete and persist at the same time.
133133

134134
```javascript
135135
let post = store.peekRecord('post', 1);

0 commit comments

Comments
 (0)