Skip to content

Commit

Permalink
3.9.0 (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Dec 7, 2016
1 parent 8bbd939 commit 2ed8093
Show file tree
Hide file tree
Showing 27 changed files with 121 additions and 53 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 3.9.0
* NEW: `breadcrumbCallback` and `setBreadcrumbCallback` for filtering/mutating breadcrumbs. See: https://github.com/getsentry/raven-js/pull/788
* NEW: Can enable synthetic traces globally via `stacktrace: true` config option. See: https://github.com/getsentry/raven-js/pull/763
* CHANGE: Can set user context via `config` under `user` key. See: https://github.com/getsentry/raven-js/pull/762
* CHANGE: Unit and integration tests now run on PhantomJS 2. See: https://github.com/getsentry/raven-js/pull/777
* BUGFIX: Fix mouse click breadcrumbs not captured in some scenarios. See: https://github.com/getsentry/raven-js/pull/766
* BUGFIX: React Native plugin normalizes paths in stacktraces generated via `captureMessage`. See: https://github.com/getsentry/raven-js/pull/778
* BUGFIX: Doesn't break when window is absent (e.g. inside web workers). See: https://github.com/getsentry/raven-js/pull/785

## 3.8.1
* BUGFIX: Fix dangling comma affecting IE8. See: https://github.com/getsentry/raven-js/pull/769

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.8.0",
"version": "3.9.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.8.0 (d78f15c) | github.com/getsentry/raven-js */
/*! Raven.js 3.9.0 (8bbd939) | 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.8.0 (d78f15c) | github.com/getsentry/raven-js */
/*! Raven.js 3.9.0 (8bbd939) | 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.8.0 (d78f15c) | github.com/getsentry/raven-js */
/*! Raven.js 3.9.0 (8bbd939) | 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.8.0 (d78f15c) | github.com/getsentry/raven-js */
/*! Raven.js 3.9.0 (8bbd939) | 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.8.0 (d78f15c) | github.com/getsentry/raven-js */
/*! Raven.js 3.9.0 (8bbd939) | 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.

99 changes: 79 additions & 20 deletions dist/raven.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.8.0 (d78f15c) | github.com/getsentry/raven-js */
/*! Raven.js 3.9.0 (8bbd939) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down Expand Up @@ -91,6 +91,7 @@ module.exports = {
};

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

Expand All @@ -107,8 +108,12 @@ function now() {
return +new Date();
}

var _window = typeof window !== 'undefined' ? window : undefined;
var _document = _window && _window.document;
// 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
: typeof global !== 'undefined' ? global
: typeof self !== 'undefined' ? self
: {};
var _document = _window.document;

// First, check for JSON support
// If there is no JSON, we no-op the core features of Raven
Expand Down Expand Up @@ -167,7 +172,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.8.0',
VERSION: '3.9.0',

debug: false,

Expand Down Expand Up @@ -195,7 +200,7 @@ Raven.prototype = {
if (options) {
each(options, function(key, value){
// tags and extra are special and need to be put into context
if (key === 'tags' || key === 'extra') {
if (key === 'tags' || key === 'extra' || key === 'user') {
self._globalContext[key] = value;
} else {
globalOptions[key] = value;
Expand All @@ -221,7 +226,7 @@ Raven.prototype = {
xhr: true,
console: true,
dom: true,
location: true,
location: true
};

var autoBreadcrumbs = globalOptions.autoBreadcrumbs;
Expand Down Expand Up @@ -456,11 +461,13 @@ Raven.prototype = {
return;
}

options = options || {};

var data = objectMerge({
message: msg + '' // Make sure it's actually a string
}, options);

if (options && options.stacktrace) {
if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
var ex;
// create a stack trace from this point; just trim
// off extra frames so they don't include this function call (or
Expand Down Expand Up @@ -500,6 +507,16 @@ Raven.prototype = {
timestamp: now() / 1000
}, obj);

if (isFunction(this._globalOptions.breadcrumbCallback)) {
var result = this._globalOptions.breadcrumbCallback(crumb);

if (isObject(result) && !isEmptyObject(result)) {
crumb = result;
} else if (result === false) {
return this;
}
}

this._breadcrumbs.push(crumb);
if (this._breadcrumbs.length > this._globalOptions.maxBreadcrumbs) {
this._breadcrumbs.shift();
Expand Down Expand Up @@ -617,6 +634,22 @@ Raven.prototype = {
return this;
},

/*
* Set the breadcrumbCallback option
*
* @param {function} callback The callback to run which allows filtering
* or mutating breadcrumbs
* @return {Raven}
*/
setBreadcrumbCallback: function(callback) {
var original = this._globalOptions.breadcrumbCallback;
this._globalOptions.breadcrumbCallback = isFunction(callback)
? function (data) { return callback(data, original); }
: callback;

return this;
},

/*
* Set the shouldSendCallback option
*
Expand Down Expand Up @@ -827,7 +860,6 @@ Raven.prototype = {
// TODO: if somehow user switches keypress target before
// debounce timeout is triggered, we will only capture
// a single breadcrumb from the FIRST target (acceptable?)

return function (evt) {
var target = evt.target,
tagName = target && target.tagName;
Expand All @@ -846,7 +878,7 @@ Raven.prototype = {
}
clearTimeout(timeout);
self._keypressTimeout = setTimeout(function () {
self._keypressTimeout = null;
self._keypressTimeout = null;
}, debounceDuration);
};
},
Expand Down Expand Up @@ -932,13 +964,24 @@ Raven.prototype = {

// More breadcrumb DOM capture ... done here and not in `_instrumentBreadcrumbs`
// so that we don't have more than one wrapper function
var before;
var before,
clickHandler,
keypressHandler;

if (autoBreadcrumbs && autoBreadcrumbs.dom && (global === 'EventTarget' || global === 'Node')) {
if (evtName === 'click'){
before = self._breadcrumbEventHandler(evtName);
} else if (evtName === 'keypress') {
before = self._keypressEventHandler();
}
// NOTE: generating multiple handlers per addEventListener invocation, should
// revisit and verify we can just use one (almost certainly)
clickHandler = self._breadcrumbEventHandler('click');
keypressHandler = self._keypressEventHandler();
before = function (evt) {
// need to intercept every DOM event in `before` argument, in case that
// same wrapped method is re-used for different events (e.g. mousemove THEN click)
// see #724
if (evt.type === 'click')
return clickHandler(evt);
else if (evt.type === 'keypress')
return keypressHandler(evt);
};
}
return orig.call(this, evtName, self.wrap(fn, undefined, before), capture, secure);
};
Expand Down Expand Up @@ -1849,7 +1892,9 @@ 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}],5:[function(_dereq_,module,exports){
(function (global){
/**
* Enforces a single instance of the Raven client, and the
* main entry point for Raven. If you are a consumer of the
Expand All @@ -1860,7 +1905,12 @@ module.exports = Raven;

var RavenConstructor = _dereq_(4);

var _Raven = window.Raven;
// 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
: typeof global !== 'undefined' ? global
: typeof self !== 'undefined' ? self
: {};
var _Raven = _window.Raven;

var Raven = new RavenConstructor();

Expand All @@ -1871,15 +1921,17 @@ var Raven = new RavenConstructor();
* @return {Raven}
*/
Raven.noConflict = function () {
window.Raven = _Raven;
_window.Raven = _Raven;
return Raven;
};

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){
(function (global){
'use strict';

/*
Expand All @@ -1892,6 +1944,12 @@ var TraceKit = {
debug: false
};

// 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
: typeof global !== 'undefined' ? global
: typeof self !== 'undefined' ? self
: {};

// global reference to slice
var _slice = [].slice;
var UNKNOWN_FUNCTION = '?';
Expand Down Expand Up @@ -2070,8 +2128,8 @@ TraceKit.report = (function reportModuleWrapper() {
if (_onErrorHandlerInstalled) {
return;
}
_oldOnerrorHandler = window.onerror;
window.onerror = traceKitWindowOnError;
_oldOnerrorHandler = _window.onerror;
_window.onerror = traceKitWindowOnError;
_onErrorHandlerInstalled = true;
}

Expand All @@ -2080,7 +2138,7 @@ TraceKit.report = (function reportModuleWrapper() {
if (!_onErrorHandlerInstalled) {
return;
}
window.onerror = _oldOnerrorHandler;
_window.onerror = _oldOnerrorHandler;
_onErrorHandlerInstalled = false;
_oldOnerrorHandler = undefined;
}
Expand Down Expand Up @@ -2482,5 +2540,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {

module.exports = TraceKit;

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[5])(5)
});
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": "4miBSrBY0YRTMgqQ7tIKJ5bC1iJWSDJcg+lYca93DVI=",
"sha512": "ziKXaLU8oaGyZRk4MrdPLqejNAcAr+vvUg+OpMGrQ1tr6j2TK11OLn3RkawUOomzxCz6VgIBA7b3wLco9jmEeA=="
"sha256": "ihdEI9/hV9q/+yUm+WxgLgncmbFnuK9tr/lRnRgr60k=",
"sha512": "4WMClk7qzYHXT5/xR3X9RkpNs8dg/FIfbJ7RTythr9rXMRAVIDimD2X6NLEUdID+c7sJ3b6oOvsmf6oB0ORhwg=="
},
"type": null,
"integrity": "sha256-4miBSrBY0YRTMgqQ7tIKJ5bC1iJWSDJcg+lYca93DVI= sha512-ziKXaLU8oaGyZRk4MrdPLqejNAcAr+vvUg+OpMGrQ1tr6j2TK11OLn3RkawUOomzxCz6VgIBA7b3wLco9jmEeA==",
"integrity": "sha256-ihdEI9/hV9q/+yUm+WxgLgncmbFnuK9tr/lRnRgr60k= sha512-4WMClk7qzYHXT5/xR3X9RkpNs8dg/FIfbJ7RTythr9rXMRAVIDimD2X6NLEUdID+c7sJ3b6oOvsmf6oB0ORhwg==",
"path": "dist/raven.js"
},
"@dist/raven.min.js": {
"hashes": {
"sha256": "qP1Ly+j8g4xsul2MZaCZv6byFgLvRHuiI/bct6JluOw=",
"sha512": "EQGo6LBb2E0sCr7jfkQN7d3wzdFcWWD8b0FxP/Dahoa827Wk9KpsxSsA6IS8B+RNGkUHLaOP5G21p+EA3odqBA=="
"sha256": "Iwsp4zEtQhPhOFbMNyTevyNpy7XTm8qUPteSJyopHDM=",
"sha512": "lL3X3M9f+DKT/mcKDJWixbXdXhVlYGWxy5DuPYyV6LrD8KNWQJ6ahpvTK3IyosXEAj3x+PWQ1DnFbKyGbIGdBw=="
},
"type": null,
"integrity": "sha256-qP1Ly+j8g4xsul2MZaCZv6byFgLvRHuiI/bct6JluOw= sha512-EQGo6LBb2E0sCr7jfkQN7d3wzdFcWWD8b0FxP/Dahoa827Wk9KpsxSsA6IS8B+RNGkUHLaOP5G21p+EA3odqBA==",
"integrity": "sha256-Iwsp4zEtQhPhOFbMNyTevyNpy7XTm8qUPteSJyopHDM= sha512-lL3X3M9f+DKT/mcKDJWixbXdXhVlYGWxy5DuPYyV6LrD8KNWQJ6ahpvTK3IyosXEAj3x+PWQ1DnFbKyGbIGdBw==",
"path": "dist/raven.min.js"
}
}
Loading

0 comments on commit 2ed8093

Please sign in to comment.