Skip to content

Commit d63e224

Browse files
authored
Merge pull request ember-learn#319 from ember-learn/locks-patch-7
Update debugging.md
2 parents f5892cb + d5eed0e commit d63e224

File tree

30 files changed

+365
-391
lines changed

30 files changed

+365
-391
lines changed

guides/release/configuring-ember/debugging.md

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ with your application.
33

44
## Routing
55

6-
#### Log router transitions
6+
### Log router transitions
77

88
```javascript {data-filename=app/app.js}
99
import Application from '@ember/application';
@@ -21,41 +21,37 @@ export default Application.extend({
2121
```
2222
## Views / Templates
2323

24-
#### Log view lookups
24+
### Log view lookups
2525

2626
```javascript {data-filename=config/environment.js}
2727
ENV.APP.LOG_VIEW_LOOKUPS = true;
2828
```
29-
#### View all registered templates
30-
```javascript
31-
Ember.keys(Ember.TEMPLATES)
32-
```
3329

3430
## Controllers
3531

36-
#### Log generated controller
32+
### Log generated controller
3733

3834
```javascript {data-filename=config/environment.js}
3935
ENV.APP.LOG_ACTIVE_GENERATION = true;
4036
```
4137

4238
## Observers / Binding
4339

44-
#### See all observers for an object, key
40+
### See all observers for an object, key
4541

4642
```javascript
4743
Ember.observersFor(comments, keyName);
4844
```
4945

50-
#### Log object bindings
46+
### Log object bindings
5147

5248
```javascript {data-filename=config/environments.js}
5349
ENV.APP.LOG_BINDINGS = true;
5450
```
5551

5652
## Miscellaneous
5753

58-
#### Turn on resolver resolution logging
54+
### Turn on resolver resolution logging
5955

6056
This option logs all the lookups that are done to the console. Custom objects
6157
you've created yourself have a tick, and Ember generated ones don't.
@@ -70,15 +66,14 @@ export default Application.extend({
7066
LOG_RESOLVER: true
7167
});
7268
```
73-
#### Dealing with deprecations
69+
### Dealing with deprecations
7470

7571
```javascript
7672
Ember.ENV.RAISE_ON_DEPRECATION = true;
7773
Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = true;
7874
```
7975

80-
81-
#### Implement an Ember.onerror hook to log all errors in production
76+
### Implement an Ember.onerror hook to log all errors in production
8277

8378
```javascript
8479
Ember.onerror = function(error) {
@@ -92,7 +87,7 @@ Ember.onerror = function(error) {
9287
}
9388
```
9489

95-
#### Import the console
90+
### Import the console
9691

9792
If you are using imports with Ember, be sure to import the console:
9893

@@ -106,28 +101,7 @@ Ember = {
106101
};
107102
```
108103

109-
#### Errors within an `RSVP.Promise`
110-
111-
There are times when dealing with promises that it seems like any errors
112-
are being 'swallowed', and not properly raised. This makes it extremely
113-
difficult to track down where a given issue is coming from. Thankfully,
114-
`RSVP` has a solution for this problem built in.
115-
116-
You can provide an `onerror` function that will be called with the error
117-
details if any errors occur within your promise. This function can be anything,
118-
but a common practice is to call `console.assert` to dump the error to the
119-
console.
120-
121-
```javascript {data-filename=app/app.js}
122-
import { assert } from '@ember/debug';
123-
import RSVP from 'rsvp';
124-
125-
RSVP.on('error', function(error) {
126-
assert(error, false);
127-
});
128-
```
129-
130-
#### Errors within `Ember.run.later` Backburner
104+
### Errors within `Ember.run.later` Backburner
131105

132106
[Backburner.js](https://github.com/ebryn/backburner.js) has support for stitching the stacktraces together so that you can
133107
track down where an error thrown by `Ember.run.later` is being initiated from. Unfortunately,

guides/v1.10.0/understanding-ember/debugging.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ to inspect Ember objects in your application.
99

1010
## Routing
1111

12-
#### Log router transitions
12+
### Log router transitions
1313

1414
```javascript
1515
window.App = Ember.Application.create({
1616
// Basic logging, e.g. "Transitioned into 'post'"
17-
LOG_TRANSITIONS: true,
17+
LOG_TRANSITIONS: true,
1818

1919
// Extremely detailed logging, highlighting every internal
2020
// step made while transitioning into a route, including
@@ -24,19 +24,19 @@ window.App = Ember.Application.create({
2424
});
2525
```
2626

27-
#### View all registered routes
27+
### View all registered routes
2828

2929
```javascript
3030
Ember.keys(App.Router.router.recognizer.names)
3131
```
3232

33-
#### Get current route name / path
33+
### Get current route name / path
3434

3535
Ember installs the current route name and path on your
3636
app's `ApplicationController` as the properties
3737
`currentRouteName` and `currentPath`. `currentRouteName`'s
38-
value (e.g. `"comments.edit"`) can be used as the destination parameter of
39-
`transitionTo` and the `{{linkTo}}` Handlebars helper, while
38+
value (e.g. `"comments.edit"`) can be used as the destination parameter of
39+
`transitionTo` and the `{{linkTo}}` Handlebars helper, while
4040
`currentPath` serves as a full descriptor of each
4141
parent route that has been entered (e.g.
4242
`"admin.posts.show.comments.edit"`).
@@ -57,27 +57,27 @@ App.__container__.lookup("controller:application").get("currentPath")
5757

5858
## Views / Templates
5959

60-
#### Log view lookups
60+
### Log view lookups
6161

6262
```javascript
6363
window.App = Ember.Application.create({
6464
LOG_VIEW_LOOKUPS: true
6565
});
6666
```
6767

68-
#### Get the View object from its DOM Element's ID
68+
### Get the View object from its DOM Element's ID
6969

7070
```javascript
7171
Ember.View.views['ember605']
7272
```
7373

74-
#### View all registered templates
74+
### View all registered templates
7575

7676
```javascript
7777
Ember.keys(Ember.TEMPLATES)
7878
```
7979

80-
#### Handlebars Debugging Helpers
80+
### Handlebars Debugging Helpers
8181

8282
```handlebars
8383
{{debugger}}
@@ -86,7 +86,7 @@ Ember.keys(Ember.TEMPLATES)
8686

8787
## Controllers
8888

89-
#### Log generated controller
89+
### Log generated controller
9090

9191
```javascript
9292
window.App = Ember.Application.create({
@@ -96,11 +96,11 @@ window.App = Ember.Application.create({
9696

9797
## Ember Data
9898

99-
#### View ember-data's type maps
99+
### View ember-data's type maps
100100

101101
```javascript
102102
// all type maps in memory
103-
App.__container__.lookup('store:main').typeMaps
103+
App.__container__.lookup('store:main').typeMaps
104104

105105
// specific type map in memory
106106
App.__container__.lookup('store:main').typeMapFor(App.Color)
@@ -117,21 +117,21 @@ App.__container__.lookup('store:main').typeMapFor(App.Color).idToRecord["33"].ge
117117

118118
## Observers / Binding
119119

120-
#### See all observers for a object, key
120+
### See all observers for a object, key
121121

122122
```javascript
123123
Ember.observersFor(comments, keyName);
124124
```
125125

126-
#### Log object bindings
126+
### Log object bindings
127127

128128
```javascript
129129
Ember.LOG_BINDINGS = true
130130
```
131131

132132
## Miscellaneous
133133

134-
#### Turn on resolver resolution logging
134+
### Turn on resolver resolution logging
135135

136136
This option logs all the lookups that are done to the console. Custom objects
137137
you've created yourself have a tick, and Ember generated ones don't.
@@ -145,22 +145,22 @@ App = Ember.Application.create({
145145
});
146146
```
147147

148-
#### View an instance of something from the container
148+
### View an instance of something from the container
149149

150150
```javascript
151151
App.__container__.lookup("controller:posts")
152152
App.__container__.lookup("route:application")
153153
```
154154

155-
#### Dealing with deprecations
155+
### Dealing with deprecations
156156

157157
```javascript
158158
Ember.ENV.RAISE_ON_DEPRECATION = true
159159
Ember.LOG_STACKTRACE_ON_DEPRECATION = true
160160
```
161161

162162

163-
#### Implement an Ember.onerror hook to log all errors in production
163+
### Implement an Ember.onerror hook to log all errors in production
164164

165165
```javascript
166166
Ember.onerror = function(error) {
@@ -174,7 +174,7 @@ Ember.onerror = function(error) {
174174
}
175175
```
176176

177-
#### Import the console
177+
### Import the console
178178

179179
If you are using imports with Ember, be sure to import the console:
180180

@@ -188,7 +188,7 @@ Ember = {
188188
};
189189
```
190190

191-
#### Errors within an `RSVP.Promise`
191+
### Errors within an `RSVP.Promise`
192192

193193
There are times when dealing with promises that it seems like any errors
194194
are being 'swallowed', and not properly raised. This makes it extremely
@@ -206,7 +206,7 @@ Ember.RSVP.on('error', function(error) {
206206
});
207207
```
208208

209-
#### Errors within `Ember.run.later` ([Backburner.js](https://github.com/ebryn/backburner.js))
209+
### Errors within `Ember.run.later` ([Backburner.js](https://github.com/ebryn/backburner.js))
210210

211211
Backburner has support for stitching the stacktraces together so that you can
212212
track down where an erroring `Ember.run.later` is being initiated from. Unfortunately,

guides/v1.11.0/understanding-ember/debugging.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tooling for Chrome, Firefox, Safari, and Internet Explorer.
88

99
## Routing
1010

11-
#### Log router transitions
11+
### Log router transitions
1212

1313
```javascript {data-filename=app/app.js}
1414
export default Ember.Application.extend({
@@ -24,7 +24,7 @@ export default Ember.Application.extend({
2424
```
2525
## Views / Templates
2626

27-
#### Log view lookups
27+
### Log view lookups
2828

2929
```javascript {data-filename=config/environment.js}
3030
ENV.APP.LOG_VIEW_LOOKUPS = true;
@@ -34,7 +34,7 @@ ENV.APP.LOG_VIEW_LOOKUPS = true;
3434
Ember.keys(Ember.TEMPLATES)
3535
```
3636

37-
#### Handlebars Debugging Helpers
37+
### Handlebars Debugging Helpers
3838

3939
```handlebars
4040
{{debugger}}
@@ -43,29 +43,29 @@ Ember.keys(Ember.TEMPLATES)
4343

4444
## Controllers
4545

46-
#### Log generated controller
46+
### Log generated controller
4747

4848
```javascript {data-filename=config/environment.js}
4949
ENV.APP.LOG_ACTIVE_GENERATION = true;
5050
```
5151

5252
## Observers / Binding
5353

54-
#### See all observers for a object, key
54+
### See all observers for a object, key
5555

5656
```javascript
5757
Ember.observersFor(comments, keyName);
5858
```
5959

60-
#### Log object bindings
60+
### Log object bindings
6161

6262
```javascript {data-filename=config/environments.js}
6363
ENV.APP.LOG_BINDINGS = true
6464
```
6565

6666
## Miscellaneous
6767

68-
#### Turn on resolver resolution logging
68+
### Turn on resolver resolution logging
6969

7070
This option logs all the lookups that are done to the console. Custom objects
7171
you've created yourself have a tick, and Ember generated ones don't.
@@ -78,15 +78,15 @@ export default Ember.Application.extend({
7878
LOG_RESOLVER: true
7979
});
8080
```
81-
#### Dealing with deprecations
81+
### Dealing with deprecations
8282

8383
```javascript
8484
Ember.ENV.RAISE_ON_DEPRECATION = true
8585
Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = true
8686
```
8787

8888

89-
#### Implement an Ember.onerror hook to log all errors in production
89+
### Implement an Ember.onerror hook to log all errors in production
9090

9191
```javascript
9292
Ember.onerror = function(error) {
@@ -100,7 +100,7 @@ Ember.onerror = function(error) {
100100
}
101101
```
102102

103-
#### Import the console
103+
### Import the console
104104

105105
If you are using imports with Ember, be sure to import the console:
106106

@@ -114,7 +114,7 @@ Ember = {
114114
};
115115
```
116116

117-
#### Errors within an `RSVP.Promise`
117+
### Errors within an `RSVP.Promise`
118118

119119
There are times when dealing with promises that it seems like any errors
120120
are being 'swallowed', and not properly raised. This makes it extremely
@@ -132,7 +132,7 @@ Ember.RSVP.on('error', function(error) {
132132
});
133133
```
134134

135-
#### Errors within `Ember.run.later` ([Backburner.js](https://github.com/ebryn/backburner.js))
135+
### Errors within `Ember.run.later` ([Backburner.js](https://github.com/ebryn/backburner.js))
136136

137137
Backburner has support for stitching the stacktraces together so that you can
138138
track down where an erroring `Ember.run.later` is being initiated from. Unfortunately,

0 commit comments

Comments
 (0)