Skip to content

Commit 41b84c9

Browse files
authored
3.1.0 (#611)
1 parent d781478 commit 41b84c9

24 files changed

+45
-100
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 3.1.0
4+
* NEW: Added TypeScript declaration file for compatibility with TypeScript projects. See: https://github.com/getsentry/raven-js/pull/610
5+
36
## 3.0.5
47
* BUGFIX: Fix breadcrumb instrumentation failing in IE8. See: https://github.com/getsentry/raven-js/issues/594
58

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raven-js",
3-
"version": "3.0.4",
3+
"version": "3.1.0",
44
"dependencies": {},
55
"main": "dist/raven.js",
66
"ignore": [

dist/plugins/angular.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.0.4 (0784c3c) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.1.0 (d781478) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

dist/plugins/angular.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/console.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.0.4 (0784c3c) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.1.0 (d781478) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

dist/plugins/console.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/ember.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.0.4 (0784c3c) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.1.0 (d781478) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

dist/plugins/ember.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plugins/require.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.0.4 (0784c3c) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.1.0 (d781478) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

dist/plugins/require.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/raven.js

+12-70
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.0.4 (0784c3c) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.1.0 (d781478) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -150,7 +150,7 @@ Raven.prototype = {
150150
// webpack (using a build step causes webpack #1617). Grunt verifies that
151151
// this value matches package.json during build.
152152
// See: https://github.com/getsentry/raven-js/issues/465
153-
VERSION: '3.0.4',
153+
VERSION: '3.1.0',
154154

155155
debug: false,
156156

@@ -210,14 +210,6 @@ Raven.prototype = {
210210
this._globalEndpoint = this._globalServer +
211211
'/' + path + 'api/' + this._globalProject + '/store/';
212212

213-
if (this._globalOptions.fetchContext) {
214-
TraceKit.remoteFetching = true;
215-
}
216-
217-
if (this._globalOptions.linesOfContext) {
218-
TraceKit.linesOfContext = this._globalOptions.linesOfContext;
219-
}
220-
221213
TraceKit.collectWindowErrors = !!this._globalOptions.collectWindowErrors;
222214

223215
// return for chaining
@@ -885,8 +877,15 @@ Raven.prototype = {
885877
// Capture breadcrubms from any click that is unhandled / bubbled up all the way
886878
// to the document. Do this before we instrument addEventListener.
887879
if (this._hasDocument) {
888-
document.addEventListener('click', self._breadcrumbEventHandler('click'));
889-
document.addEventListener('keypress', self._keypressEventHandler());
880+
if (document.addEventListener) {
881+
document.addEventListener('click', self._breadcrumbEventHandler('click'));
882+
document.addEventListener('keypress', self._keypressEventHandler());
883+
}
884+
else {
885+
// IE8 Compatibility
886+
document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
887+
document.attachEvent('onkeypress', self._keypressEventHandler());
888+
}
890889
}
891890

892891
// event targets borrowed from bugsnag-js:
@@ -1106,13 +1105,7 @@ Raven.prototype = {
11061105
lineno: frame.line,
11071106
colno: frame.column,
11081107
'function': frame.func || '?'
1109-
}, context = this._extractContextFromFrame(frame), i;
1110-
1111-
if (context) {
1112-
var keys = ['pre_context', 'context_line', 'post_context'];
1113-
i = 3;
1114-
while (i--) normalized[keys[i]] = context[i];
1115-
}
1108+
};
11161109

11171110
normalized.in_app = !( // determine if an exception came from outside of our app
11181111
// first we check the global includePaths list.
@@ -1126,45 +1119,6 @@ Raven.prototype = {
11261119
return normalized;
11271120
},
11281121

1129-
_extractContextFromFrame: function(frame) {
1130-
// immediately check if we should even attempt to parse a context
1131-
if (!frame.context || !this._globalOptions.fetchContext) return;
1132-
1133-
var context = frame.context,
1134-
pivot = ~~(context.length / 2),
1135-
i = context.length, isMinified = false;
1136-
1137-
while (i--) {
1138-
// We're making a guess to see if the source is minified or not.
1139-
// To do that, we make the assumption if *any* of the lines passed
1140-
// in are greater than 300 characters long, we bail.
1141-
// Sentry will see that there isn't a context
1142-
if (context[i].length > 300) {
1143-
isMinified = true;
1144-
break;
1145-
}
1146-
}
1147-
1148-
if (isMinified) {
1149-
// The source is minified and we don't know which column. Fuck it.
1150-
if (isUndefined(frame.column)) return;
1151-
1152-
// If the source is minified and has a frame column
1153-
// we take a chunk of the offending line to hopefully shed some light
1154-
return [
1155-
[], // no pre_context
1156-
context[pivot].substr(frame.column, 50), // grab 50 characters, starting at the offending column
1157-
[] // no post_context
1158-
];
1159-
}
1160-
1161-
return [
1162-
context.slice(0, pivot), // pre_context
1163-
context[pivot], // context_line
1164-
context.slice(pivot + 1) // post_context
1165-
];
1166-
},
1167-
11681122
_processException: function(type, message, fileurl, lineno, frames, options) {
11691123
var stacktrace, fullMessage;
11701124

@@ -1734,10 +1688,7 @@ var isUndefined = utils.isUndefined;
17341688
*/
17351689

17361690
var TraceKit = {
1737-
remoteFetching: false,
17381691
collectWindowErrors: true,
1739-
// 3 lines before, the offending line, 3 lines after
1740-
linesOfContext: 7,
17411692
debug: false
17421693
};
17431694

@@ -1897,7 +1848,6 @@ TraceKit.report = (function reportModuleWrapper() {
18971848
}
18981849

18991850
location.func = UNKNOWN_FUNCTION;
1900-
location.context = null;
19011851

19021852
stack = {
19031853
'name': name,
@@ -2000,7 +1950,6 @@ TraceKit.report = (function reportModuleWrapper() {
20001950
* s.stack[i].args - arguments passed to the function, if known
20011951
* s.stack[i].line - line number, if known
20021952
* s.stack[i].column - column number, if known
2003-
* s.stack[i].context - an array of source code lines; the middle element corresponds to the correct line#
20041953
*
20051954
* Supports:
20061955
* - Firefox: full stack trace with line numbers and unreliable column
@@ -2150,10 +2099,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
21502099
element.func = UNKNOWN_FUNCTION;
21512100
}
21522101

2153-
if (element.line) {
2154-
element.context = null;
2155-
}
2156-
21572102
stack.push(element);
21582103
}
21592104

@@ -2219,7 +2164,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
22192164
if (!element.func && element.line) {
22202165
element.func = UNKNOWN_FUNCTION;
22212166
}
2222-
element.context = [lines[line + 1]];
22232167

22242168
stack.push(element);
22252169
}
@@ -2307,7 +2251,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
23072251
if (!item.func) {
23082252
item.func = UNKNOWN_FUNCTION;
23092253
}
2310-
item.context = [lines[line + 1]];
23112254

23122255
stack.push(item);
23132256
}
@@ -2357,7 +2300,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
23572300
return false; // already in stack trace
23582301
} else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) {
23592302
stackInfo.stack[0].line = initial.line;
2360-
stackInfo.stack[0].context = initial.context;
23612303
return false;
23622304
}
23632305
}

dist/raven.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/raven.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sri.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"@dist/raven.js": {
33
"hashes": {
4-
"sha256": "BhyUFN42x1X3lpmcdqb9FeEEDX120bZD5Tviil7eN+U=",
5-
"sha512": "Dcum5QDTkYiE2J8Ds/8UcgOv18moIIbEg8f/2aYWcnl7MKx/015DAaqM0KmRI/bAL1r1l3r5E89H9eKfDPyBtg=="
4+
"sha256": "9exQEvaM4NkjZiQscZ7vaZZNu0np8tnC9fGGReyxFXg=",
5+
"sha512": "t7keBoCkzXX0uqzWc/tkHTMrDZBoOAs1K1decopIZpUsqXDHDdM/Xsho6rFmryJofQ4cVNAV4+nVmuaEJh4juA=="
66
},
77
"type": null,
8-
"integrity": "sha256-BhyUFN42x1X3lpmcdqb9FeEEDX120bZD5Tviil7eN+U= sha512-Dcum5QDTkYiE2J8Ds/8UcgOv18moIIbEg8f/2aYWcnl7MKx/015DAaqM0KmRI/bAL1r1l3r5E89H9eKfDPyBtg==",
8+
"integrity": "sha256-9exQEvaM4NkjZiQscZ7vaZZNu0np8tnC9fGGReyxFXg= sha512-t7keBoCkzXX0uqzWc/tkHTMrDZBoOAs1K1decopIZpUsqXDHDdM/Xsho6rFmryJofQ4cVNAV4+nVmuaEJh4juA==",
99
"path": "dist/raven.js"
1010
},
1111
"@dist/raven.min.js": {
1212
"hashes": {
13-
"sha256": "g9X2G0d7lq0Uv4i8OTMimZZ4V1WbnbDo6krrRaixbGI=",
14-
"sha512": "sTnnzoocXXoQsv0lJQHeLHyDmU9RL9jvzOzyCRuWByF+XlELresM7b5exk1vBu9E8B1o/kxA99ZcgkOeYBw8SQ=="
13+
"sha256": "eOzZlXH2N6ZXIB2rRnQSFPsUINO1W0UobAllDeMyTGI=",
14+
"sha512": "5Vq83HbmtmmeJjzwV9m50F1C3Q6VHouqvFJsYxkFytEspXYqoWNIysZ+l9+Xm0lNUBgXvWzzUz9Jj2DTMBO0hw=="
1515
},
1616
"type": null,
17-
"integrity": "sha256-g9X2G0d7lq0Uv4i8OTMimZZ4V1WbnbDo6krrRaixbGI= sha512-sTnnzoocXXoQsv0lJQHeLHyDmU9RL9jvzOzyCRuWByF+XlELresM7b5exk1vBu9E8B1o/kxA99ZcgkOeYBw8SQ==",
17+
"integrity": "sha256-eOzZlXH2N6ZXIB2rRnQSFPsUINO1W0UobAllDeMyTGI= sha512-5Vq83HbmtmmeJjzwV9m50F1C3Q6VHouqvFJsYxkFytEspXYqoWNIysZ+l9+Xm0lNUBgXvWzzUz9Jj2DTMBO0hw==",
1818
"path": "dist/raven.min.js"
1919
}
2020
}

docs/config.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Putting it all together
237237
<body>
238238
...
239239
<script src="jquery.min.js"></script>
240-
<script src="https://cdn.ravenjs.com/3.0.5/raven.min.js"></script>
240+
<script src="https://cdn.ravenjs.com/3.1.0/raven.min.js"></script>
241241
<script>
242242
Raven.config('___PUBLIC_DSN___', {
243243
logger: 'my-logger',

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ scripts. For all details see :doc:`install`.
2626

2727
.. sourcecode:: html
2828

29-
<script src="https://cdn.ravenjs.com/3.0.5/raven.min.js"></script>
29+
<script src="https://cdn.ravenjs.com/3.1.0/raven.min.js"></script>
3030

3131

3232
Configuring the Client

docs/install.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ So for example:
99
.. sourcecode:: html
1010

1111
<script src="jquery.js"></script>
12-
<script src="https://cdn.ravenjs.com/3.0.5/raven.min.js"></script>
12+
<script src="https://cdn.ravenjs.com/3.1.0/raven.min.js"></script>
1313
<script>Raven.config('___PUBLIC_DSN___').install();</script>
1414
<script src="app.js"></script>
1515

@@ -28,7 +28,7 @@ Our CDN distributes builds with and without :doc:`integrations <integrations/ind
2828

2929
.. sourcecode:: html
3030

31-
<script src="https://cdn.ravenjs.com/3.0.5/raven.min.js"></script>
31+
<script src="https://cdn.ravenjs.com/3.1.0/raven.min.js"></script>
3232

3333
This version does not include any plugins. See `ravenjs.com
3434
<http://ravenjs.com/>`_ for more information about plugins and getting

docs/integrations/angular.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Example:
2727
.. sourcecode:: html
2828

2929
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
30-
<script src="https://cdn.ravenjs.com/3.0.5/angular/raven.min.js"></script>
30+
<script src="https://cdn.ravenjs.com/3.1.0/angular/raven.min.js"></script>
3131
<script>Raven.config('___PUBLIC_DSN___').install();</script>
3232

3333
Note that this CDN build auto-initializes the Angular plugin.

docs/integrations/backbone.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ after you load all other external libraries (like jQuery), but before your code.
99

1010
.. sourcecode:: html
1111

12-
<script src="https://cdn.ravenjs.com/3.0.5/raven.min.js"></script>
12+
<script src="https://cdn.ravenjs.com/3.1.0/raven.min.js"></script>
1313

1414
Configuring the Client
1515
----------------------

docs/integrations/ember.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Example:
2323
.. sourcecode:: html
2424

2525
<script src="http://builds.emberjs.com/tags/v2.3.1/ember.prod.js"></script>
26-
<script src="https://cdn.ravenjs.com/3.0.5/ember/raven.min.js"></script>
26+
<script src="https://cdn.ravenjs.com/3.1.0/ember/raven.min.js"></script>
2727
<script>Raven.config('___PUBLIC_DSN___').install();</script>
2828

2929
Note that this CDN build auto-initializes the Ember plugin.

docs/integrations/react.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ after you load all other external libraries (like jQuery), but before your code.
99

1010
.. sourcecode:: html
1111

12-
<script src="https://cdn.ravenjs.com/3.0.5/raven.min.js"></script>
12+
<script src="https://cdn.ravenjs.com/3.1.0/raven.min.js"></script>
1313

1414
Configuring the Client
1515
----------------------

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raven-js",
3-
"version": "3.0.4",
3+
"version": "3.1.0",
44
"license": "BSD-2-Clause",
55
"homepage": "https://getsentry.com",
66
"scripts": {

src/raven.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Raven.prototype = {
8686
// webpack (using a build step causes webpack #1617). Grunt verifies that
8787
// this value matches package.json during build.
8888
// See: https://github.com/getsentry/raven-js/issues/465
89-
VERSION: '3.0.4',
89+
VERSION: '3.1.0',
9090

9191
debug: false,
9292

test/raven.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ describe('globals', function() {
965965
extra: {'session:duration': 100},
966966
});
967967
assert.deepEqual(opts.auth, {
968-
sentry_client: 'raven-js/3.0.4',
968+
sentry_client: 'raven-js/3.1.0',
969969
sentry_key: 'abc',
970970
sentry_version: '7'
971971
});
@@ -1012,7 +1012,7 @@ describe('globals', function() {
10121012
extra: {'session:duration': 100},
10131013
});
10141014
assert.deepEqual(opts.auth, {
1015-
sentry_client: 'raven-js/3.0.4',
1015+
sentry_client: 'raven-js/3.1.0',
10161016
sentry_key: 'abc',
10171017
sentry_secret: 'def',
10181018
sentry_version: '7'

0 commit comments

Comments
 (0)