Skip to content

Commit fd273c9

Browse files
committed
apply changes from review
1 parent 83ea5fb commit fd273c9

9 files changed

+82
-77
lines changed

guides/release/components/block-content.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ These are called blocks.
33
Here's an example that provides a component with the implicit default block.
44

55
```gjs
6-
import ExampleComponent from './example-component.gjs';
6+
import ExampleComponent from 'my-app/components/example-component';
77
88
<template>
99
<ExampleComponent>
@@ -17,7 +17,7 @@ import ExampleComponent from './example-component.gjs';
1717
This is equivalent to explicitly naming the default block using the named block syntax.
1818

1919
```gjs
20-
import ExampleComponent from './example-component.gjs';
20+
import ExampleComponent from 'my-app/components/example-component';
2121
2222
<template>
2323
<ExampleComponent>
@@ -103,8 +103,8 @@ and conditionals to handle the differences in content between them (see the
103103
previous chapters for details on how to do this).
104104

105105
```gjs {data-filename="app/components/message.gjs"}
106-
import MessageAvatar from './message/avatar.gjs';
107-
import MessageUsername from './message/username.gjs';
106+
import MessageAvatar from 'my-app/components/message/avatar';
107+
import MessageUsername from 'my-app/components/message/username';
108108
109109
<template>
110110
<MessageAvatar
@@ -132,8 +132,8 @@ supplied by the `<Message>` tag.
132132
The way to do this in Ember is by using the `{{yield}}` syntax.
133133

134134
```gjs {data-filename="app/components/message.gjs"}
135-
import MessageAvatar from './message/avatar.gjs';
136-
import MessageUsername from './message/username.gjs';
135+
import MessageAvatar from 'my-app/components/message/avatar';
136+
import MessageUsername from 'my-app/components/message/username';
137137
138138
<template>
139139
<MessageAvatar
@@ -174,7 +174,7 @@ You can think of using `{{yield}}` as leaving a placeholder for the content of t
174174
`<Message>` tag.
175175

176176
```gjs {data-filename="app/components/received-message.gjs"}
177-
import Message from './message.gjs';
177+
import Message from 'my-app/components/message';
178178
179179
<template>
180180
<Message
@@ -194,7 +194,7 @@ import Message from './message.gjs';
194194
```
195195

196196
```gjs {data-filename="app/components/sent-message.gjs"}
197-
import Message from './message.gjs';
197+
import Message from 'my-app/components/message';
198198
199199
<template>
200200
<Message
@@ -276,7 +276,7 @@ Now, if we use our `ErrorDialog` component without a block, we'll get the
276276
default message.
277277

278278
```gjs
279-
import ErrorDialog from './error-dialog.gjs';
279+
import ErrorDialog from 'my-app/components/error-dialog';
280280
281281
<template>
282282
<ErrorDialog/>
@@ -293,8 +293,8 @@ If we had a more detailed message, though, we could use the block to pass it to
293293
the dialog.
294294

295295
```gjs
296-
import ErrorDialog from './error-dialog.gjs';
297-
import Icon from './icon.gjs';
296+
import ErrorDialog from 'my-app/components/error-dialog';
297+
import Icon from 'my-app/components/icon';
298298
299299
<template>
300300
<ErrorDialog>
@@ -319,7 +319,7 @@ function in JavaScript. Consider for instance a simple `BlogPost` component.
319319
```
320320

321321
```gjs
322-
import BlogPost from './blog-post.gjs';
322+
import BlogPost from 'my-app/components/blog-post';
323323
324324
<template>
325325
<!-- usage -->
@@ -342,8 +342,8 @@ to them.
342342
```
343343

344344
```gjs
345-
import BlogPost from './blog-post.gjs';
346-
import AuthorBio from './author-bio.gjs';
345+
import BlogPost from 'my-app/components/blog-post';
346+
import AuthorBio from 'my-app/components/author-bio';
347347
348348
<template>
349349
<!-- usage -->
@@ -366,8 +366,8 @@ We can yield back multiple values as well, separated by spaces.
366366
```
367367

368368
```gjs
369-
import BlogPost from './blog-post.gjs';
370-
import AuthorBio from './author-bio.gjs';
369+
import BlogPost from 'my-app/components/blog-post';
370+
import AuthorBio from 'my-app/components/author-bio';
371371
372372
<template>
373373
<!-- usage -->
@@ -415,7 +415,7 @@ Without named blocks, we would certainly have to pass components as `args` to th
415415
Here’s how we would call our named blocks as a consumer:
416416

417417
```gjs
418-
import Popover from './popover.gjs';
418+
import Popover from 'my-app/components/popover';
419419
420420
<template>
421421
<Popover>
@@ -465,7 +465,7 @@ Don't worry, you can also still use `yield` by itself, and mix it with named blo
465465
A yielded block without a name is called `default`. So to access it, it’s like any other named blocks.
466466

467467
```gjs
468-
import Card from './card.gjs';
468+
import Card from 'my-app/components/card';
469469
470470
<template>
471471
<Card>
@@ -482,7 +482,7 @@ import Card from './card.gjs';
482482
The title being optional when you create a card, you can use the `(has-block)` helper with the named block by adding its name as a first parameter. That means you could also create this card:
483483

484484
```gjs
485-
import Card from './card.gjs';
485+
import Card from 'my-app/components/card';
486486
487487
<template>
488488
<Card>

guides/release/components/built-in-components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ When Ember renders this component, you will see the following HTML code:
3737

3838
Every input should be associated with a label. In HTML, there are a few ways to do this. With the built-in `<Input>` component,
3939

40-
#### 1. You can nest the input inside the label.
40+
1. You can nest the input inside the label.
4141

4242
```gjs
4343
import Component from "@glimmer/component";
@@ -60,7 +60,7 @@ export default class Example extends Component {
6060
}
6161
```
6262

63-
#### 2. You can create an ID (globally unique within the webpage), then associate the label to the input with `for` attribute and `id` attribute.
63+
2. You can create an ID (globally unique within the webpage), then associate the label to the input with `for` attribute and `id` attribute.
6464

6565
```gjs
6666
import Component from "@glimmer/component";
@@ -85,7 +85,7 @@ export default class Example extends Component {
8585
}
8686
```
8787

88-
#### 3. You can use the `aria-label` attribute to label the input with a string that is visually hidden but still available to assistive technology.
88+
3. You can use the `aria-label` attribute to label the input with a string that is visually hidden but still available to assistive technology.
8989

9090
```gjs
9191
import Component from "@glimmer/component";

guides/release/components/component-arguments-and-html-attributes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ and will be specified in the same way. We can now replace the received message
5656
avatar by using the `<Avatar>` tag and providing it with some arguments.
5757

5858
```gjs {data-filename="app/components/received-message/avatar.gjs"}
59-
import Avatar from "../avatar.gjs";
59+
import Avatar from "my-app/components/avatar";
6060
6161
<template>
6262
<Avatar @title="Tomster's avatar" @initial="T" />
@@ -91,7 +91,7 @@ the _browser_ what to do, it's telling your custom tag what to do.
9191
Let's try to use our `<Avatar>` component for the sent message avatar.
9292

9393
```gjs {data-filename="app/components/sent-message/avatar.gjs"}
94-
import Avatar from "../avatar.gjs";
94+
import Avatar from "my-app/components/avatar";
9595
9696
<template>
9797
<Avatar @title="Zoey's avatar" @initial="Z" />
@@ -111,7 +111,7 @@ We're just missing the `current-user` class on the HTML `<aside>` element. To
111111
make that work, we'll specify the HTML attribute `class` on the `<Avatar>` tag.
112112

113113
```gjs {data-filename="app/components/sent-message/avatar.gjs"}
114-
import Avatar from "../avatar.gjs";
114+
import Avatar from "my-app/components/avatar";
115115
116116
<template>
117117
<Avatar

guides/release/components/component-state-and-actions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ JavaScript to make your application interactive.
66
<div class="cta-note-body">
77
<div class="cta-note-heading">Zoey says...</div>
88
<div class="cta-note-message">
9-
Until now, we've been using template-only components. That is, our `.gjs` component files have consisted of a single `&lt;template&gt;` tag with our markup inside. Now, we're going to add a class. For a more thorough discussion of how `.gjs` files define components, see the section on <strong>template tag format</strong>.
9+
Until now, we've been using template-only components. That is, our `.gjs` component files have consisted of a single `&lt;template&gt;` tag with our markup inside. Now, we're going to add a class. For a more thorough discussion of how `.gjs` files define components, see the section on <a href="../template-tag-format/">template tag format</a>.
1010
</div>
1111
</div>
1212
<img src="/images/mascots/zoey.png" role="presentation" alt="">
@@ -64,14 +64,14 @@ property that we defined in the JavaScript class.
6464
The output looks the same as before, but now the `0` comes from JavaScript, and
6565
after some more work, we can change its value with the buttons.
6666

67-
## HTML Modifiers and Actions
67+
## Modifiers and Actions
6868

6969
Next, we want to wire up the buttons. When the user presses `+1`, we want
7070
`this.count` to go up by 1. When the user presses `-1`, we want it to go down
7171
by 1.
7272

73-
To attach an event handler to an HTML tag, we use the `on` HTML modifier. HTML
74-
modifiers are an Ember syntax that allow us to attach logic to a tag.
73+
To attach an event handler to an HTML tag, we use the `on` modifier. Modifiers
74+
are an Ember syntax that allow us to attach logic to a tag.
7575

7676
To make those event handlers do something, we will need to define those methods in the component class. These are sometime referred to as actions.
7777

guides/release/components/conditional-content.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ We can do this with an `if`.
9999
Now we can use this component like so:
100100

101101
```gjs
102-
import Username from './components/username.gjs';
102+
import Username from 'my-app/components/username';
103103
104104
<template>
105105
{{!-- call it with @localTime --}}
@@ -230,7 +230,7 @@ The component uses an inline `if` to conditionally apply the `is-active` class.
230230
Afterwards, we can refactor the initial components.
231231

232232
```gjs {data-filename="app/components/received-message/avatar.gjs"}
233-
import Avatar from '../avatar.gjs';
233+
import Avatar from 'my-app/components/avatar';
234234
235235
<template>
236236
<Avatar
@@ -242,7 +242,7 @@ import Avatar from '../avatar.gjs';
242242
```
243243

244244
```gjs {data-filename="app/components/sent-message/avatar.gjs"}
245-
import Avatar from '../avatar.gjs';
245+
import Avatar from 'my-app/components/avatar';
246246
247247
<template>
248248
<Avatar

guides/release/components/helper-functions.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Ember's template syntax limits what you can express to keep the structure of you
55
Let's take a look at a generic message component from a messaging app.
66

77
```gjs {data-filename="app/components/message.gjs"}
8-
import MessageAvatar from './message/avatar.gjs';
9-
import MessageUsername from './message/username.gjs';
8+
import MessageAvatar from 'my-app/components/message/avatar';
9+
import MessageUsername from 'my-app/components/message/username';
1010
1111
<template>
1212
<MessageAvatar
@@ -27,7 +27,7 @@ import MessageUsername from './message/username.gjs';
2727
```
2828

2929
```gjs
30-
import Message from './message.gjs';
30+
import Message from 'my-app/components/message';
3131
3232
<template>
3333
<Message
@@ -52,8 +52,8 @@ Let's update the component to do that. It'll take a `@username` argument and cal
5252
Since the title is just the `@username` plus some extra stuff, we can replace `@avatarTitle` by _interpolating_ the `@username` argument in a string literal passed to `<Message::Avatar>`.
5353

5454
```gjs {data-filename="app/components/message.gjs" data-diff="-6,+7"}
55-
import MessageAvatar from './message/avatar.gjs';
56-
import MessageUsername from './message/username.gjs';
55+
import MessageAvatar from 'my-app/components/message/avatar';
56+
import MessageUsername from 'my-app/components/message/username';
5757
5858
<template>
5959
<MessageAvatar
@@ -85,8 +85,8 @@ It's possible to use plain functions for helpers and modifiers. A plain helper f
8585
We can then use this helper in the component's template to get the first letter of the username.
8686

8787
```gjs {data-filename="app/components/message.gjs" data-diff="+4,+5,+6,+7,-12,+13"}
88-
import MessageAvatar from './message/avatar.gjs';
89-
import MessageUsername from './message/username.gjs';
88+
import MessageAvatar from 'my-app/components/message/avatar';
89+
import MessageUsername from 'my-app/components/message/username';
9090
9191
// Regular JavaScript function to exctract a substring
9292
function substring(string, start, end) {
@@ -121,8 +121,8 @@ Using named arguments, we could make our template a lot clearer.
121121
Helpers take _named arguments_ as a JavaScript object. All named arguments are grouped into an "options object" as the last parameter.
122122

123123
```gjs {data-filename="app/components/message.gjs" data-diff="-5,-6,+7,+8,-14,+15"}
124-
import MessageAvatar from './message/avatar.gjs';
125-
import MessageUsername from './message/username.gjs';
124+
import MessageAvatar from 'my-app/components/message/avatar';
125+
import MessageUsername from 'my-app/components/message/username';
126126
127127
// Regular JavaScript function to exctract a substring
128128
function substring(string, start, end) {
@@ -215,8 +215,8 @@ export default function substring(string, start, end) {
215215
We can then import this helper and use it in the component's template to get the first letter of the username.
216216

217217
```gjs {data-filename="app/components/message.gjs" data-diff="+3,-8,+9"}
218-
import MessageAvatar from './message/avatar.gjs';
219-
import MessageUsername from './message/username.gjs';
218+
import MessageAvatar from 'my-app/components/message/avatar';
219+
import MessageUsername from 'my-app/components/message/username';
220220
import substring from '../helpers/substring.js';
221221
222222
<template>
@@ -446,7 +446,7 @@ you can pass arrays directly from the template as an argument to your components
446446

447447
```gjs
448448
import { array } from '@ember/helper';
449-
import MyComponent from './my-component.gjs';
449+
import MyComponent from 'my-app/components/my-component';
450450
451451
const myOtherPerson = 'George Washington';
452452
@@ -481,7 +481,7 @@ components.
481481

482482
```gjs
483483
import { hash } from '@ember/helper';
484-
import Greeting from './greeting.gjs';
484+
import Greeting from 'my-app/components/greeting';
485485
486486
<template>
487487
<Greeting

0 commit comments

Comments
 (0)