rollbar 2.26.1 → 2.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,10 +9,10 @@ on:
9
9
 
10
10
  jobs:
11
11
  build:
12
- runs-on: ubuntu-18.04
12
+ runs-on: ubuntu-20.04
13
13
  strategy:
14
14
  matrix:
15
- node-version: [8, 10, 12, 14, 16]
15
+ node-version: [10, 12, 14, 16]
16
16
 
17
17
  steps:
18
18
  - uses: actions/checkout@v2
package/Gruntfile.js CHANGED
@@ -1,9 +1,5 @@
1
1
  /**
2
2
  * Build and test rollbar.js
3
- *
4
- * Test with browserstack:
5
- * $> BROWSER_STACK_USERNAME=username BROWSER_STACK_ACCESS_KEY=12345asdf grunt test --browsers=bs_ie_latest
6
- *
7
3
  */
8
4
 
9
5
 
@@ -15,7 +11,6 @@ var pkg = require('./package.json');
15
11
  var fs = require('fs');
16
12
 
17
13
  var webpackConfig = require('./webpack.config.js');
18
- var browserStackBrowsers = require('./browserstack.browsers');
19
14
 
20
15
 
21
16
  function findTests(context) {
@@ -33,7 +28,7 @@ function findTests(context) {
33
28
  return mapping;
34
29
  }
35
30
 
36
- function buildGruntKarmaConfig(singleRun, browsers, tests, reporters) {
31
+ function buildGruntKarmaConfig(singleRun, tests, reporters) {
37
32
  var config = {
38
33
  options: {
39
34
  configFile: './karma.conf.js',
@@ -71,10 +66,6 @@ function buildGruntKarmaConfig(singleRun, browsers, tests, reporters) {
71
66
  },
72
67
  };
73
68
 
74
- if (browsers && browsers.length) {
75
- config.options.browsers = browsers;
76
- }
77
-
78
69
  if (reporters && reporters.length) {
79
70
  config.options.reporters = reporters;
80
71
  }
@@ -112,27 +103,6 @@ module.exports = function(grunt) {
112
103
  require('time-grunt')(grunt);
113
104
 
114
105
  var browserTests = findTests('browser');
115
- var browsers = grunt.option('browsers');
116
- if (browsers) {
117
- browsers = browsers.split(',');
118
-
119
- var browserStackAliases = [];
120
- var nonBrowserStackAliases = [];
121
- browsers.forEach(function(browserName) {
122
- if (browserName.slice(0, 3) === 'bs_') {
123
- browserStackAliases.push(browserName);
124
- } else {
125
- nonBrowserStackAliases.push(browserName);
126
- }
127
- });
128
-
129
- var expandedBrowsers = browserStackBrowsers.filter.apply(null, browserStackAliases);
130
- var expandedBrowserNames = [];
131
- expandedBrowsers.forEach(function(browser) {
132
- expandedBrowserNames.push(browser._alias);
133
- });
134
- browsers = nonBrowserStackAliases.concat(expandedBrowserNames);
135
- }
136
106
 
137
107
  var singleRun = grunt.option('singleRun');
138
108
  if (singleRun === undefined) {
@@ -165,7 +135,7 @@ module.exports = function(grunt) {
165
135
  }
166
136
  },
167
137
 
168
- karma: buildGruntKarmaConfig(singleRun, browsers, browserTests, reporters),
138
+ karma: buildGruntKarmaConfig(singleRun, browserTests, reporters),
169
139
 
170
140
  replace: {
171
141
  snippets: {
@@ -188,7 +158,7 @@ module.exports = function(grunt) {
188
158
  return captures.join('\n');
189
159
  }
190
160
  },
191
- // README travis link
161
+ // README CI link
192
162
  {
193
163
  from: new RegExp('(https://github\\.com/rollbar/rollbar\\.js/workflows/Rollbar\\.js%20CI/badge\\.svg\\?branch=v)([0-9a-zA-Z.-]+)'),
194
164
  to: function(match, index, fullText, captures) {
package/dist/rollbar.js CHANGED
@@ -1416,6 +1416,9 @@ function Rollbar(options, client) {
1416
1416
  this.instrumenter.instrument();
1417
1417
  }
1418
1418
  _.setupJSON(polyfillJSON);
1419
+
1420
+ // Used with rollbar-react for rollbar-react-native compatibility.
1421
+ this.rollbar = this;
1419
1422
  }
1420
1423
 
1421
1424
  var _instance = null;
@@ -4685,7 +4688,7 @@ module.exports = {
4685
4688
 
4686
4689
 
4687
4690
  module.exports = {
4688
- version: '2.26.1',
4691
+ version: '2.26.3',
4689
4692
  endpoint: 'api.rollbar.com/api/1/item/',
4690
4693
  logLevel: 'debug',
4691
4694
  reportLevel: 'debug',
@@ -4787,8 +4790,8 @@ Telemeter.prototype.configure = function(options) {
4787
4790
  var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;
4788
4791
  var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));
4789
4792
  var deleteCount = 0;
4790
- if (this.maxQueueSize > newMaxEvents) {
4791
- deleteCount = this.maxQueueSize - newMaxEvents;
4793
+ if (this.queue.length > newMaxEvents) {
4794
+ deleteCount = this.queue.length - newMaxEvents;
4792
4795
  }
4793
4796
  this.maxQueueSize = newMaxEvents;
4794
4797
  this.queue.splice(0, deleteCount);
@@ -5137,7 +5140,9 @@ Instrumenter.prototype.instrumentNetwork = function() {
5137
5140
  var xhrp = this._window.XMLHttpRequest.prototype;
5138
5141
  replace(xhrp, 'open', function(orig) {
5139
5142
  return function(method, url) {
5140
- if (_.isType(url, 'string')) {
5143
+ var isUrlObject = _isUrlObject(url)
5144
+ if (_.isType(url, 'string') || isUrlObject) {
5145
+ url = isUrlObject ? url.toString() : url;
5141
5146
  if (this.__rollbar_xhr) {
5142
5147
  this.__rollbar_xhr.method = method;
5143
5148
  this.__rollbar_xhr.url = url;
@@ -5300,8 +5305,9 @@ Instrumenter.prototype.instrumentNetwork = function() {
5300
5305
  var input = args[0];
5301
5306
  var method = 'GET';
5302
5307
  var url;
5303
- if (_.isType(input, 'string')) {
5304
- url = input;
5308
+ var isUrlObject = _isUrlObject(input)
5309
+ if (_.isType(input, 'string') || isUrlObject) {
5310
+ url = isUrlObject ? input.toString() : input;
5305
5311
  } else if (input) {
5306
5312
  url = input.url;
5307
5313
  if (input.method) {
@@ -5728,6 +5734,10 @@ Instrumenter.prototype.removeListeners = function(section) {
5728
5734
  }
5729
5735
  };
5730
5736
 
5737
+ function _isUrlObject(input) {
5738
+ return typeof URL !== 'undefined' && input instanceof URL
5739
+ }
5740
+
5731
5741
  module.exports = Instrumenter;
5732
5742
 
5733
5743