diff --git a/CHANGELOG.md b/CHANGELOG.md index ae84fb6a4d75..4029c802d851 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,19 @@ # Changelog +## 2.1.0 +* BUGFIX: Fixed Raven.js rejecting frames w/ blob URLs. See: https://github.com/getsentry/raven-js/issues/463 +* BUGFIX: Fixed plugin files not consumable without module loader. See: https://github.com/getsentry/raven-js/issues/446 +* BUGFIX: Fixed bug in console.js plugin where `level` wasn't passed. See: https://github.com/getsentry/raven-js/pull/474 +* BUGFIX: Fixed broken debug logging in IE9 and below. See: https://github.com/getsentry/raven-js/pull/473 +* BUGFIX: Fixed `XMLHttpRequest` wrapper not capturing all event handlers. See: https://github.com/getsentry/raven-js/issues/453 +* CHANGE: `Raven.uninstall` now restores original builtin functions (e.g. setTimeout). See: https://github.com/getsentry/raven-js/issues/228 +* CHANGE: `maxMessageLength` now defaults to 0 (no limit). See: https://github.com/getsentry/raven-js/pull/441 +* NEW: New `stackTraceLimit` config option (default 50 in supported browsers). See: https://github.com/getsentry/raven-js/pull/419/files +* NEW: `Raven.showReportDialog` (experimental). See: https://github.com/getsentry/raven-js/pull/456 + ## 2.0.5 * BUGFIX: Fixed exception thrown by React Native plugin. See: https://github.com/getsentry/raven-js/issues/468 -* BUGFIX: Fixed "pre-built JavaScript" warning when loading Raven.js via Webpack: https://github.com/getsentry/raven-js/issues/465 +* BUGFIX: Fixed "pre-built JavaScript" warning when loading Raven.js via Webpack. See: https://github.com/getsentry/raven-js/issues/465 ## 2.0.4 * BUGFIX: Fixed bug where Raven.VERSION was not set when required as a CommonJS module. diff --git a/bower.json b/bower.json index 1b3c78b24d44..d4a297e49d4c 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "raven-js", - "version": "2.0.0-rc1", + "version": "2.1.0", "dependencies": {}, "main": "dist/raven.js", "ignore": [ diff --git a/dist/plugins/angular.js b/dist/plugins/angular.js new file mode 100644 index 000000000000..f9c7e8932f36 --- /dev/null +++ b/dist/plugins/angular.js @@ -0,0 +1,75 @@ +/*! Raven.js 2.1.0 (9ca11cd) | github.com/getsentry/raven-js */ + +/* + * Includes TraceKit + * https://github.com/getsentry/TraceKit + * + * Copyright 2016 Matt Robenolt and other contributors + * Released under the BSD license + * https://github.com/getsentry/raven-js/blob/master/LICENSE + * + */ + +(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=(g.Raven||(g.Raven = {}));g=(g.Plugins||(g.Plugins = {}));g.Angular = 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):(\d+)(?::(\d+))?\)?\s*$/i, - gecko = /^\s*(.*?)(?:\((.*?)\))?@((?:file|https?|chrome).*?):(\d+)(?::(\d+))?\s*$/i, - winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i, + var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, + gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|\[).*?)(?::(\d+))?(?::(\d+))?\s*$/i, + winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:ms-appx|https?|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i, lines = ex.stack.split('\n'), stack = [], parts, @@ -1845,27 +1945,30 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() { reference = /^(.*) is undefined$/.exec(ex.message); for (var i = 0, j = lines.length; i < j; ++i) { - if ((parts = gecko.exec(lines[i]))) { + if ((parts = chrome.exec(lines[i]))) { + var isNative = parts[2] && parts[2].indexOf('native') !== -1; element = { - 'url': parts[3], + 'url': !isNative ? parts[2] : null, 'func': parts[1] || UNKNOWN_FUNCTION, - 'args': parts[2] ? parts[2].split(',') : '', - 'line': +parts[4], - 'column': parts[5] ? +parts[5] : null + 'args': isNative ? [parts[2]] : [], + 'line': parts[3] ? +parts[3] : null, + 'column': parts[4] ? +parts[4] : null }; - } else if ((parts = chrome.exec(lines[i]))) { + } else if ( parts = winjs.exec(lines[i]) ) { element = { 'url': parts[2], 'func': parts[1] || UNKNOWN_FUNCTION, + 'args': [], 'line': +parts[3], 'column': parts[4] ? +parts[4] : null }; - } else if ((parts = winjs.exec(lines[i]))) { + } else if ((parts = gecko.exec(lines[i]))) { element = { - 'url': parts[2], + 'url': parts[3], 'func': parts[1] || UNKNOWN_FUNCTION, - 'line': +parts[3], - 'column': parts[4] ? +parts[4] : null + 'args': parts[2] ? parts[2].split(',') : [], + 'line': parts[4] ? +parts[4] : null, + 'column': parts[5] ? +parts[5] : null }; } else { continue; @@ -1916,21 +2019,33 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() { var stacktrace = ex.stacktrace; if (isUndefined(ex.stacktrace) || !ex.stacktrace) return; - var testRE = / line (\d+), column (\d+) in (?:]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i, - lines = stacktrace.split('\n'), - stack = [], - parts; + var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i, + opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i, + lines = stacktrace.split('\n'), + stack = [], + parts; - for (var i = 0, j = lines.length; i < j; i += 2) { - if ((parts = testRE.exec(lines[i]))) { - var element = { + for (var line = 0; line < lines.length; line += 2) { + var element = null; + if ((parts = opera10Regex.exec(lines[line]))) { + element = { + 'url': parts[2], + 'line': +parts[1], + 'column': null, + 'func': parts[3], + 'args':[] + }; + } else if ((parts = opera11Regex.exec(lines[line]))) { + element = { + 'url': parts[6], 'line': +parts[1], 'column': +parts[2], 'func': parts[3] || parts[4], - 'args': parts[5] ? parts[5].split(',') : [], - 'url': parts[6] + 'args': parts[5] ? parts[5].split(',') : [] }; + } + if (element) { if (!element.func && element.line) { element.func = guessFunctionName(element.url, element.line); } @@ -1941,7 +2056,7 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() { } if (!element.context) { - element.context = [lines[i + 1]]; + element.context = [lines[line + 1]]; } stack.push(element); @@ -1989,40 +2104,42 @@ TraceKit.computeStackTrace = (function computeStackTraceWrapper() { return null; } - var lineRE1 = /^\s*Line (\d+) of linked script ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i, - lineRE2 = /^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i, + var lineRE1 = /^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i, + lineRE2 = /^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i, lineRE3 = /^\s*Line (\d+) of function script\s*$/i, stack = [], scripts = document.getElementsByTagName('script'), inlineScriptBlocks = [], - parts, - i, - len, - source; + parts; - for (i in scripts) { - if (hasKey(scripts, i) && !scripts[i].src) { - inlineScriptBlocks.push(scripts[i]); + for (var s in scripts) { + if (hasKey(scripts, s) && !scripts[s].src) { + inlineScriptBlocks.push(scripts[s]); } } - for (i = 2, len = lines.length; i < len; i += 2) { + for (var line = 2; line < lines.length; line += 2) { var item = null; - if ((parts = lineRE1.exec(lines[i]))) { + if ((parts = lineRE1.exec(lines[line]))) { item = { 'url': parts[2], 'func': parts[3], - 'line': +parts[1] + 'args': [], + 'line': +parts[1], + 'column': null }; - } else if ((parts = lineRE2.exec(lines[i]))) { + } else if ((parts = lineRE2.exec(lines[line]))) { item = { 'url': parts[3], - 'func': parts[4] + 'func': parts[4], + 'args': [], + 'line': +parts[1], + 'column': null // TODO: Check to see if inline#1 (+parts[2]) points to the script number or column number. }; var relativeLine = (+parts[1]); // relative to the start of the - + + Configuring the Client diff --git a/docs/install.rst b/docs/install.rst index b764632ef69b..30b9f5994ac9 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -9,7 +9,7 @@ So for example: .. sourcecode:: html - + @@ -28,7 +28,7 @@ Our CDN distributes builds with and without :doc:`integrations + This version does not include any plugins. See `ravenjs.com `_ for more information about plugins and getting diff --git a/docs/integrations/angular.rst b/docs/integrations/angular.rst index 1a88c4e9d19f..966d151ca316 100644 --- a/docs/integrations/angular.rst +++ b/docs/integrations/angular.rst @@ -13,7 +13,7 @@ Example: .. sourcecode:: html - + @@ -38,7 +38,7 @@ to wire up the SDK just as if you weren't using Angular. This should happen imme .. code-block:: html - + diff --git a/docs/integrations/backbone.rst b/docs/integrations/backbone.rst index a8d9ff076dbd..79bb67ea57ca 100644 --- a/docs/integrations/backbone.rst +++ b/docs/integrations/backbone.rst @@ -9,7 +9,7 @@ after you load all other external libraries (like jQuery), but before your code. .. sourcecode:: html - + Configuring the Client ---------------------- diff --git a/docs/integrations/ember.rst b/docs/integrations/ember.rst index 4869d7f70fe2..0091019b4cc8 100644 --- a/docs/integrations/ember.rst +++ b/docs/integrations/ember.rst @@ -9,7 +9,7 @@ after you load all other external libraries (like jQuery), but before your code. .. sourcecode:: html - + Configuring the Client ---------------------- diff --git a/docs/integrations/react.rst b/docs/integrations/react.rst index b7beb99d9c4f..7f9fa4696271 100644 --- a/docs/integrations/react.rst +++ b/docs/integrations/react.rst @@ -9,7 +9,7 @@ after you load all other external libraries (like jQuery), but before your code. .. sourcecode:: html - + Configuring the Client ---------------------- diff --git a/package.json b/package.json index db0ff1ff68bd..52b90fed3d3d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "raven-js", - "version": "2.0.0", + "version": "2.1.0", "license": "BSD-2-Clause", "homepage": "https://getsentry.com", "scripts": { diff --git a/src/raven.js b/src/raven.js index 875d03538d73..618948c17d26 100644 --- a/src/raven.js +++ b/src/raven.js @@ -75,7 +75,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: '2.0.0', + VERSION: '2.1.0', debug: false, diff --git a/test/raven.test.js b/test/raven.test.js index 588f8bf7322a..c232937de926 100644 --- a/test/raven.test.js +++ b/test/raven.test.js @@ -1038,7 +1038,7 @@ describe('globals', function() { extra: {'session:duration': 100}, }); assert.deepEqual(opts.auth, { - sentry_client: 'raven-js/2.0.0', + sentry_client: 'raven-js/2.1.0', sentry_key: 'abc', sentry_version: '7' });