Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Octane Guides #455

Merged
merged 607 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
607 commits
Select commit Hold shift + click to select a range
413d68f
just guessing now
NullVoxPopuli Aug 4, 2019
ccd3259
Fix the links?
NullVoxPopuli Aug 5, 2019
f00cc6b
Updated Testing by (1) rewriting Introduction (moved existing content…
ijlee2 Jul 27, 2019
83aa363
Update syntax-conversion-guide.md
MelSumner Aug 5, 2019
9373e27
Update quick-start
chancancode Aug 1, 2019
0cdd97b
Update core-concepts
chancancode Aug 2, 2019
06a3de3
fix everything
NullVoxPopuli Aug 6, 2019
11fb4e2
Merge pull request #977 from ember-learn/co-located-templates
jenweber Aug 6, 2019
04927ab
Add a link to the Octane Cheat Sheet
jenweber Aug 6, 2019
5a9a26e
Merge pull request #983 from ember-learn/add-octane-cheatsheet
MelSumner Aug 6, 2019
a6f62e7
Updated Introduction and Different Types of Tests based on PR feedback
ijlee2 Aug 6, 2019
30e6238
add newline
NullVoxPopuli Aug 7, 2019
8b2e46e
address warnings
NullVoxPopuli Aug 7, 2019
63e02c7
Merge branch 'octane' into fn-n-on
NullVoxPopuli Aug 8, 2019
87c3d54
Update guides/release/reference/syntax-conversion-guide.md
bantic Aug 8, 2019
bd31832
Update guides/release/reference/syntax-conversion-guide.md
bantic Aug 8, 2019
877fa22
Update guides/release/reference/syntax-conversion-guide.md
bantic Aug 8, 2019
cb563a4
Update guides/release/reference/syntax-conversion-guide.md
bantic Aug 8, 2019
674dbc5
Update guides/release/reference/syntax-conversion-guide.md
bantic Aug 8, 2019
0c0dd81
Update guides/release/reference/syntax-conversion-guide.md
bantic Aug 8, 2019
8ed95f9
Merge pull request #912 from NullVoxPopuli/fn-n-on
jenweber Aug 8, 2019
175c771
Merge pull request #965 from muziejus/actions
jenweber Aug 8, 2019
8b00c40
Merge pull request #954 from bantic/patch-1
jenweber Aug 12, 2019
ef0b810
Merge branch 'octane' into MelSumner-patch-3
jenweber Aug 12, 2019
38f24b0
Update binding-element-attributes.md
MelSumner Aug 12, 2019
9a2ed51
Updated `ember-ref-modifier` syntax
neojp Aug 13, 2019
b2f2dee
Merge pull request #997 from ember-learn/MelSumner-patch-4
sivakumar-kailasam Aug 13, 2019
d70b318
Merge pull request #976 from ember-learn/MelSumner-patch-3
sivakumar-kailasam Aug 13, 2019
f1e1c01
Access passed in action via this.args
sivakumar-kailasam Aug 13, 2019
dd9152f
Merge pull request #999 from ember-learn/fix/component-action
sivakumar-kailasam Aug 13, 2019
5385c7d
Merge pull request #998 from neojp/patch-1
acorncom Aug 17, 2019
a6fb95f
Updated Different Types of Tests (2nd round of feedback)
ijlee2 Aug 18, 2019
f55483b
Updated file name and URL from different-types-of-tests to test-types
ijlee2 Aug 26, 2019
dd14a57
Merge pull request #964 from ijlee2/octane-il-07272019
jenweber Aug 27, 2019
4ba7256
fix 404 on controllers page and move controllers file to routing
jenweber Aug 28, 2019
0cc7ae2
add missing newline
jenweber Aug 28, 2019
37d2121
Update api doc urls
sivakumar-kailasam Aug 28, 2019
5989b16
Merge pull request #1025 from ember-learn/controllers-404
sivakumar-kailasam Aug 28, 2019
1865b1d
Revamped octane tutorial (Part 1) (#1009)
chancancode Aug 28, 2019
454a517
fix: @tracked category declared twice
Alonski Aug 29, 2019
9a34853
Merge pull request #1027 from Alonski/patch-1
rwjblue Aug 30, 2019
025ccf1
Use `@model` named argument from route templates
chancancode Sep 7, 2019
7b39732
Merge ember-learn/super-rentals-tutorial#21
ember-tomster Sep 5, 2019
8380cd5
Merge ember-learn/super-rentals-tutorial#27
ember-tomster Sep 6, 2019
f0f962d
Fix image aspect ratio
chancancode Sep 6, 2019
090a6e5
Merge ember-learn/super-rentals-tutorial#28
ember-tomster Sep 6, 2019
7ae5e9a
Merge ember-learn/super-rentals-tutorial#30
ember-tomster Sep 7, 2019
c8fc448
Merge ember-learn/super-rentals-tutorial#31
ember-tomster Sep 7, 2019
95daea1
Merge pull request #1038 from ember-learn/super-rentals-tutorial
chancancode Sep 7, 2019
03b52fe
Merge pull request #1044 from ember-learn/model-arg
chancancode Sep 7, 2019
d4d77fe
Fix code blocks diff rendering
chancancode Sep 8, 2019
004550f
Octane Tutorial Updates (#1045)
github-actions[bot] Sep 8, 2019
62f08f2
PSA: You may now delete the branch
chancancode Sep 8, 2019
170f4f5
Merge pull request #1046 from ember-learn/fix-diff-format
rwjblue Sep 8, 2019
f12513b
Try a different CSS approach
chancancode Sep 8, 2019
d511db7
Merge pull request #1047 from ember-learn/delete-me
chancancode Sep 9, 2019
3c4852e
Merge pull request #1048 from ember-learn/fix-diff-format
rwjblue Sep 9, 2019
41afe09
Octane Tutorial Updates (#1050)
github-actions[bot] Sep 9, 2019
934e9db
Widen Zoey says...
chancancode Sep 8, 2019
3450bbe
Make code blocks denser
chancancode Sep 9, 2019
0ced899
Updates the edition guide to match the latest changes
Sep 11, 2019
bc6d9eb
Update guides/release/upgrading/editions.md
Sep 11, 2019
0a56a30
Apply suggestions from code review
Sep 11, 2019
a80d144
Use Ember Data decorators without parens where possible (#669)
bertdeblock Sep 12, 2019
cb0f0bb
Octane Tutorial Updates (#1055)
github-actions[bot] Sep 13, 2019
5ee50a6
Apply suggestions from code review
Sep 13, 2019
b999fe3
update mixin and to-components guidance
Sep 13, 2019
e3bc651
add table of contents
Sep 13, 2019
6593184
[FEAT] Adds @action, on, and fn to the edition guide
Sep 13, 2019
b8c5c84
[FEAT] Updates State Management Docs
Sep 13, 2019
f2fa64b
Remove extraneous file
chancancode Sep 15, 2019
27c9e53
Exclude downloads from fingerprinting
chancancode Sep 15, 2019
e405e28
Merge pull request #1073 from ember-learn/super-rentals-tutorial
chancancode Sep 15, 2019
f1f8d0b
Spellcheck
jenweber Sep 15, 2019
62212d9
spellcheck
jenweber Sep 15, 2019
0fc88af
Merge pull request #1062 from ember-learn/update-edition-guide-to-latest
jenweber Sep 15, 2019
f4b345e
Merge branch 'octane' into add-on-and-fn-guide
jenweber Sep 15, 2019
4994fb9
spellcheck
jenweber Sep 15, 2019
43cab9f
Merge pull request #1066 from ember-learn/add-on-and-fn-guide
jenweber Sep 15, 2019
d35a871
Resync octane branch with master
jenweber Sep 15, 2019
eb4e9ad
linting and spellchecking
jenweber Sep 15, 2019
af9aa91
fix index renames
jenweber Sep 15, 2019
6e155db
resolving TOC differences between octane & master
jenweber Sep 15, 2019
f6d44a0
Merge pull request #1049 from ember-learn/style-improvements
jenweber Sep 15, 2019
e4eefc9
Apply suggestions from code review
Sep 15, 2019
6915673
Add section on stubs to unit testing basics
Gaurav0 Sep 16, 2019
e73e8e2
Merge branch 'octane' into resync-with-master
jenweber Sep 18, 2019
73f7504
Merge pull request #1067 from ember-learn/update-state-management
jenweber Sep 18, 2019
5be7d8d
Merge pull request #1074 from ember-learn/resync-with-master
jenweber Sep 18, 2019
6a9945f
Octane Tutorial Updates (#1084)
github-actions[bot] Sep 20, 2019
79c2960
Octane Tutorial Updates (#1088)
github-actions[bot] Sep 21, 2019
66c2ba8
Merge ember-learn/super-rentals-tutorial#61 (#1090)
github-actions[bot] Sep 22, 2019
39c9c70
Octane Tutorial Updates (#1105)
github-actions[bot] Sep 26, 2019
aa62263
Octane Tutorial Updates (#1106)
github-actions[bot] Sep 26, 2019
0eb3765
Merge ember-learn/super-rentals-tutorial#68 (#1110)
github-actions[bot] Sep 26, 2019
8d748b4
Merge ember-learn/super-rentals-tutorial#71 (#1112)
github-actions[bot] Sep 28, 2019
619b272
Merge pull request #1063 from bertdeblock/improve-ember-data-decorato…
chancancode Sep 30, 2019
bfa3e3b
update octane banner
jenweber Oct 1, 2019
6f8693e
Removed alternate texts for Zoey & Tomster images in the release version
ijlee2 Oct 1, 2019
f1245c2
Update banner text with suggestions from rwjblue
jenweber Oct 2, 2019
8a83fdd
remove apostrophe
muziejus Oct 2, 2019
7c496ae
Merge pull request #1125 from ijlee2/octane-il-10012019
jenweber Oct 2, 2019
e600048
Merge pull request #1129 from muziejus/apostrophes
jenweber Oct 2, 2019
a1e98cd
Fix issues with code
Gaurav0 Oct 2, 2019
099d5fa
Merge pull request #1082 from Gaurav0/stubs
jenweber Oct 2, 2019
2b2e579
Fix closing tag and spelling
jenweber Oct 2, 2019
4dce6ab
Octane Tutorial Updates (#1126)
github-actions[bot] Oct 2, 2019
abd7e62
Merge pull request #1123 from ember-learn/octane-banner
jenweber Oct 4, 2019
449e139
Merge branch 'master' into update-octane-to-latest-master
Oct 9, 2019
33cb15e
Update octane to latest master (#1139)
Oct 9, 2019
fd28da0
Fixed code mistakes that I had made in testing pages
ijlee2 Oct 14, 2019
b566259
Document nested component invocation #1140
TomaszWegrzyn Oct 15, 2019
1bf1ddc
Markdown linting diff'd with master
Oct 16, 2019
ad85740
Merge pull request #1146 from maxwondercorn/octane
chancancode Oct 16, 2019
a45ffe6
[fix] update link to Working With JavaScript in Defining a Component …
Oct 16, 2019
0bd8076
Octane Tutorial Updates (#1135)
github-actions[bot] Oct 18, 2019
072c8a5
Change "comma" to "colon"
TomaszWegrzyn Oct 21, 2019
fdb9b71
[DOCS octane] Break out the upgrade guide into individual pages
Sep 23, 2019
9d2cb41
[CRON] Tuesday Oct 22, 2019
ember-tomster Oct 22, 2019
32b17cc
Merge pull request #1152 from ember-learn/super-rentals-tutorial
locks Oct 22, 2019
554d0a3
Merge pull request #1096 from ember-learn/docs/octane/break-out-octan…
jenweber Oct 22, 2019
eb339a8
Switch to showing ember-modifier usage (fixes #1151)
acorncom Oct 23, 2019
b89c0b7
Merge pull request #1154 from ember-learn/update-modifier-examples
sivakumar-kailasam Oct 23, 2019
2a9d1e7
Merge ember-learn/super-rentals-tutorial#91
ember-tomster Oct 25, 2019
c1e1506
Merge pull request #1147 from SYU15/octane
locks Oct 26, 2019
98a3fd6
Merge pull request #1158 from ember-learn/super-rentals-tutorial
locks Oct 26, 2019
4c2281b
update octane banner
jenweber Nov 1, 2019
5ccd527
Merge pull request #1162 from ember-learn/update-banner
jenweber Nov 2, 2019
08c5e10
Octane Tutorial Updates (#1159)
github-actions[bot] Nov 3, 2019
3366234
Add tutorial part 2 to TOC
chancancode Nov 3, 2019
4487896
Update workflow
chancancode Nov 3, 2019
5382de3
Merge pull request #1164 from ember-learn/super-rentals-tutorial
chancancode Nov 3, 2019
dff27dc
[CRON] Wednesday Nov 06, 2019
ember-tomster Nov 6, 2019
a4b9309
Merge pull request #1144 from ijlee2/octane-il-10142019
jenweber Nov 7, 2019
a41e512
[CRON] Saturday Nov 09, 2019
ember-tomster Nov 9, 2019
919a4ca
Fix typo
kategengler Nov 12, 2019
829b0ec
Merge pull request #1172 from ember-learn/kategengler-patch-1
amyrlam Nov 13, 2019
2ed0497
fix some inconsistencies
sly7-7 Nov 13, 2019
10a85a8
[CRON] Thursday Nov 14, 2019
ember-tomster Nov 14, 2019
bb10c91
update to dot notation in ember-data section
sly7-7 Nov 13, 2019
558ea3e
testing section: use dot notation where possible
sly7-7 Nov 14, 2019
7d3bc8f
add @tracked in the classNameBindings replacement
sly7-7 Nov 14, 2019
94d185a
Slight edits to nested components
jenweber Nov 15, 2019
3e0a8d2
Merge pull request #1145 from TomaszWegrzyn/octane
jenweber Nov 15, 2019
803c469
Update guides/release/routing/specifying-a-routes-model.md
sly7-7 Nov 15, 2019
c1e4b82
Merge pull request #1175 from sly7-7/update-testing-using-dot-notatio
acorncom Nov 15, 2019
a9f66a9
[CRON] Saturday Nov 16, 2019
ember-tomster Nov 16, 2019
155ee3f
Merge pull request #1174 from sly7-7/ember-data-use-dot-notation
jenweber Nov 18, 2019
82ab195
Merge pull request #1167 from ember-learn/super-rentals-tutorial
jenweber Nov 18, 2019
023f0da
Small change to force tests to re-run
jenweber Nov 18, 2019
945b67f
remove comma
jenweber Nov 18, 2019
24b578d
Merge pull request #1177 from sly7-7/class-name-binding-add-tracked
jenweber Nov 18, 2019
27e0d2e
[CRON] Tuesday Nov 19, 2019
ember-tomster Nov 19, 2019
abe846a
Clarify using the octane blueprint for ember new
ember-tomster Nov 21, 2019
73a2452
Merge pull request #1173 from sly7-7/fix-specifying-route-models
jenweber Nov 22, 2019
21e383c
Merge pull request #1181 from ember-learn/super-rentals-tutorial
jenweber Nov 22, 2019
d5048ca
[CRON] Sunday Nov 24, 2019
ember-tomster Nov 24, 2019
29e5320
[CRON] Sunday Dec 01, 2019
ember-tomster Dec 1, 2019
afb5380
Merge pull request #1185 from ember-learn/super-rentals-tutorial
jenweber Dec 6, 2019
7ff6eab
[DRAFT] Building the component guides from 0-60
wycats Oct 16, 2019
0c713c5
Component state guide
wycats Oct 21, 2019
726d963
[WIP] Derived state
wycats Oct 22, 2019
660ad10
Initial helper example
wycats Oct 28, 2019
934e161
Remove example that needs to be replaced
jenweber Oct 31, 2019
9caa474
More example cleanup
jenweber Oct 31, 2019
6156de1
Remove example
jenweber Oct 31, 2019
d50fb6e
Possible typo: should second `increment` be `decrement`?
rictic Nov 8, 2019
0f1ae40
wip
Dec 7, 2019
02dfabe
wip
Nov 11, 2019
16ba634
A number of small tweaks plus list skeleton
wycats Nov 27, 2019
fced775
Incorporated a few more pieces of feedback
wycats Dec 2, 2019
b8295da
Small tweaks
wycats Dec 2, 2019
2137c28
Small tweaks to the language and flow
wycats Dec 2, 2019
153ce97
Tweaks to the helper verbiage
wycats Dec 2, 2019
c6f921c
wip loops and other changes
Dec 6, 2019
b510634
wip loops and other changes
Dec 6, 2019
5f7ff69
wipppppp
Dec 7, 2019
001fa70
remove patterns-for-state
Dec 7, 2019
4a1c4a9
fix lints and links
Dec 7, 2019
749dd01
fix links
Dec 7, 2019
59e76c1
fix versions/tests
Dec 7, 2019
7db7973
Merge pull request #1150 from ember-learn/octane-components-update
Dec 7, 2019
da7a17a
[FEAT] Adds ToC Headings
Dec 7, 2019
efe67a8
[FEAT] Adds ToC Headings (#1191)
Dec 8, 2019
fae627a
Remove "installing" page and link to CLI guides
jenweber Dec 8, 2019
81bb4be
Fix one link to avoid redirect
jenweber Dec 8, 2019
6a7386d
update table of contents
jenweber Dec 8, 2019
5506b21
Remove hacks to hide versions dropdown, edit pencil, and search
jenweber Dec 8, 2019
4420904
Set analytics back to the right tracking
jenweber Dec 8, 2019
06324c2
Allow guides to be crawled
jenweber Dec 8, 2019
eeb318f
Update the info banner
jenweber Dec 8, 2019
5e6f932
update links
Dec 8, 2019
24c2b0c
Octane Remove "installing ember" page and link to CLI guides in… (#1193)
Dec 8, 2019
995edd4
Tutorial URLs reorg
chancancode Dec 8, 2019
e54d198
Tutorial URLs reorg (#1192)
Dec 8, 2019
435e661
Remove unusued deprecations page
jenweber Dec 8, 2019
472bb2d
Remove unused Anatomy of an App page
jenweber Dec 8, 2019
1635ac5
Move details for upgrading to octane to the octane upgrade guide
jenweber Dec 8, 2019
e7f6f72
Rework upgrade advice
jenweber Dec 8, 2019
ccd7ca9
Make it clear that ember-render-modifiers need to be installed
jenweber Dec 8, 2019
31556bf
fix lint
Dec 8, 2019
2b0f719
fix links
Dec 8, 2019
92a2c13
Update the upgrade guide (#1194)
Dec 8, 2019
f6c1baa
Adds back Application Concerns
Dec 8, 2019
6159afd
Update the Introduction pages
Dec 8, 2019
e9ddf16
Adds back Application Concerns (#1197)
Dec 9, 2019
9b61a9c
Octane Tutorial Updates (#1199)
github-actions[bot] Dec 9, 2019
77d992c
respond to feedback
Dec 9, 2019
e46fa95
fix lint
Dec 10, 2019
4a49bfe
Update the Introduction pages (#1196)
Dec 10, 2019
cf2b9e8
docs: link to ref modifier
amyrlam Dec 10, 2019
b06b563
Merge pull request #1201 from ember-learn/amy/docs-link
amyrlam Dec 10, 2019
1a87b81
Remove references to the octane blueprint
jenweber Dec 11, 2019
c0c7972
Slight editorial pass on the quick start
acorncom Dec 11, 2019
9264c62
Slight tweaks to the new component guides
acorncom Dec 11, 2019
8f9429a
Remove duplicate restriction about valid HTML elements in <body>
bartocc Dec 11, 2019
109f254
Clean up nested components info a tad (fixes #1207)
acorncom Dec 11, 2019
079f5aa
Merge pull request #1204 from ember-learn/quick-start-tweaks
acorncom Dec 12, 2019
9c65103
Merge pull request #1208 from bartocc/patch-4
jenweber Dec 14, 2019
d2406e6
Merge pull request #1205 from ember-learn/component-guides-tweaks
jenweber Dec 14, 2019
b8d419e
Merge pull request #1209 from ember-learn/tweak-octane-nested-components
jenweber Dec 14, 2019
06c0765
cut a release of v3.14.0
jenweber Dec 14, 2019
57e45c6
Merge branch 'tmp-release-3.15' into octane-release
jenweber Dec 14, 2019
3343524
update guidemaker version, closes #1179
jenweber Dec 14, 2019
68a8b3d
Updating the octane branch with the last few releases (#1211)
Dec 15, 2019
a6683d7
Octane - add missing redirects (#1210)
jenweber Dec 17, 2019
9b7bdba
Merge branch 'octane' into update-guidemaker
jenweber Dec 17, 2019
9cf7159
fix redirect (#1214)
jenweber Dec 19, 2019
4f6ae3c
Merge branch 'octane' into update-guidemaker
jenweber Dec 19, 2019
08283f4
Octane Tutorial Updates (#1213)
github-actions[bot] Dec 19, 2019
8e0c5bb
upd(configure:ember): add writeup on default-async-observers
jayjayjpg Dec 19, 2019
dbd475d
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
29003d2
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
a34cb9c
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
a9ce59e
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
979c45d
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
86f5921
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
89cb691
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
d06421d
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
97caf38
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
bcee1ec
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
82ea739
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
507fc6b
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
a349416
Update guides/release/configuring-ember/optional-features.md
jayjayjpg Dec 19, 2019
fee10f0
upd(config:ember): update wording on default async obs section
jayjayjpg Dec 19, 2019
a9de0fa
upd(config:ember): fix markdown markup and spelling errors
jayjayjpg Dec 20, 2019
319f7e5
Merge pull request #1212 from ember-learn/update-guidemaker
jenweber Dec 20, 2019
9f6acae
Merge branch 'octane' into final-octane-infra
jenweber Dec 20, 2019
2ef9641
Merge pull request #1195 from ember-learn/final-octane-infra
jenweber Dec 20, 2019
cc3c5cc
Merge pull request #1215 from jessica-jordan/asynctane2
jenweber Dec 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
609 changes: 609 additions & 0 deletions guides/release/components/actions-and-events.md

Large diffs are not rendered by default.

531 changes: 0 additions & 531 deletions guides/release/components/adding-actions.md

This file was deleted.

273 changes: 273 additions & 0 deletions guides/release/components/arguments-and-attributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
_Arguments_ and _attributes_ are the two kinds of things that you can pass to a
component when you use it in a template. Arguments are values that are prefixed
with the `@` symbol, and attributes are values that are not:

```handlebars
<Tooltip @content="Required Value" class="error"/>
```

In this example, we're passing the `@content` argument and the `class` attribute
to an instance of the `Tooltip` component.

Arguments are _JavaScript values_, which are accessible in both the component
template and its class instance, if a class exists. All kinds of values can be
passed as arguments to a component, and can be consumed and used with JavaScript
code.

Attributes, by contrast, are specifically _HTML attributes_, such as `class`,
`id`, `data-test`, and `role`. These get reflected directly onto HTML elements,
and are not accessible directly in either the template of a component, or its
class. Instead, components can direct where they are applied with the
`...attributes` syntax.

## Arguments

Arguments are values that you pass down to your component, and that can be
accessed in the template with the `@` symbol. If we define a `Tooltip`
component, we can pass a `@content` argument to it like so:

```handlebars
<Tooltip @content="Required Value" />
```

And then we can access it in the template for the `Tooltip` component like this:

```handlebars {data-filename=src/ui/components/tooltip/template.hbs}
{{@content}}
```

The same symbol `@` is used on both sides, so its easy to remember that this is
an argument coming from the caller whenever you're looking at the template. In
the component class you can access the arguments on the `args` property of the
class, since `@` is special character in JavaScript reserved for decorators:

```js {data-filename=src/ui/components/tooltip/component.js}
export default class Tooltip extends Component {
get upperCased() {
return this.args.content.toUpperCase();
}
}
```

In templates arguments are valid identifiers that can be used anywhere a
standard identifier can:

```handlebars
{{!-- in a helper --}}
{{capitalize @content}}

{{!-- in an attribute --}}
<div class="{{@class}}"></div>

{{!-- as an argument --}}
<Icon @type={{@iconType}} />
```

You can pass strings as arguments to components, or you can pass literal values
using double curlies:

```handlebars
<Tooltip
@icon="warning"
@count={{4}}
@isError={{false}}
/>
```

Note that if you do _not_ wrap literal values in double curlies, they are
treated as strings, like standard HTML attributes:

```handlebars
<Tooltip @isError=false />

{{!-- is equivalent to... --}}
<Tooltip @isError="false" />
```

You can also pass a class property, or the result of a helper, through
arguments:

```handlebars
<Tooltip
@icon={{this.icon}}
@isError={{not this.isWarning}}
/>
```

In short, arguments are how you pass _JavaScript values_ into a component. This
is part of why they are named _arguments_ - if you think of using a component
like calling a _function_, whose result is a new component that produces some
HTML, then arguments to a component are the same as arguments to a function.
They're values that you pass to the component that the component then uses to
produce a result (the final HTML).

### Argument Defaults

At some point, you may want to add default values to your arguments if one
wasn't passed to your component. Arguments are not mutable, so if you attempt to
reassign a value on `this.args`, it'll fail. Instead, you should define a getter
on your component that provides the default value if the argument was not
provided.

For instance, if you wanted to create a tooltip icon that had a standard icon
and class, you could do it like so:

```javascript {data-filename=src/ui/components/tooltip/component.js}
import Component from '@glimmer/component';

export default class Tooltip extends Component {
get icon() {
return this.args.icon || 'icon-info';
}

get tooltipClass() {
return this.args.tooltipClass + ' tooltip';
}
}
```

```handlebars {data-filename=src/ui/components/tooltip/template.hbs}
<div class="{{this.tooltipClass}}">
<i class="{{this.icon}}"></i>
{{@content}}
</div>
```

Now when called like so:

```handlebars
<Tooltip @content="I'm a tooltip!"/>
```

The result will be:

```html
<div class="tooltip">
<i class="icon-info"></i>
I'm a tooltip!
</div>
```

Note that because arguments are prefixed with `@` in templates, and placed on
`args` in the component definition, we can use the same name for our `icon` and
`tooltipClass` getters, which is pretty convenient. We can also tell clearly
when we look at the template for the tooltip that `this.tooltipClass` and
`this.icon` are values that come from the class definition, and that means they
probably have been used in some kind of dynamic code (in this case, our
defaulting logic).

### Attributes

While arguments are a way for you to pass JavaScript values into your
components, _attributes_ are about passing HTML attributes like `class`, `id`,
and `role` through your component, down to the final elements that get rendered.
This allows you to easily customize a component without having to add a bunch of
customization logic to every single component.

For instance, in our `<Tooltip>` component from above, instead of adding the
`@tooltipClass` argument, we could use attributes:

```handlebars {data-filename=src/ui/components/tooltip/template.hbs}
<div class="tooltip" ...attributes>
<i class="{{this.icon}}"></i>
{{@content}}
</div>
```

We would then invoke the component like this:

```handlebars
<Tooltip
@content="I'm a tooltip!"
class="warning-tooltip"
/>
```

Then our result is:

```html
<div class="tooltip warning-tooltip">
<i class="icon-info"></i>
I'm a tooltip!
</div>
```

The `...attributes` syntax is how you specify where the attributes should be
applied. It can be applied to elements or components, and you can use it on as
many elements or components within your component as you want:

```handlebars
<BlogPostTitle @title={{title}} ...attributes/>
<BlogPostContent>
<section ...attributes>
<p>
Here's some content!
</p>
</section>
</BlogPostContent>
```

Although typically you'll just want to put it on one of the top level components
or elements. If you don't use `...attributes` in your component and someone
tries to pass an attribute to it, Ember will do nothing, and the attributes will
not be applied.

#### Attribute Order

The positioning of `...attributes` matters, with respect to the other attributes
in the element it is applied to. Attributes that come _before_ `...attributes`
can be overriden, but attributes that come _after_ cannot:

```handlebars
<p
data-overridable="you can override me"
...attributes
data-non-overridable="but you can't override me!"
>
</p>
```

There is one exception to this, which is the `class` attribute. `class` will get
merged, since its more often the case that users of the component want to _add_
a class than completely override the existing ones. For `class`, the order of
`...attributes` will determine the order of merging. Putting it before:

```handlebars
<p ...attributes class="friend-greeting">Hello {{@friend}}, I'm {{this.name}}!</p>
```

Results in:

```html
<p class="red-alert friend-greeting">Hello {{@friend}}, I'm {{this.name}}!</p>
```

And putting it after:

```handlebars
<p class="friend-greeting" ...attributes>Hello {{@friend}}, I'm {{this.name}}!</p>
```

Results in:

```html
<p class="friend-greeting red-alert">Hello {{@friend}}, I'm {{this.name}}!</p>
```

#### Attributes and Modifiers

Modifiers are a concept that we haven't covered too deeply just yet, but they're
similar to helpers, except that they are applied directly to elements:

```handlebars
<div {{did-insert this.setupElement}}>
...
</div>
```

Modifiers can also be applied to components, and when they are, they are also
passed forward and applied to an element with `...attributes`:

```handlebars
<Tooltip {{did-insert this.setupTooltip}}/>
```
52 changes: 0 additions & 52 deletions guides/release/components/block-params.md

This file was deleted.

Loading