Skip to content

Commit 6008562

Browse files
authored
Separate defaults for snippet and hardcore jquery version (#1259)
1 parent d22d562 commit 6008562

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

src/browser/bundles/defaults.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { version } from '../../defaults.js'
2+
3+
export const cdnHost = 'cdn.rollbar.com';
4+
export const defaultRollbarJsUrl = `https://${cdnHost}/rollbarjs/refs/tags/v${version}/rollbar.min.js`;

src/browser/bundles/rollbar.snippet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import * as Shim from '../shim.js';
44
import snippetCallback from '../snippet_callback.js';
5-
import { defaultRollbarJsUrl } from '../defaults.js';
5+
import { defaultRollbarJsUrl } from './defaults.js';
66

77
_rollbarConfig = _rollbarConfig || {};
88
_rollbarConfig.rollbarJsUrl = _rollbarConfig.rollbarJsUrl || defaultRollbarJsUrl;

src/browser/defaults.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Default browser options
33
*/
4-
import { version, commonScrubFields } from '../defaults.js';
4+
import { commonScrubFields } from '../defaults.js';
55

66
export const scrubFields = [
77
...commonScrubFields,
@@ -47,13 +47,5 @@ export const scrubFields = [
4747
'ccyear',
4848
];
4949

50-
// CDN configuration for the snippet
51-
export const cdnHost = 'cdn.rollbar.com';
52-
export const defaultRollbarJsUrl = `https://${cdnHost}/rollbarjs/refs/tags/v${version}/rollbar.min.js`;
53-
54-
export const jqueryPluginVersion = '0.0.8';
55-
5650
// For compatibility with existing code that expects default export with scrubFields property
57-
export default {
58-
scrubFields,
59-
};
51+
export default { scrubFields };

src/browser/plugins/jquery.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
/* globals jQuery */
22

3-
import { jqueryPluginVersion } from '../defaults.js';
4-
53
(function (jQuery, window, document) {
64
var rb = window.Rollbar;
75
if (!rb) {
86
return;
97
}
108

11-
var JQUERY_PLUGIN_VERSION = jqueryPluginVersion;
9+
var JQUERY_PLUGIN_VERSION = '0.0.8';
1210

1311
rb.configure({
1412
payload: {

0 commit comments

Comments
 (0)