Skip to content

Commit acba85b

Browse files
committed
Updated sourcemap document and fixed interlinks.
1 parent 6a42bb0 commit acba85b

File tree

1 file changed

+55
-30
lines changed

1 file changed

+55
-30
lines changed

docs/sourcemaps.rst

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,49 @@
1-
.. _sourcemaps:
1+
.. _raven-js-sourcemaps:
22

33
Source Maps
44
===========
55

6-
In various browsers Sentry supports deminifying JavaScript via source maps. A source map is a file generated
7-
by your minifier which compresses a mapping of the minified file to the original uncompressed version(s).
6+
In various browsers Sentry supports deminifying JavaScript via source
7+
maps. A source map is a file generated by your minifier which compresses a
8+
mapping of the minified file to the original uncompressed version(s).
89

9-
One important thing to note is that even though we support mapping files, a users browser may not actually be able
10-
to collect the required information for the server to generate a sourcemap.
10+
One important thing to note is that even though we support mapping files,
11+
a users browser may not actually be able to collect the required
12+
information for the server to generate a sourcemap.
1113

1214
Sentry requires the following to be able to map tracebacks to their source:
1315

1416
* A source map header or footer
1517
* A publicly accessible uncompressed version of the source
1618
* A line of context that includes a line number, column number, and filename
1719

18-
The first two items are the responsibility of you, the end-user, and you can take care of publishing them as part
19-
of your build process. The latter however, with an individual line of context, is severely crippled in many browsers.
20+
The first two items are the responsibility of you, the end-user, and you
21+
can take care of publishing them as part of your build process. The latter
22+
however, with an individual line of context, is severely crippled in many
23+
browsers.
2024

21-
One thing to note is that Sentry will attempt to process the source map before storing (or grouping) an event. This ensures that if we are
22-
able to deminify the source, we'll be able to more effectively group similar events over time.</p>
25+
One thing to note is that Sentry will attempt to process the source map
26+
before storing (or grouping) an event. This ensures that if we are able to
27+
deminify the source, we'll be able to more effectively group similar
28+
events over time.</p>
2329

2430
Browser Support
2531
---------------
2632

27-
In our experiences, the only browser that routinely delivers usable error reports is **Google Chrome**.
33+
In our experiences, the only browser that routinely delivers usable error
34+
reports is **Google Chrome**.
2835

29-
For additional information, see this more up-to-date `wiki page <https://github.com/ryanseddon/source-map/wiki/Source-maps:-languages,-tools-and-other-inf>`_.
36+
For additional information, see this more up-to-date `wiki page
37+
<https://github.com/ryanseddon/source-map/wiki/Source-maps:-languages,-tools-and-other-inf>`_.
3038

3139
Generating a Source Map
3240
-----------------------
3341

34-
While there are several compression libraries which support source maps, as of writing our recommendation is to use
35-
`UglifyJS <https://github.com/mishoo/UglifyJS2>`_. That said, many tools such as `webpack <http://webpack.github.io/>`_ and `browserify <http://browserify.org/>`_.
42+
While there are several compression libraries which support source maps,
43+
as of writing our recommendation is to use `UglifyJS
44+
<https://github.com/mishoo/UglifyJS2>`_. That said, many tools such as
45+
`webpack <http://webpack.github.io/>`_ and `browserify
46+
<http://browserify.org/>`_.
3647

3748
As an example, we can look at how we used to do things with Sentry (pre-webpack):
3849

@@ -43,30 +54,38 @@ As an example, we can look at how we used to do things with Sentry (pre-webpack)
4354
--source-map-url={name}.map.js \
4455
--source-map={relpath}/{name}.map.js -o {output}
4556

46-
We won't attempt to go into the complexities of source maps, so we recommend taking a stab at compiling them, and running them against a validator.
57+
We won't attempt to go into the complexities of source maps, so we
58+
recommend taking a stab at compiling them, and running them against a
59+
validator.
4760

4861
Validating a Source Map
4962
-----------------------
5063

51-
We maintain an online validation tool that can be used to test your source (and sourcemaps) against: `sourcemaps.io <http://sourcemaps.io>`_.
64+
We maintain an online validation tool that can be used to test your source
65+
(and sourcemaps) against: `sourcemaps.io <http://sourcemaps.io>`_.
5266

5367
Uploading SourceMaps to Sentry
5468
------------------------------
5569

56-
In many cases your application may sit behind firewalls or you simply can't expose source code to the public. Sentry provides an abstraction called
57-
**Releases** which you can attach source artifacts to.
70+
In many cases your application may sit behind firewalls or you simply
71+
can't expose source code to the public. Sentry provides an abstraction
72+
called **Releases** which you can attach source artifacts to.
5873

59-
The release API is intended to allow you to store source files (and sourcemaps) within Sentry. This removes the requirement for them to be
60-
web-accessible, and also removes any inconsistency that could come from network flakiness (on either your end, or Sentry's end).
61-
62-
* Start by creating a new API key under your organization's API Keys nav (on the home).
74+
The release API is intended to allow you to store source files (and
75+
sourcemaps) within Sentry. This removes the requirement for them to be
76+
web-accessible, and also removes any inconsistency that could come from
77+
network flakiness (on either your end, or Sentry's end).
6378

79+
* Start by creating a new API key under your organization's API Keys nav
80+
(on the home).
6481
* Ensure you you have ``project:write`` selected under scopes.
82+
* You'll use HTTP basic auth with the api key being your username, and an
83+
empty value for the password.
6584

66-
* You'll use HTTP basic auth with the api key being your username, and an empty value for the password.
67-
68-
Now you need to setup your build system to create a release, and attach the various source files. You will want to upload all dist
69-
files (i.e. the minified/shipped JS), the referenced sourcemaps, and the files that those sourcemaps point to.
85+
Now you need to setup your build system to create a release, and attach
86+
the various source files. You will want to upload all dist files (i.e. the
87+
minified/shipped JS), the referenced sourcemaps, and the files that those
88+
sourcemaps point to.
7089

7190
.. code-block:: bash
7291
@@ -111,22 +130,28 @@ files (i.e. the minified/shipped JS), the referenced sourcemaps, and the files t
111130
-u [api_key]: \
112131
-X DELETE
113132
114-
Additionally, you'll need to configure [raven-js](https://github.com/getsentry/raven-js) to send the ``release``:
133+
Additionally, you'll need to configure
134+
[raven-js](https://github.com/getsentry/raven-js) to send the ``release``:
115135

116136
.. code-block:: javascript
117137
118138
Raven.config({
119139
release: '2da95dfb052f477380608d59d32b4ab9'
120140
});
121141
122-
Note: You dont *have* to upload the source files (ref'd by sourcemaps), but without them the grouping algorithm will not be as strong, and the UI will not show any contextual source.
142+
Note: You dont *have* to upload the source files (ref'd by sourcemaps),
143+
but without them the grouping algorithm will not be as strong, and the UI
144+
will not show any contextual source.
123145

124-
Additional information can be found in the `Releases API documentation <https://app.getsentry.com/docs/api/releases/>`_.
146+
Additional information can be found in the `Releases API documentation
147+
<https://app.getsentry.com/docs/api/releases/>`_.
125148

126149
.. sentry:edition:: hosted
127150
128151
Working Behind a Firewall
129152
-------------------------
130153

131-
While the recommended solution is to upload your source artifacts to Sentry, sometimes its nescessary to allow communication from Sentry's internal IPs. To
132-
work around this you can whitelist our :doc:`IP Ranges <../../ip-ranges>`.
154+
While the recommended solution is to upload your source artifacts to
155+
Sentry, sometimes its nescessary to allow communication from Sentry's
156+
internal IPs. To work around this you can whitelist our :doc:`IP
157+
Ranges <../../ip-ranges>`.

0 commit comments

Comments
 (0)