Skip to content

3.13.0 #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 3.13.0
* NEW: Added new `sampleRate` config option. See: https://github.com/getsentry/raven-js/pull/885
* CHANGE: TypeScript declaration file (raven.d.ts) has been improved considerably. See: https://github.com/getsentry/raven-js/pull/827

## 3.12.2
* BUGFIX: Fix Raven.js not capturing IE8 errors. See: https://github.com/getsentry/raven-js/pull/883

## 3.12.1
* BUGFIX: Fix Raven.js not properly catching some thrown messages, objects. See: https://github.com/getsentry/raven-js/pull/872

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raven-js",
"version": "3.12.1",
"version": "3.13.0",
"dependencies": {},
"main": "dist/raven.js",
"ignore": [
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/angular.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.12.1 (3600a05) | github.com/getsentry/raven-js */
/*! Raven.js 3.13.0 (14f0148) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/angular.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/console.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.12.1 (3600a05) | github.com/getsentry/raven-js */
/*! Raven.js 3.13.0 (14f0148) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/console.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/ember.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.12.1 (3600a05) | github.com/getsentry/raven-js */
/*! Raven.js 3.13.0 (14f0148) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/ember.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/require.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.12.1 (3600a05) | github.com/getsentry/raven-js */
/*! Raven.js 3.13.0 (14f0148) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/require.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/vue.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.12.1 (3600a05) | github.com/getsentry/raven-js */
/*! Raven.js 3.13.0 (14f0148) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/vue.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

149 changes: 89 additions & 60 deletions dist/raven.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.12.1 (3600a05) | github.com/getsentry/raven-js */
/*! Raven.js 3.13.0 (14f0148) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand All @@ -11,35 +11,6 @@
*/

(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){
exports = module.exports = stringify
exports.getSerialize = serializer

function stringify(obj, replacer, spaces, cycleReplacer) {
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
}

function serializer(replacer, cycleReplacer) {
var stack = [], keys = []

if (cycleReplacer == null) cycleReplacer = function(key, value) {
if (stack[0] === value) return "[Circular ~]"
return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
}

return function(key, value) {
if (stack.length > 0) {
var thisPos = stack.indexOf(this)
~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
}
else stack.push(value)

return replacer == null ? value : replacer.call(this, key, value)
}
}

},{}],2:[function(_dereq_,module,exports){
'use strict';

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

module.exports = RavenConfigError;

},{}],3:[function(_dereq_,module,exports){
},{}],2:[function(_dereq_,module,exports){
'use strict';

var wrapMethod = function(console, level, callback) {
Expand Down Expand Up @@ -90,21 +61,20 @@ module.exports = {
wrapMethod: wrapMethod
};

},{}],4:[function(_dereq_,module,exports){
},{}],3:[function(_dereq_,module,exports){
(function (global){
/*global XDomainRequest:false, __DEV__:false*/
'use strict';

var TraceKit = _dereq_(7);
var RavenConfigError = _dereq_(2);
var utils = _dereq_(6);
var TraceKit = _dereq_(6);
var stringify = _dereq_(7);
var RavenConfigError = _dereq_(1);
var utils = _dereq_(5);

var isError = utils.isError,
isObject = utils.isObject;

var stringify = _dereq_(1);

var wrapConsoleMethod = _dereq_(3).wrapMethod;
var wrapConsoleMethod = _dereq_(2).wrapMethod;

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

debug: false,

Expand Down Expand Up @@ -1583,7 +1554,13 @@ Raven.prototype = {
return;
}

this._sendProcessedPayload(data);
if (typeof globalOptions.sampleRate === 'number') {
if (Math.random() < globalOptions.sampleRate) {
this._sendProcessedPayload(data);
}
} else {
this._sendProcessedPayload(data);
}
},

_getUuid: function () {
Expand Down Expand Up @@ -1679,24 +1656,18 @@ Raven.prototype = {
if (!hasCORS) return;

var url = opts.url;
function handler() {
if (request.status === 200) {
if (opts.onSuccess) {
opts.onSuccess();
}
} else if (opts.onError) {
var err = new Error('Sentry error code: ' + request.status);
err.request = request;
opts.onError(err);
}
}

if ('withCredentials' in request) {
request.onreadystatechange = function () {
if (request.readyState !== 4) {
return;
} else if (request.status === 200) {
opts.onSuccess && opts.onSuccess();
} else if (opts.onError) {
var err = new Error('Sentry error code: ' + request.status);
err.request = request;
opts.onError(err);
}
handler();
};
} else {
request = new XDomainRequest();
Expand All @@ -1705,7 +1676,16 @@ Raven.prototype = {
url = url.replace(/^https?:/, '');

// onreadystatechange not supported by XDomainRequest
request.onload = handler;
if (opts.onSuccess) {
request.onload = opts.onSuccess;
}
if (opts.onError) {
request.onerror = function () {
var err = new Error('Sentry error code: XDomainRequest');
err.request = request;
opts.onError(err);
}
}
}

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

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

'use strict';

var RavenConstructor = _dereq_(4);
var RavenConstructor = _dereq_(3);

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

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

function isObject(what) {
Expand All @@ -2117,11 +2097,11 @@ module.exports = {
isObject: isObject,
isError: isError
};
},{}],7:[function(_dereq_,module,exports){
},{}],6:[function(_dereq_,module,exports){
(function (global){
'use strict';

var utils = _dereq_(6);
var utils = _dereq_(5);

/*
TraceKit - Cross brower stack traces
Expand Down Expand Up @@ -2737,5 +2717,54 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
module.exports = TraceKit;

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"6":6}]},{},[5])(5)
},{"5":5}],7:[function(_dereq_,module,exports){
'use strict';

/*
json-stringify-safe
Like JSON.stringify, but doesn't throw on circular references.

Originally forked from https://github.com/isaacs/json-stringify-safe
version 5.0.1 on 3/8/2017 and modified for IE8 compatibility.
Tests for this are in test/vendor.

ISC license: https://github.com/isaacs/json-stringify-safe/blob/master/LICENSE
*/

exports = module.exports = stringify
exports.getSerialize = serializer

function indexOf(haystack, needle) {
for (var i = 0; i < haystack.length; ++i) {
if (haystack[i] === needle) return i;
}
return -1;
}

function stringify(obj, replacer, spaces, cycleReplacer) {
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
}

function serializer(replacer, cycleReplacer) {
var stack = [], keys = []

if (cycleReplacer == null) cycleReplacer = function(key, value) {
if (stack[0] === value) return '[Circular ~]'
return '[Circular ~.' + keys.slice(0, indexOf(stack, value)).join('.') + ']'
}

return function(key, value) {
if (stack.length > 0) {
var thisPos = indexOf(stack, this);
~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
if (~indexOf(stack, value)) value = cycleReplacer.call(this, key, value)
}
else stack.push(value)

return replacer == null ? value : replacer.call(this, key, value)
}
}

},{}]},{},[4])(4)
});
4 changes: 2 additions & 2 deletions dist/raven.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/raven.min.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/sri.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"@dist/raven.js": {
"hashes": {
"sha256": "lo47JDw5iui9P+8BVkoYgcXash9DqsapFwWuBx47xg4=",
"sha512": "4VSTdDWObyBxQUbuBYSOd2MZlXM9F1CsRsC1LTyArrGbWiqHVIEEv8vuprjLF+5t3rGI9qJf4mMeBFyircjiIw=="
"sha256": "wAN38p0JAtpJlZLfg2JorQnhb+koJMAUnHNwIMyMWaY=",
"sha512": "HMfvmuJnixwjWGG+7GutYvWM3WUGb8UDKXSVbH45dn4R8Sjv/z4EjsVPqZW3Q7Irv6+EGCHIzqO+8JQbO0i5nA=="
},
"type": null,
"integrity": "sha256-lo47JDw5iui9P+8BVkoYgcXash9DqsapFwWuBx47xg4= sha512-4VSTdDWObyBxQUbuBYSOd2MZlXM9F1CsRsC1LTyArrGbWiqHVIEEv8vuprjLF+5t3rGI9qJf4mMeBFyircjiIw==",
"integrity": "sha256-wAN38p0JAtpJlZLfg2JorQnhb+koJMAUnHNwIMyMWaY= sha512-HMfvmuJnixwjWGG+7GutYvWM3WUGb8UDKXSVbH45dn4R8Sjv/z4EjsVPqZW3Q7Irv6+EGCHIzqO+8JQbO0i5nA==",
"path": "dist/raven.js"
},
"@dist/raven.min.js": {
"hashes": {
"sha256": "8uqNKvEWACUnXXdaGWrX2mEz3TEE2h+m5dcC8DJVyCI=",
"sha512": "LobR1Ghrmpm2vODObzjVZuWLajD0wEl58MWvfBzfeSQA4K0VrZSNBpwlEOpKhNPD/qwdSPAoKdXWilbAzryNNA=="
"sha256": "as5k5ICJN6NZprhTvCU092wrki+x7UooYB73ISJS5eE=",
"sha512": "PczlI0rrIWFxUH5tDiANPmnSux37vz+zdrso7bqXgT568jG9iMqkdbXOK11zv2drKJWdYMjbh/v0REgI9nFRlQ=="
},
"type": null,
"integrity": "sha256-8uqNKvEWACUnXXdaGWrX2mEz3TEE2h+m5dcC8DJVyCI= sha512-LobR1Ghrmpm2vODObzjVZuWLajD0wEl58MWvfBzfeSQA4K0VrZSNBpwlEOpKhNPD/qwdSPAoKdXWilbAzryNNA==",
"integrity": "sha256-as5k5ICJN6NZprhTvCU092wrki+x7UooYB73ISJS5eE= sha512-PczlI0rrIWFxUH5tDiANPmnSux37vz+zdrso7bqXgT568jG9iMqkdbXOK11zv2drKJWdYMjbh/v0REgI9nFRlQ==",
"path": "dist/raven.min.js"
}
}
2 changes: 1 addition & 1 deletion docs/sentry-doc-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
}
},
"vars": {
"RAVEN_VERSION": "3.12.1"
"RAVEN_VERSION": "3.13.0"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raven-js",
"version": "3.12.1",
"version": "3.13.0",
"license": "BSD-2-Clause",
"homepage": "https://github.com/getsentry/raven-js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Raven.prototype = {
// webpack (using a build step causes webpack #1617). Grunt verifies that
// this value matches package.json during build.
// See: https://github.com/getsentry/raven-js/issues/465
VERSION: '3.12.1',
VERSION: '3.13.0',

debug: false,

Expand Down
Loading