Skip to content

Commit a721c9f

Browse files
authored
3.13.0 (#896)
1 parent 8e9e40e commit a721c9f

20 files changed

+121
-85
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 3.13.0
4+
* NEW: Added new `sampleRate` config option. See: https://github.com/getsentry/raven-js/pull/885
5+
* CHANGE: TypeScript declaration file (raven.d.ts) has been improved considerably. See: https://github.com/getsentry/raven-js/pull/827
6+
7+
## 3.12.2
8+
* BUGFIX: Fix Raven.js not capturing IE8 errors. See: https://github.com/getsentry/raven-js/pull/883
9+
310
## 3.12.1
411
* BUGFIX: Fix Raven.js not properly catching some thrown messages, objects. See: https://github.com/getsentry/raven-js/pull/872
512

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "raven-js",
3-
"version": "3.12.1",
3+
"version": "3.13.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.12.1 (3600a05) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.13.0 (14f0148) | 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.12.1 (3600a05) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.13.0 (14f0148) | 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.12.1 (3600a05) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.13.0 (14f0148) | 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.12.1 (3600a05) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.13.0 (14f0148) | 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/plugins/vue.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.12.1 (3600a05) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.13.0 (14f0148) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit

dist/plugins/vue.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

+89-60
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Raven.js 3.12.1 (3600a05) | github.com/getsentry/raven-js */
1+
/*! Raven.js 3.13.0 (14f0148) | github.com/getsentry/raven-js */
22

33
/*
44
* Includes TraceKit
@@ -11,35 +11,6 @@
1111
*/
1212

1313
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Raven = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
14-
exports = module.exports = stringify
15-
exports.getSerialize = serializer
16-
17-
function stringify(obj, replacer, spaces, cycleReplacer) {
18-
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
19-
}
20-
21-
function serializer(replacer, cycleReplacer) {
22-
var stack = [], keys = []
23-
24-
if (cycleReplacer == null) cycleReplacer = function(key, value) {
25-
if (stack[0] === value) return "[Circular ~]"
26-
return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
27-
}
28-
29-
return function(key, value) {
30-
if (stack.length > 0) {
31-
var thisPos = stack.indexOf(this)
32-
~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
33-
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
34-
if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
35-
}
36-
else stack.push(value)
37-
38-
return replacer == null ? value : replacer.call(this, key, value)
39-
}
40-
}
41-
42-
},{}],2:[function(_dereq_,module,exports){
4314
'use strict';
4415

4516
function RavenConfigError(message) {
@@ -51,7 +22,7 @@ RavenConfigError.prototype.constructor = RavenConfigError;
5122

5223
module.exports = RavenConfigError;
5324

54-
},{}],3:[function(_dereq_,module,exports){
25+
},{}],2:[function(_dereq_,module,exports){
5526
'use strict';
5627

5728
var wrapMethod = function(console, level, callback) {
@@ -90,21 +61,20 @@ module.exports = {
9061
wrapMethod: wrapMethod
9162
};
9263

93-
},{}],4:[function(_dereq_,module,exports){
64+
},{}],3:[function(_dereq_,module,exports){
9465
(function (global){
9566
/*global XDomainRequest:false, __DEV__:false*/
9667
'use strict';
9768

98-
var TraceKit = _dereq_(7);
99-
var RavenConfigError = _dereq_(2);
100-
var utils = _dereq_(6);
69+
var TraceKit = _dereq_(6);
70+
var stringify = _dereq_(7);
71+
var RavenConfigError = _dereq_(1);
72+
var utils = _dereq_(5);
10173

10274
var isError = utils.isError,
10375
isObject = utils.isObject;
10476

105-
var stringify = _dereq_(1);
106-
107-
var wrapConsoleMethod = _dereq_(3).wrapMethod;
77+
var wrapConsoleMethod = _dereq_(2).wrapMethod;
10878

10979
var dsnKeys = 'source protocol user pass host port path'.split(' '),
11080
dsnPattern = /^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/;
@@ -146,7 +116,8 @@ function Raven() {
146116
collectWindowErrors: true,
147117
maxMessageLength: 0,
148118
stackTraceLimit: 50,
149-
autoBreadcrumbs: true
119+
autoBreadcrumbs: true,
120+
sampleRate: 1
150121
};
151122
this._ignoreOnError = 0;
152123
this._isRavenInstalled = false;
@@ -181,7 +152,7 @@ Raven.prototype = {
181152
// webpack (using a build step causes webpack #1617). Grunt verifies that
182153
// this value matches package.json during build.
183154
// See: https://github.com/getsentry/raven-js/issues/465
184-
VERSION: '3.12.1',
155+
VERSION: '3.13.0',
185156

186157
debug: false,
187158

@@ -1583,7 +1554,13 @@ Raven.prototype = {
15831554
return;
15841555
}
15851556

1586-
this._sendProcessedPayload(data);
1557+
if (typeof globalOptions.sampleRate === 'number') {
1558+
if (Math.random() < globalOptions.sampleRate) {
1559+
this._sendProcessedPayload(data);
1560+
}
1561+
} else {
1562+
this._sendProcessedPayload(data);
1563+
}
15871564
},
15881565

15891566
_getUuid: function () {
@@ -1679,24 +1656,18 @@ Raven.prototype = {
16791656
if (!hasCORS) return;
16801657

16811658
var url = opts.url;
1682-
function handler() {
1683-
if (request.status === 200) {
1684-
if (opts.onSuccess) {
1685-
opts.onSuccess();
1686-
}
1687-
} else if (opts.onError) {
1688-
var err = new Error('Sentry error code: ' + request.status);
1689-
err.request = request;
1690-
opts.onError(err);
1691-
}
1692-
}
16931659

16941660
if ('withCredentials' in request) {
16951661
request.onreadystatechange = function () {
16961662
if (request.readyState !== 4) {
16971663
return;
1664+
} else if (request.status === 200) {
1665+
opts.onSuccess && opts.onSuccess();
1666+
} else if (opts.onError) {
1667+
var err = new Error('Sentry error code: ' + request.status);
1668+
err.request = request;
1669+
opts.onError(err);
16981670
}
1699-
handler();
17001671
};
17011672
} else {
17021673
request = new XDomainRequest();
@@ -1705,7 +1676,16 @@ Raven.prototype = {
17051676
url = url.replace(/^https?:/, '');
17061677

17071678
// onreadystatechange not supported by XDomainRequest
1708-
request.onload = handler;
1679+
if (opts.onSuccess) {
1680+
request.onload = opts.onSuccess;
1681+
}
1682+
if (opts.onError) {
1683+
request.onerror = function () {
1684+
var err = new Error('Sentry error code: XDomainRequest');
1685+
err.request = request;
1686+
opts.onError(err);
1687+
}
1688+
}
17091689
}
17101690

17111691
// NOTE: auth is intentionally sent as part of query string (NOT as custom
@@ -2059,7 +2039,7 @@ Raven.prototype.setReleaseContext = Raven.prototype.setRelease;
20592039
module.exports = Raven;
20602040

20612041
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2062-
},{"1":1,"2":2,"3":3,"6":6,"7":7}],5:[function(_dereq_,module,exports){
2042+
},{"1":1,"2":2,"5":5,"6":6,"7":7}],4:[function(_dereq_,module,exports){
20632043
(function (global){
20642044
/**
20652045
* Enforces a single instance of the Raven client, and the
@@ -2069,7 +2049,7 @@ module.exports = Raven;
20692049

20702050
'use strict';
20712051

2072-
var RavenConstructor = _dereq_(4);
2052+
var RavenConstructor = _dereq_(3);
20732053

20742054
// This is to be defensive in environments where window does not exist (see https://github.com/getsentry/raven-js/pull/785)
20752055
var _window = typeof window !== 'undefined' ? window
@@ -2096,7 +2076,7 @@ Raven.afterLoad();
20962076
module.exports = Raven;
20972077

20982078
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2099-
},{"4":4}],6:[function(_dereq_,module,exports){
2079+
},{"3":3}],5:[function(_dereq_,module,exports){
21002080
'use strict';
21012081

21022082
function isObject(what) {
@@ -2117,11 +2097,11 @@ module.exports = {
21172097
isObject: isObject,
21182098
isError: isError
21192099
};
2120-
},{}],7:[function(_dereq_,module,exports){
2100+
},{}],6:[function(_dereq_,module,exports){
21212101
(function (global){
21222102
'use strict';
21232103

2124-
var utils = _dereq_(6);
2104+
var utils = _dereq_(5);
21252105

21262106
/*
21272107
TraceKit - Cross brower stack traces
@@ -2737,5 +2717,54 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
27372717
module.exports = TraceKit;
27382718

27392719
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2740-
},{"6":6}]},{},[5])(5)
2720+
},{"5":5}],7:[function(_dereq_,module,exports){
2721+
'use strict';
2722+
2723+
/*
2724+
json-stringify-safe
2725+
Like JSON.stringify, but doesn't throw on circular references.
2726+
2727+
Originally forked from https://github.com/isaacs/json-stringify-safe
2728+
version 5.0.1 on 3/8/2017 and modified for IE8 compatibility.
2729+
Tests for this are in test/vendor.
2730+
2731+
ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
2732+
*/
2733+
2734+
exports = module.exports = stringify
2735+
exports.getSerialize = serializer
2736+
2737+
function indexOf(haystack, needle) {
2738+
for (var i = 0; i < haystack.length; ++i) {
2739+
if (haystack[i] === needle) return i;
2740+
}
2741+
return -1;
2742+
}
2743+
2744+
function stringify(obj, replacer, spaces, cycleReplacer) {
2745+
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
2746+
}
2747+
2748+
function serializer(replacer, cycleReplacer) {
2749+
var stack = [], keys = []
2750+
2751+
if (cycleReplacer == null) cycleReplacer = function(key, value) {
2752+
if (stack[0] === value) return '[Circular ~]'
2753+
return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']'
2754+
}
2755+
2756+
return function(key, value) {
2757+
if (stack.length > 0) {
2758+
var thisPos = indexOf(stack, this);
2759+
~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
2760+
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
2761+
if (~indexOf(stack, value)) value = cycleReplacer.call(this, key, value)
2762+
}
2763+
else stack.push(value)
2764+
2765+
return replacer == null ? value : replacer.call(this, key, value)
2766+
}
2767+
}
2768+
2769+
},{}]},{},[4])(4)
27412770
});

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": "lo47JDw5iui9P+8BVkoYgcXash9DqsapFwWuBx47xg4=",
5-
"sha512": "4VSTdDWObyBxQUbuBYSOd2MZlXM9F1CsRsC1LTyArrGbWiqHVIEEv8vuprjLF+5t3rGI9qJf4mMeBFyircjiIw=="
4+
"sha256": "wAN38p0JAtpJlZLfg2JorQnhb+koJMAUnHNwIMyMWaY=",
5+
"sha512": "HMfvmuJnixwjWGG+7GutYvWM3WUGb8UDKXSVbH45dn4R8Sjv/z4EjsVPqZW3Q7Irv6+EGCHIzqO+8JQbO0i5nA=="
66
},
77
"type": null,
8-
"integrity": "sha256-lo47JDw5iui9P+8BVkoYgcXash9DqsapFwWuBx47xg4= sha512-4VSTdDWObyBxQUbuBYSOd2MZlXM9F1CsRsC1LTyArrGbWiqHVIEEv8vuprjLF+5t3rGI9qJf4mMeBFyircjiIw==",
8+
"integrity": "sha256-wAN38p0JAtpJlZLfg2JorQnhb+koJMAUnHNwIMyMWaY= sha512-HMfvmuJnixwjWGG+7GutYvWM3WUGb8UDKXSVbH45dn4R8Sjv/z4EjsVPqZW3Q7Irv6+EGCHIzqO+8JQbO0i5nA==",
99
"path": "dist/raven.js"
1010
},
1111
"@dist/raven.min.js": {
1212
"hashes": {
13-
"sha256": "8uqNKvEWACUnXXdaGWrX2mEz3TEE2h+m5dcC8DJVyCI=",
14-
"sha512": "LobR1Ghrmpm2vODObzjVZuWLajD0wEl58MWvfBzfeSQA4K0VrZSNBpwlEOpKhNPD/qwdSPAoKdXWilbAzryNNA=="
13+
"sha256": "as5k5ICJN6NZprhTvCU092wrki+x7UooYB73ISJS5eE=",
14+
"sha512": "PczlI0rrIWFxUH5tDiANPmnSux37vz+zdrso7bqXgT568jG9iMqkdbXOK11zv2drKJWdYMjbh/v0REgI9nFRlQ=="
1515
},
1616
"type": null,
17-
"integrity": "sha256-8uqNKvEWACUnXXdaGWrX2mEz3TEE2h+m5dcC8DJVyCI= sha512-LobR1Ghrmpm2vODObzjVZuWLajD0wEl58MWvfBzfeSQA4K0VrZSNBpwlEOpKhNPD/qwdSPAoKdXWilbAzryNNA==",
17+
"integrity": "sha256-as5k5ICJN6NZprhTvCU092wrki+x7UooYB73ISJS5eE= sha512-PczlI0rrIWFxUH5tDiANPmnSux37vz+zdrso7bqXgT568jG9iMqkdbXOK11zv2drKJWdYMjbh/v0REgI9nFRlQ==",
1818
"path": "dist/raven.min.js"
1919
}
2020
}

docs/sentry-doc-config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@
6666
}
6767
},
6868
"vars": {
69-
"RAVEN_VERSION": "3.12.1"
69+
"RAVEN_VERSION": "3.13.0"
7070
}
7171
}

package.json

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

src/raven.js

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

9292
debug: false,
9393

0 commit comments

Comments
 (0)