Skip to content

Commit

Permalink
3.1.0 (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar authored Jun 20, 2016
1 parent d781478 commit 41b84c9
Show file tree
Hide file tree
Showing 24 changed files with 45 additions and 100 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 3.1.0
* NEW: Added TypeScript declaration file for compatibility with TypeScript projects. See: https://github.com/getsentry/raven-js/pull/610

## 3.0.5
* BUGFIX: Fix breadcrumb instrumentation failing in IE8. See: https://github.com/getsentry/raven-js/issues/594

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.0.4",
"version": "3.1.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.0.4 (0784c3c) | github.com/getsentry/raven-js */
/*! Raven.js 3.1.0 (d781478) | 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.0.4 (0784c3c) | github.com/getsentry/raven-js */
/*! Raven.js 3.1.0 (d781478) | 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.0.4 (0784c3c) | github.com/getsentry/raven-js */
/*! Raven.js 3.1.0 (d781478) | 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.0.4 (0784c3c) | github.com/getsentry/raven-js */
/*! Raven.js 3.1.0 (d781478) | 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.

82 changes: 12 additions & 70 deletions dist/raven.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raven.js 3.0.4 (0784c3c) | github.com/getsentry/raven-js */
/*! Raven.js 3.1.0 (d781478) | github.com/getsentry/raven-js */

/*
* Includes TraceKit
Expand Down Expand Up @@ -150,7 +150,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.0.4',
VERSION: '3.1.0',

debug: false,

Expand Down Expand Up @@ -210,14 +210,6 @@ Raven.prototype = {
this._globalEndpoint = this._globalServer +
'/' + path + 'api/' + this._globalProject + '/store/';

if (this._globalOptions.fetchContext) {
TraceKit.remoteFetching = true;
}

if (this._globalOptions.linesOfContext) {
TraceKit.linesOfContext = this._globalOptions.linesOfContext;
}

TraceKit.collectWindowErrors = !!this._globalOptions.collectWindowErrors;

// return for chaining
Expand Down Expand Up @@ -885,8 +877,15 @@ Raven.prototype = {
// Capture breadcrubms from any click that is unhandled / bubbled up all the way
// to the document. Do this before we instrument addEventListener.
if (this._hasDocument) {
document.addEventListener('click', self._breadcrumbEventHandler('click'));
document.addEventListener('keypress', self._keypressEventHandler());
if (document.addEventListener) {
document.addEventListener('click', self._breadcrumbEventHandler('click'));
document.addEventListener('keypress', self._keypressEventHandler());
}
else {
// IE8 Compatibility
document.attachEvent('onclick', self._breadcrumbEventHandler('click'));
document.attachEvent('onkeypress', self._keypressEventHandler());
}
}

// event targets borrowed from bugsnag-js:
Expand Down Expand Up @@ -1106,13 +1105,7 @@ Raven.prototype = {
lineno: frame.line,
colno: frame.column,
'function': frame.func || '?'
}, context = this._extractContextFromFrame(frame), i;

if (context) {
var keys = ['pre_context', 'context_line', 'post_context'];
i = 3;
while (i--) normalized[keys[i]] = context[i];
}
};

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

_extractContextFromFrame: function(frame) {
// immediately check if we should even attempt to parse a context
if (!frame.context || !this._globalOptions.fetchContext) return;

var context = frame.context,
pivot = ~~(context.length / 2),
i = context.length, isMinified = false;

while (i--) {
// We're making a guess to see if the source is minified or not.
// To do that, we make the assumption if *any* of the lines passed
// in are greater than 300 characters long, we bail.
// Sentry will see that there isn't a context
if (context[i].length > 300) {
isMinified = true;
break;
}
}

if (isMinified) {
// The source is minified and we don't know which column. Fuck it.
if (isUndefined(frame.column)) return;

// If the source is minified and has a frame column
// we take a chunk of the offending line to hopefully shed some light
return [
[], // no pre_context
context[pivot].substr(frame.column, 50), // grab 50 characters, starting at the offending column
[] // no post_context
];
}

return [
context.slice(0, pivot), // pre_context
context[pivot], // context_line
context.slice(pivot + 1) // post_context
];
},

_processException: function(type, message, fileurl, lineno, frames, options) {
var stacktrace, fullMessage;

Expand Down Expand Up @@ -1734,10 +1688,7 @@ var isUndefined = utils.isUndefined;
*/

var TraceKit = {
remoteFetching: false,
collectWindowErrors: true,
// 3 lines before, the offending line, 3 lines after
linesOfContext: 7,
debug: false
};

Expand Down Expand Up @@ -1897,7 +1848,6 @@ TraceKit.report = (function reportModuleWrapper() {
}

location.func = UNKNOWN_FUNCTION;
location.context = null;

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

if (element.line) {
element.context = null;
}

stack.push(element);
}

Expand Down Expand Up @@ -2219,7 +2164,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
if (!element.func && element.line) {
element.func = UNKNOWN_FUNCTION;
}
element.context = [lines[line + 1]];

stack.push(element);
}
Expand Down Expand Up @@ -2307,7 +2251,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
if (!item.func) {
item.func = UNKNOWN_FUNCTION;
}
item.context = [lines[line + 1]];

stack.push(item);
}
Expand Down Expand Up @@ -2357,7 +2300,6 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() {
return false; // already in stack trace
} else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) {
stackInfo.stack[0].line = initial.line;
stackInfo.stack[0].context = initial.context;
return false;
}
}
Expand Down
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": "BhyUFN42x1X3lpmcdqb9FeEEDX120bZD5Tviil7eN+U=",
"sha512": "Dcum5QDTkYiE2J8Ds/8UcgOv18moIIbEg8f/2aYWcnl7MKx/015DAaqM0KmRI/bAL1r1l3r5E89H9eKfDPyBtg=="
"sha256": "9exQEvaM4NkjZiQscZ7vaZZNu0np8tnC9fGGReyxFXg=",
"sha512": "t7keBoCkzXX0uqzWc/tkHTMrDZBoOAs1K1decopIZpUsqXDHDdM/Xsho6rFmryJofQ4cVNAV4+nVmuaEJh4juA=="
},
"type": null,
"integrity": "sha256-BhyUFN42x1X3lpmcdqb9FeEEDX120bZD5Tviil7eN+U= sha512-Dcum5QDTkYiE2J8Ds/8UcgOv18moIIbEg8f/2aYWcnl7MKx/015DAaqM0KmRI/bAL1r1l3r5E89H9eKfDPyBtg==",
"integrity": "sha256-9exQEvaM4NkjZiQscZ7vaZZNu0np8tnC9fGGReyxFXg= sha512-t7keBoCkzXX0uqzWc/tkHTMrDZBoOAs1K1decopIZpUsqXDHDdM/Xsho6rFmryJofQ4cVNAV4+nVmuaEJh4juA==",
"path": "dist/raven.js"
},
"@dist/raven.min.js": {
"hashes": {
"sha256": "g9X2G0d7lq0Uv4i8OTMimZZ4V1WbnbDo6krrRaixbGI=",
"sha512": "sTnnzoocXXoQsv0lJQHeLHyDmU9RL9jvzOzyCRuWByF+XlELresM7b5exk1vBu9E8B1o/kxA99ZcgkOeYBw8SQ=="
"sha256": "eOzZlXH2N6ZXIB2rRnQSFPsUINO1W0UobAllDeMyTGI=",
"sha512": "5Vq83HbmtmmeJjzwV9m50F1C3Q6VHouqvFJsYxkFytEspXYqoWNIysZ+l9+Xm0lNUBgXvWzzUz9Jj2DTMBO0hw=="
},
"type": null,
"integrity": "sha256-g9X2G0d7lq0Uv4i8OTMimZZ4V1WbnbDo6krrRaixbGI= sha512-sTnnzoocXXoQsv0lJQHeLHyDmU9RL9jvzOzyCRuWByF+XlELresM7b5exk1vBu9E8B1o/kxA99ZcgkOeYBw8SQ==",
"integrity": "sha256-eOzZlXH2N6ZXIB2rRnQSFPsUINO1W0UobAllDeMyTGI= sha512-5Vq83HbmtmmeJjzwV9m50F1C3Q6VHouqvFJsYxkFytEspXYqoWNIysZ+l9+Xm0lNUBgXvWzzUz9Jj2DTMBO0hw==",
"path": "dist/raven.min.js"
}
}
2 changes: 1 addition & 1 deletion docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Putting it all together
<body>
...
<script src="jquery.min.js"></script>
<script src="https://cdn.ravenjs.com/3.0.5/raven.min.js"></script>
<script src="https://cdn.ravenjs.com/3.1.0/raven.min.js"></script>
<script>
Raven.config('___PUBLIC_DSN___', {
logger: 'my-logger',
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ scripts. For all details see :doc:`install`.

.. sourcecode:: html

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


Configuring the Client
Expand Down
4 changes: 2 additions & 2 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ So for example:
.. sourcecode:: html

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

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

.. sourcecode:: html

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

This version does not include any plugins. See `ravenjs.com
<http://ravenjs.com/>`_ for more information about plugins and getting
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/angular.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Example:
.. sourcecode:: html

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

Note that this CDN build auto-initializes the Angular plugin.
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/backbone.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ after you load all other external libraries (like jQuery), but before your code.

.. sourcecode:: html

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

Configuring the Client
----------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/ember.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Example:
.. sourcecode:: html

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

Note that this CDN build auto-initializes the Ember plugin.
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/react.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ after you load all other external libraries (like jQuery), but before your code.

.. sourcecode:: html

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

Configuring the Client
----------------------
Expand Down
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.0.4",
"version": "3.1.0",
"license": "BSD-2-Clause",
"homepage": "https://getsentry.com",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,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.0.4',
VERSION: '3.1.0',

debug: false,

Expand Down
4 changes: 2 additions & 2 deletions test/raven.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ describe('globals', function() {
extra: {'session:duration': 100},
});
assert.deepEqual(opts.auth, {
sentry_client: 'raven-js/3.0.4',
sentry_client: 'raven-js/3.1.0',
sentry_key: 'abc',
sentry_version: '7'
});
Expand Down Expand Up @@ -1012,7 +1012,7 @@ describe('globals', function() {
extra: {'session:duration': 100},
});
assert.deepEqual(opts.auth, {
sentry_client: 'raven-js/3.0.4',
sentry_client: 'raven-js/3.1.0',
sentry_key: 'abc',
sentry_secret: 'def',
sentry_version: '7'
Expand Down

0 comments on commit 41b84c9

Please sign in to comment.