Skip to content

Commit 272f442

Browse files
authored
Merge pull request ember-learn#573 from ember-learn/octane-merge-master
Merge latest master into Octane
2 parents e2753e2 + 86605c0 commit 272f442

File tree

139 files changed

+19966
-1607
lines changed

Some content is hidden

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

139 files changed

+19966
-1607
lines changed

.local.dic

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Ctrl-C
2727
customizations
2828
D3
2929
dasherize
30+
DataAdapter
3031
datepicker
3132
de
3233
debounce
@@ -36,6 +37,7 @@ deserializing
3637
draggable
3738
durations
3839
enumerables
40+
ember-a11y
3941
ember-cli-deprecation-workflow
4042
ember-cli-cjs-transform
4143
ember-cli-mirage.
@@ -46,13 +48,15 @@ erroring
4648
Evented
4749
facto
4850
falsy
51+
focusable
4952
frontend
5053
fullname
5154
geocode
5255
geocoding
5356
Geolocation
5457
globbing
5558
*google
59+
HammerJS
5660
hardcode
5761
hashchange
5862
Hoc
@@ -74,6 +78,8 @@ modularity
7478
naïve
7579
nav
7680
*NPM
81+
NVDA
82+
Orca
7783
Param
7884
param
7985
params
@@ -88,6 +94,7 @@ prepend
8894
pre-transition
8995
readme
9096
readonly
97+
recognizers
9198
relayout
9299
repo
93100
rerender
@@ -108,12 +115,18 @@ subexpression
108115
suboptimal
109116
substate
110117
substates
118+
syntaxes
119+
TalkBack
111120
teardown
112121
templating
113122
todo
114123
todos
115124
typeahead
125+
UIs
116126
unsilence
117127
untrusted
118128
usecase
119-
viewport
129+
viewport
130+
VoiceOver
131+
WAI-ARIA
132+
WCAG

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ before_install:
2929
script:
3030
- npm run lint:hbs
3131
- npm run lint:js
32+
- npm run lint:md
3233
- npm test

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
## Ember Guides Source [![Build Status](https://travis-ci.org/ember-learn/guides-source.svg?branch=master)](https://travis-ci.org/ember-learn/guides-source)
33

44
This repository contains the written content
5-
for the [Ember.js Guides](https://guides.emberjs.com).
6-
Here, contributors can file issues and submit PRs to
5+
for the [Ember.js Guides](https://guides.emberjs.com).
6+
Here, contributors can file issues and submit PRs to
77
help improve the learning experience of other developers.
88

9-
Looking for repositories for the other parts of [emberjs.com](https://emberjs.com)?
9+
Looking for repositories for the other parts of [emberjs.com](https://emberjs.com)?
1010
Check out
1111
[website](https://github.com/emberjs/website),
1212
[ember-api-docs](https://github.com/ember-learn/ember-api-docs),
@@ -19,9 +19,9 @@ and [styleguide](https://github.com/ember-learn/ember-styleguide).
1919

2020
Welcome and thanks for your help! Please see [CONTRIBUTING.md](CONTRIBUTING.md)
2121
for detailed instructions on how to format your work and submit a Pull Request.
22-
First-time contributors are encouraged to choose issues that are labeled
22+
First-time contributors are encouraged to choose issues that are labeled
2323
"help wanted" or "good for new contributors." If you have questions or
24-
want a buddy to pair with, you can join the
24+
want a buddy to pair with, you can join the
2525
[dev-ember-learning channel](https://discordapp.com/channels/480462759797063690/480777444203429888)
2626
in the [Ember Community Discord](https://discordapp.com/invite/zT3asNS).
2727

@@ -30,14 +30,15 @@ in the [Ember Community Discord](https://discordapp.com/invite/zT3asNS).
3030

3131
The Guides content takes the form of Markdown files (just like most READMEs).
3232
Each minor version of Ember has its own directory within `/guides/`.
33-
Pull requests should make edits to only the latest version of Ember,
34-
except in the case of bug reports for broken links.
33+
Pull requests should make edits to only the contents of the `guides/release` directory,
34+
which is the latest deployed version of the guides.
35+
The exception is that PRs to fix broken links in older versions of the guides are ok.
3536
On `ember serve`, the Markdown files are turned into HTML
36-
to create an app. Most of the functionality comes from
37-
[guidemaker](https://github.com/empress/guidemaker) and
37+
to create an app. Most of the functionality comes from
38+
[guidemaker](https://github.com/empress/guidemaker) and
3839
[guidemaker-ember-template](https://github.com/ember-learn/guidemaker-ember-template).
3940
The styles come from [ember-styleguide](https://github.com/ember-learn/ember-styleguide),
40-
the shared home of components and stylesheets used throughout the family of
41+
the shared home of components and stylesheets used throughout the family of
4142
Ember sites.
4243

4344
## Local Development
@@ -50,6 +51,8 @@ npm install
5051
ember serve
5152
```
5253

54+
Visit [http://localhost:4200](http://localhost:4200)
55+
5356
## Running tests
5457

5558
Use `npm` to run tests instead of `ember`, since we have additional
@@ -62,4 +65,4 @@ npm test
6265

6366
### Linting and spellchecking
6467

65-
The guides are spellchecked and linted for Markdown consistency. You can test your contributions by running `npm run lint::md`. Linting and spellchecking must pass or they will fail in Travis-CI. See [CONTRIBUTING.md](CONTRIBUTING.md) for more information on linting and spellchecking.
68+
The guides are spellchecked and linted for Markdown consistency. You can test your contributions by running `npm run lint:md`. Linting and spellchecking must pass or they will fail in Travis-CI. See [CONTRIBUTING.md](CONTRIBUTING.md) for more information on linting and spellchecking.

app/router.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,37 @@
11
import EmberRouter from '@ember/routing/router';
22
import config from './config/environment';
33

4+
import { get } from '@ember/object';
5+
import { inject as service } from '@ember/service';
6+
import { scheduleOnce } from '@ember/runloop';
7+
48
const Router = EmberRouter.extend({
59
location: config.locationType,
6-
rootURL: config.rootURL
10+
rootURL: config.rootURL,
11+
12+
metrics: service(),
13+
fastboot: service(),
14+
15+
didTransition() {
16+
this._super(...arguments);
17+
this._trackPage();
18+
},
19+
20+
_trackPage() {
21+
if(get(this, 'fastboot.isFastBoot')) {
22+
return;
23+
}
24+
25+
scheduleOnce('afterRender', this, () => {
26+
const page = this.url;
27+
const title = this.getWithDefault('currentRouteName', 'unknown');
28+
29+
// this is constant for this app and is only used to identify page views in the GA dashboard
30+
const hostname = 'guides.emberjs.com';
31+
32+
this.metrics.trackPage({ page, title, hostname });
33+
});
34+
},
735
});
836

937
Router.map(function() {

config/environment.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ module.exports = function(environment) {
4545
},
4646

4747
deprecationsGuideURL: 'https://www.emberjs.com/deprecations/',
48+
49+
metricsAdapters: [
50+
{
51+
name: 'GoogleAnalytics',
52+
environments: ['production'],
53+
config: {
54+
id: 'UA-27675533-1',
55+
require: ['linkid']
56+
}
57+
},
58+
],
59+
survey: {
60+
link: 'https://emberjs.com/ember-community-survey-2019/',
61+
title: '2019 Ember Community Survey'
62+
},
4863
};
4964

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

guides/release/applications/run-loop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For example:
1515
- DOM update and event callbacks
1616
- `setTimeout` and `setInterval` callbacks
1717
- `postMessage` and `messageChannel` event handlers
18-
- AJAX callbacks
18+
- Ajax callbacks
1919
- WebSocket callbacks
2020

2121
## Why is the run loop useful?

guides/release/components/adding-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ more reusable components.
205205

206206
## Handling Action Completion
207207

208-
Often actions perform asynchronous tasks, such as making an ajax request to a server.
208+
Often actions perform asynchronous tasks, such as making an Ajax request to a server.
209209
Since actions are functions that can be passed in by a parent component, they are able to return values when called.
210210
The most common scenario is for an action to return a promise so that the component can handle the action's completion.
211211

guides/release/components/defining-a-component.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ Given the above template, you can now use the `<BlogPost />` component:
2727
{{/each}}
2828
```
2929

30+
<div class="cta">
31+
<div class="cta-note">
32+
<div class="cta-note-body">
33+
<div class="cta-note-heading">Zoey says...</div>
34+
<div class="cta-note-message">
35+
In Ember templates there are different ways to invoke a Component. The syntax above is referred to as angle bracket invocation syntax, and it might not look familiar if you are looking at older code samples that use the classic invocation syntax. For more examples of ways to use Components in a template, see the <a href="../../reference/syntax-conversion-guide">Syntax Conversion Guide</a>, a <a href="https://guides.emberjs.com/v3.6.0/components/defining-a-component/">previous version of the Guides</a> or <a href="https://emberjs.com/api/ember/3.6/classes/Component">Ember.js API documentation</a>.
36+
</div>
37+
</div>
38+
<img src="/images/mascots/zoey.png" role="presentation" alt="Ember Mascot">
39+
</div>
40+
</div>
41+
3042
Its model is populated in `model` hook in the route handler:
3143

3244
```javascript {data-filename=app/routes/index.js}
@@ -43,7 +55,7 @@ Each component is backed by an element under the hood. By default,
4355
Ember will use a `<div>` element to contain your component's template.
4456
To learn how to change the element Ember uses for your component, see
4557
[Customizing a Component's
46-
Element](./customizing-a-components-element/).
58+
Element](../customizing-a-components-element/).
4759

4860

4961
## Defining a Component Subclass

guides/release/components/wrapping-content-in-a-component.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ In addition to the simple form you've learned so far,
2222
components also support being used in **block form**.
2323
In block form, components can be passed a Handlebars template that is rendered inside the component's template wherever the `{{yield}}` expression appears.
2424

25-
To use the block form, add a `#` character to the beginning of the component name,
26-
then make sure to add a closing tag.
27-
28-
See the Handlebars documentation on [block expressions](http://handlebarsjs.com/#block-expressions) for more.
25+
To use the block form, change the self-closing tag to a separate opening and closing tag: `<BlogPost></BlogPost>`
2926

3027
In that case, we can use the `<BlogPost />` component in **block form** and tell Ember where the block content should be rendered using the `{{yield}}` helper.
3128
To update the example above, we'll first change the component's template:

guides/release/ember-inspector/data.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ You can also filter records by entering a query in the search box.
3333
### Building a Data Custom Adapter
3434

3535
You can use your own data persistence library with the Inspector. Build a [data adapter][data-adapter-docs], and you can inspect your models
36-
using the Data tab. Use [Ember Data's data adapter][ember-data-data-adapter] as an example for how to build your data adapter.
36+
using the Data tab. Use [Ember Data's data adapter][ember-data-data-adapter] as an example for how to build your data adapter and [DataAdapter][class-data-adapter] documentation.
3737

3838
[data-adapter-docs]: https://github.com/emberjs/ember.js/blob/3ac2fdb0b7373cbe9f3100bdb9035dd87a849f64/packages/ember-extension-support/lib/data_adapter.js
3939
[ember-data-data-adapter]:https://github.com/emberjs/data/blob/d7988679590bff63f4d92c4b5ecab173bd624ebb/packages/ember-data/lib/system/debug/debug_adapter.js
40+
[class-data-adapter]:https://emberjs.com/api/ember/release/classes/DataAdapter

guides/release/models/customizing-adapters.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
In Ember Data, an Adapter determines how data is persisted to a
22
backend data store. Things such as the backend host, URL format
33
and headers used to talk to a REST API can all be configured
4-
in an adapter. You can even switch to storing data in local storage
5-
using a [local storage adapter](https://github.com/locks/ember-localstorage-adapter).
4+
in an adapter.
65

76
Ember Data's default Adapter has some built-in assumptions about
87
how a [REST API should look](http://jsonapi.org/). If your backend conventions
@@ -55,7 +54,7 @@ want to create an adapter that is radically different from the other
5554
Ember adapters.
5655

5756
- [DS.JSONAPIAdapter](https://www.emberjs.com/api/ember-data/release/classes/DS.JSONAPIAdapter)
58-
The `JSONAPIAdapter` is the default adapter and follows JSON API
57+
The `JSONAPIAdapter` is the default adapter and follows JSON:API
5958
conventions to communicate with an HTTP server by transmitting JSON
6059
via XHR.
6160

@@ -82,10 +81,10 @@ store.findRecord('post', 1).then(function(post) {
8281
});
8382
```
8483

85-
The JSON API adapter will automatically send a `GET` request to `/posts/1`.
84+
The JSON:API adapter will automatically send a `GET` request to `/posts/1`.
8685

8786
The actions you can take on a record map onto the following URLs in the
88-
JSON API adapter:
87+
JSON:API adapter:
8988

9089
<table>
9190
<thead>
@@ -131,7 +130,7 @@ inflector.uncountable('advice');
131130
export default {};
132131
```
133132

134-
The JSON API adapter will now make requests for `Campus` models to
133+
The JSON:API adapter will now make requests for `Campus` models to
135134
`/campuses` and `/campuses/1` (instead of `/campus/` and `/campus/1`),
136135
and requests for `advice` to `/advice` and `/advice/1` (instead of
137136
`/advices/` and `/advices/1`).
@@ -203,7 +202,7 @@ Requests for `user-profile` would now target `/user_profile/1`.
203202

204203
Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary
205204
headers can be set as key/value pairs on the `JSONAPIAdapter`'s `headers`
206-
object and Ember Data will send them along with each ajax request.
205+
object and Ember Data will send them along with each Ajax request.
207206
(Note that we set headers in `init()` because default property values
208207
should not be arrays or objects.)
209208

0 commit comments

Comments
 (0)