Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions karma/config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
'use strict';

// Comment the next two lines if you want to run with Chrome instead of Chromium
// const puppeteer = require('puppeteer');
// process.env.CHROME_BIN = puppeteer.executablePath();
const puppeteer = require('puppeteer');
process.env.CHROME_BIN = puppeteer.executablePath();

const nodeResolve = require('@rollup/plugin-node-resolve').nodeResolve;
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
const json = require('@rollup/plugin-json');
const string = require('rollup-plugin-string').string;
const terser = require('rollup-plugin-terser').terser;
const nodePolyfills = require('rollup-plugin-node-polyfills');
const { string } = require('rollup-plugin-string');
const terser = require('@rollup/plugin-terser');
const nodePolyfills = require('rollup-plugin-polyfill-node');

// More popular plugins like https://www.npmjs.com/package/@rollup/plugin-typescript or https://www.npmjs.com/package/rollup-plugin-typescript2
// cannot be used because they don't compile .ts files from node_modules
Expand Down
3,259 changes: 2,051 additions & 1,208 deletions package-lock.json

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@
"@types/google.analytics": "0.0.40"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/plugin-terser": "^0.4.0",
"@types/jest": "^27.0.2",
"@types/node-fetch": "^2.5.7",
"@typescript-eslint/eslint-plugin": "^4.14.1",
Expand All @@ -80,18 +81,18 @@
"eslint-plugin-import": "^2.25.4",
"fetch-mock": "^9.11.0",
"jest": "^27.2.3",
"karma": "^6.4.0",
"karma": "^6.4.1",
"karma-chrome-launcher": "^3.1.1",
"karma-rollup-preprocessor": "^7.0.8",
"karma-tap": "^4.2.0",
"puppeteer": "^3.3.0",
"replace": "^1.2.1",
"rimraf": "^3.0.2",
"rollup": "^2.35.1",
"rollup-plugin-node-polyfills": "^0.2.1",
"rollup": "^2.79.1",
"rollup-plugin-polyfill-node": "^0.12.0",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-ts": "^1.4.7",
"rollup-plugin-visualizer": "^4.2.0",
"rollup-plugin-ts": "^3.2.0",
"rollup-plugin-visualizer": "^5.9.0",
"sinon": "^9.2.2",
"tape": "4.13.2",
"tape-catch": "1.0.6",
Expand Down
2 changes: 1 addition & 1 deletion rollup.ci.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { plugins, VERSION } from './rollup.common.js';
import { terser } from 'rollup-plugin-terser';
import terser from '@rollup/plugin-terser';

export default env => {

Expand Down
2 changes: 1 addition & 1 deletion rollup.visualizer.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { plugins, VERSION } from './rollup.common.js';
import { terser } from 'rollup-plugin-terser';
import terser from '@rollup/plugin-terser';
import visualizer from 'rollup-plugin-visualizer';

const createRollupConfig = (input, outputPrefix) => ({
Expand Down
17 changes: 7 additions & 10 deletions src/__tests__/browserSuites/ready-promise.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,10 @@ export default function readyPromiseAssertions(fetchMock, assert) {
// We also use the manager to get some of the promises
const manager = splitio.manager();

// promise1 is handled immediately. Thus, the 'reject' callback is expected to be called in 0.15 seconds aprox.
// `ready` is called immediately. Thus, the 'reject' callback is expected to be called in 0.15 seconds aprox.
setTimeout(() => {
const promise1 = client.ready();
const tStart = Date.now();
promise1
client.ready()
.then(() => {
t.fail('### SDK IS READY - not TIMED OUT when it should.');
})
Expand All @@ -434,11 +433,10 @@ export default function readyPromiseAssertions(fetchMock, assert) {
});
}, 0);

// promise2 is handled in 0.15 seconds, when the promise is just rejected. Thus, the 'reject' callback is expected to be called immediately (0 seconds aprox).
// `ready`` is called in 0.15 seconds, when the promise is just rejected. Thus, the 'reject' callback is expected to be called immediately (0 seconds aprox).
setTimeout(() => {
const promise2 = manager.ready();
const tStart = Date.now();
promise2
manager.ready()
.then(() => {
t.fail('### SDK IS READY - not TIMED OUT when it should.');
})
Expand All @@ -450,11 +448,10 @@ export default function readyPromiseAssertions(fetchMock, assert) {
});
}, fromSecondsToMillis(0.15));

// promise3 is handled in 0.2 seconds, when the promise is just resolved. Thus, the 'resolve' callback is expected to be called immediately (0 seconds aprox).
// `ready` is called in 0.25 seconds, right after the promise is resolved (0.2 secs). Thus, the 'resolve' callback is expected to be called immediately (0 seconds aprox).
setTimeout(() => {
const promise3 = manager.ready();
const tStart = Date.now();
promise3
manager.ready()
.then(() => {
t.pass('### SDK IS READY - retry attempt finishes before the requestTimeoutBeforeReady limit');
assertGetTreatmentWhenReady(t, client);
Expand All @@ -480,7 +477,7 @@ export default function readyPromiseAssertions(fetchMock, assert) {
});
});
});
}, fromSecondsToMillis(0.2));
}, fromSecondsToMillis(0.25));
}, 'Evaluate that multiple promises are resolved/rejected on expected times.');

// Validate that warning messages are properly sent.
Expand Down
9 changes: 8 additions & 1 deletion src/full/umd.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
// @ts-nocheck
import { SplitFactory, InLocalStorage, GoogleAnalyticsToSplit, SplitToGoogleAnalytics, ErrorLogger, WarnLogger, InfoLogger, DebugLogger } from './index';
import { SplitFactory } from './splitFactory';
import { InLocalStorage } from '@splitsoftware/splitio-commons/src/storages/inLocalStorage/index';
import { GoogleAnalyticsToSplit } from '@splitsoftware/splitio-commons/src/integrations/ga/GoogleAnalyticsToSplit';
import { SplitToGoogleAnalytics } from '@splitsoftware/splitio-commons/src/integrations/ga/SplitToGoogleAnalytics';
import { ErrorLogger } from '@splitsoftware/splitio-commons/src/logger/browser/ErrorLogger';
import { WarnLogger } from '@splitsoftware/splitio-commons/src/logger/browser/WarnLogger';
import { InfoLogger } from '@splitsoftware/splitio-commons/src/logger/browser/InfoLogger';
import { DebugLogger } from '@splitsoftware/splitio-commons/src/logger/browser/DebugLogger';

// Include all pluggable modules as properties to expose at the global `splitio` object
SplitFactory.SplitFactory = SplitFactory;
Expand Down