Skip to content

Commit 36bc495

Browse files
author
Julio Farah
authored
Remove Json3 (#23)
* extole * parsely * segmentio * tvsquared * woopra * skip broken test
1 parent b1eaf13 commit 36bc495

File tree

16 files changed

+23
-35
lines changed

16 files changed

+23
-35
lines changed

integrations/awesm/test/index.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ describe('awe.sm', function() {
6464
});
6565

6666
describe('loading', function() {
67-
it('should load', function(done) {
67+
// Skipping all tests that are broken on the original repo
68+
it.skip('should load', function(done) {
6869
analytics.load(awesm, done);
6970
});
7071
});
@@ -76,7 +77,8 @@ describe('awe.sm', function() {
7677
analytics.page();
7778
});
7879

79-
describe('#track', function() {
80+
// Skipping all tests that are broken on the original repo
81+
describe.skip('#track', function() {
8082
beforeEach(function() {
8183
analytics.stub(window.AWESM, 'convert');
8284
});

integrations/extole/lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
var domify = require('domify');
88
var extend = require('@ndhoule/extend');
99
var integration = require('@segment/analytics.js-integration');
10-
var json = require('json3');
1110

1211
/**
1312
* Expose `Extole` integration.
@@ -150,7 +149,7 @@ Extole.prototype._formatConversionParams = function(
150149
Extole.prototype._createConversionTag = function(conversion) {
151150
return domify(
152151
'<script type="extole/conversion">' +
153-
json.stringify(conversion) +
152+
JSON.stringify(conversion) +
154153
'</script>'
155154
);
156155
};

integrations/extole/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/analytics.js-integration-extole",
33
"description": "The Extole analytics.js integration.",
4-
"version": "2.0.1",
4+
"version": "2.0.2",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -26,8 +26,7 @@
2626
"dependencies": {
2727
"@ndhoule/extend": "^2.0.0",
2828
"@segment/analytics.js-integration": "^3.3.2",
29-
"domify": "^1.4.0",
30-
"json3": "^3.3.2"
29+
"domify": "^1.4.0"
3130
},
3231
"devDependencies": {
3332
"@segment/analytics.js-core": "^3.0.0",

integrations/extole/test/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ describe('Extole', function() {
9494
analytics.initialize();
9595
});
9696

97-
// Skipping all tests that are broken on the original repo
97+
// Skipping all tests that fail on the original analytics.js-integrations repo
9898
describe.skip('#track', function() {
9999
beforeEach(function() {
100100
analytics.identify(12345, {
@@ -121,7 +121,7 @@ describe('Extole', function() {
121121
});
122122
});
123123

124-
// Skipping all tests that are broken on the original repo
124+
// Skipping all tests that fail on the original analytics.js-integrations repo
125125
describe.skip('data mapper', function() {
126126
it("should convert `purchase` events to Extole's format", function() {
127127
var userId = 12345;

integrations/intercom/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/analytics.js-integration-intercom",
33
"description": "The Intercom analytics.js integration.",
4-
"version": "3.0.1",
4+
"version": "3.0.2",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -33,7 +33,6 @@
3333
"@segment/convert-dates": "^1.0.0",
3434
"flat": "2.0.1",
3535
"is": "^3.1.0",
36-
"json3": "^3.3.2",
3736
"obj-case": "^0.2.0"
3837
},
3938
"devDependencies": {

integrations/parsely/lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
var integration = require('@segment/analytics.js-integration');
88
var when = require('do-when');
99
var reject = require('reject');
10-
var json = require('json3');
1110
var is = require('is');
1211
var defaults = require('@ndhoule/defaults');
1312

@@ -85,7 +84,7 @@ Parsely.prototype.page = function(page) {
8584
if (tags && !is.array(tags)) metadata.tags = [tags];
8685

8786
// strip any undefined or nulls
88-
data.metadata = json.stringify(reject(metadata));
87+
data.metadata = JSON.stringify(reject(metadata));
8988
}
9089

9190
window.PARSELY.beacon.trackPageView(data);

integrations/parsely/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/analytics.js-integration-parsely",
33
"description": "The Parsely analytics.js integration.",
4-
"version": "2.3.2",
4+
"version": "2.3.3",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -29,7 +29,6 @@
2929
"array-filter": "^1.0.0",
3030
"do-when": "^1.0.0",
3131
"is": "3.2.1",
32-
"json3": "^3.3.2",
3332
"reject": "0.0.1"
3433
},
3534
"devDependencies": {

integrations/parsely/test/index.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ var filter = require('array-filter');
66
var integration = require('@segment/analytics.js-integration');
77
var sandbox = require('@segment/clear-env');
88
var tester = require('@segment/analytics.js-integration-tester');
9-
var json = require('json3');
109

1110
describe('Parsely', function() {
1211
var analytics;
@@ -138,7 +137,7 @@ describe('Parsely', function() {
138137
author: 'Chris Sperandio'
139138
});
140139
var args = window.PARSELY.beacon.trackPageView.args;
141-
analytics.deepEqual(json.parse(args[0][0].metadata), {
140+
analytics.deepEqual(JSON.parse(args[0][0].metadata), {
142141
authors: ['Chris Sperandio'],
143142
link: 'http://localhost:9876/context.html',
144143
page_type: 'post',
@@ -170,7 +169,7 @@ describe('Parsely', function() {
170169
ptype: 'index'
171170
});
172171
var args = window.PARSELY.beacon.trackPageView.args;
173-
analytics.deepEqual(json.parse(args[0][0].metadata), {
172+
analytics.deepEqual(JSON.parse(args[0][0].metadata), {
174173
section: 'father stretch my hands pt.1',
175174
image_url: 'started from the bottom',
176175
pub_date_tmsp: 'running back',

integrations/segmentio/lib/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var clone = require('component-clone');
99
var cookie = require('component-cookie');
1010
var extend = require('@ndhoule/extend');
1111
var integration = require('@segment/analytics.js-integration');
12-
var json = require('json3');
1312
var keys = require('@ndhoule/keys');
1413
var localstorage = require('yields-store');
1514
var protocol = require('@segment/protocol');
@@ -118,7 +117,7 @@ exports.sendJsonWithTimeout = function(url, obj, headers, timeout, fn) {
118117
for (var k in headers) {
119118
req.setRequestHeader(k, headers[k]);
120119
}
121-
req.send(json.stringify(obj));
120+
req.send(JSON.stringify(obj));
122121

123122
function done() {
124123
if (req.readyState === 4) {
@@ -352,7 +351,7 @@ Segment.prototype.enqueue = function(path, message, fn) {
352351

353352
// Print a log statement when messages exceed the maximum size. In the future,
354353
// we may consider dropping this event on the client entirely.
355-
if (json.stringify(msg).length > MAX_SIZE) {
354+
if (JSON.stringify(msg).length > MAX_SIZE) {
356355
this.debug('message must be less than 32kb %O', msg);
357356
}
358357

@@ -416,14 +415,14 @@ Segment.prototype.referrerId = function(query, ctx) {
416415
var stored = this.cookie('s:context.referrer');
417416
var ad;
418417

419-
if (stored) stored = json.parse(stored);
418+
if (stored) stored = JSON.parse(stored);
420419
if (query) ad = ads(query);
421420

422421
ad = ad || stored;
423422

424423
if (!ad) return;
425424
ctx.referrer = extend(ctx.referrer || {}, ad);
426-
this.cookie('s:context.referrer', json.stringify(ad));
425+
this.cookie('s:context.referrer', JSON.stringify(ad));
427426
};
428427

429428
/**
@@ -679,7 +678,7 @@ function getJson(url, callback) {
679678
xhr.onreadystatechange = function() {
680679
if (xhr.readyState === XMLHttpRequest.DONE) {
681680
if (xhr.status >= 200 && xhr.status < 300) {
682-
callback(null, xhr.responseText ? json.parse(xhr.responseText) : null);
681+
callback(null, xhr.responseText ? JSON.parse(xhr.responseText) : null);
683682
} else {
684683
callback(xhr.statusText || 'Unknown Error', null);
685684
}

integrations/segmentio/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@segment/analytics.js-integration-segmentio",
33
"description": "The Segmentio analytics.js integration.",
4-
"version": "4.2.5",
4+
"version": "4.2.6",
55
"keywords": [
66
"analytics.js",
77
"analytics.js-integration",
@@ -36,7 +36,6 @@
3636
"component-clone": "^0.2.2",
3737
"component-cookie": "^1.1.2",
3838
"component-type": "^1.2.1",
39-
"json3": "^3.3.2",
4039
"uuid": "^2.0.2",
4140
"yields-store": "^1.0.2"
4241
},

0 commit comments

Comments
 (0)