Skip to content

Commit 296c002

Browse files
committed
Add Backbone, Ember, and React configuration
1 parent 1ec9f94 commit 296c002

File tree

7 files changed

+141
-13
lines changed

7 files changed

+141
-13
lines changed

docs/index.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ Installation
2222

2323
Raven.js is distributed in a few different methods, and should get
2424
included after any other libraries are included, but before your own
25-
scripts. For all details see :doc:`install`. For just getting started,
26-
you can use our CDN:
25+
scripts. For all details see :doc:`install`.
2726

2827
.. sourcecode:: html
2928

30-
<script src="https://cdn.ravenjs.com/1.1.22/raven.min.js"></script>
29+
<script src="https://cdn.ravenjs.com/1.1.22/jquery,native/raven.min.js
3130

3231
Configuring the Project
3332
-----------------------
@@ -115,9 +114,9 @@ is additional documentation available that covers all the rest:
115114
:titlesonly:
116115

117116
install
118-
plugins
119117
config
120118
usage
119+
integrations
121120
sourcemaps
122121
tips
123122

docs/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Our CDN distributes builds with and without :doc:`plugins <plugins>`.
2828

2929
.. sourcecode:: html
3030

31-
<script src="https://cdn.ravenjs.com/1.1.22/raven.min.js"></script>
31+
<script src="https://cdn.ravenjs.com/1.1.22/jquery,native/raven.min.js
3232

3333
**We highly recommend trying out a plugin or two since it'll greatly
3434
improve the chances that we can collect good information.**

docs/integrations/backbone.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Backbone
2+
--------
3+
4+
Installation
5+
============
6+
7+
Start by adding the ``raven.js`` script tag to our page. You'll want to position it
8+
after you load all other external libraries (like jQuery), but before your code.
9+
10+
.. sourcecode:: html
11+
12+
<script src="https://cdn.ravenjs.com/1.1.22/backbone,jquery,native/raven.min.js
13+
14+
Configuring the Client
15+
----------------------
16+
17+
Now need to set up Raven.js to use your Sentry DSN:
18+
19+
.. code-block:: javascript
20+
21+
Raven.config('___PUBLIC_DSN___').install()
22+
23+
At this point, Raven is ready to capture any uncaught exception via standard hooks
24+
in addition to Backbone specific hooks.

docs/integrations/ember.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Ember
2+
-----
3+
4+
Installation
5+
============
6+
7+
Start by adding the ``raven.js`` script tag to our page. You'll want to position it
8+
after you load all other external libraries (like jQuery), but before your code.
9+
10+
.. sourcecode:: html
11+
12+
<script src="https://cdn.ravenjs.com/1.1.22/ember,jquery,native/raven.min.js
13+
14+
Configuring the Client
15+
----------------------
16+
17+
Now need to set up Raven.js to use your Sentry DSN:
18+
19+
.. code-block:: javascript
20+
21+
Raven.config('___PUBLIC_DSN___').install()
22+
23+
At this point, Raven is ready to capture any uncaught exception via standard hooks
24+
in addition to Ember's ``onError`` handlers.

docs/plugins.rst renamed to docs/integrations/index.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Plugins
2-
=======
1+
Integrations
2+
============
33

4-
Plugins extend the functionality of Raven.js to cover common libraries and
5-
environments automatically.
4+
Integrations extend the functionality of Raven.js to cover common libraries and
5+
environments automatically using simple plugins.
66

77
What are plugins?
88
~~~~~~~~~~~~~~~~~
@@ -24,8 +24,9 @@ information, so it's important that we inject code and wrap things
2424
magically so we can extract what we need. See :doc:`usage` for tips
2525
regarding that.
2626

27+
.. toctree::
28+
:maxdepth: 1
2729

28-
All Plugins
29-
~~~~~~~~~~~
30-
* https://github.com/getsentry/raven-js/tree/master/plugins
31-
* `Download <http://ravenjs.com>`_
30+
backbone
31+
ember
32+
react

docs/integrations/react.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
React
2+
--------
3+
4+
Installation
5+
============
6+
7+
Start by adding the ``raven.js`` script tag to our page. You'll want to position it
8+
after you load all other external libraries (like jQuery), but before your code.
9+
10+
.. sourcecode:: html
11+
12+
<script src="https://cdn.ravenjs.com/1.1.22/jquery,native/raven.min.js
13+
14+
Configuring the Client
15+
----------------------
16+
17+
Now need to set up Raven.js to use your Sentry DSN:
18+
19+
.. code-block:: javascript
20+
21+
Raven.config('___PUBLIC_DSN___').install()
22+
23+
At this point, Raven is ready to capture any uncaught exception.
24+
25+
Expanded Usage
26+
--------------
27+
28+
It's likely you'll end up in situations where you want to gracefully
29+
handle errors. A good pattern for this would be to setup a logError helper:
30+
31+
.. code-block:: javascript
32+
33+
function logException(ex, context) {
34+
Raven.captureException(ex, {
35+
extra: context
36+
});
37+
/*eslint no-console:0*/
38+
window.console && console.error && console.error(ex);
39+
}
40+
41+
Now in your components (or anywhere else), you can fail gracefully:
42+
43+
.. code-block:: javascript
44+
45+
var Component = React.createClass({
46+
render() {
47+
try {
48+
// ..
49+
} catch (ex) {
50+
logException(ex);
51+
}
52+
}
53+
});

docs/sentry-doc-config.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,33 @@
99
"index#configuring-the-client",
1010
"index#reporting-errors"
1111
]
12+
},
13+
"backbone": {
14+
"name": "Backbone",
15+
"type": "framework",
16+
"doc_link": "integrations/backbone/",
17+
"wizard": [
18+
"integrations/backbone#installation",
19+
"integrations/backbone#configuring-the-client"
20+
]
21+
},
22+
"ember": {
23+
"name": "Ember",
24+
"type": "framework",
25+
"doc_link": "integrations/ember/",
26+
"wizard": [
27+
"integrations/ember#installation",
28+
"integrations/ember#configuring-the-client"
29+
]
30+
},
31+
"react": {
32+
"name": "React",
33+
"type": "framework",
34+
"doc_link": "integrations/react/",
35+
"wizard": [
36+
"integrations/react#installation",
37+
"integrations/react#configuring-the-client"
38+
]
1239
}
1340
}
1441
}

0 commit comments

Comments
 (0)