@splitsoftware/splitio-browserjs 0.6.1-rc.3 → 0.8.0
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.
- package/CHANGES.txt +12 -0
- package/cjs/settings/defaults.js +1 -1
- package/esm/settings/defaults.js +1 -1
- package/package.json +8 -6
- package/scripts/ga-to-split-autorequire.js +1 -0
- package/src/settings/defaults.ts +1 -1
- package/types/full/index.d.ts +2 -2
- package/types/index.d.ts +2 -2
- package/types/splitio.d.ts +17 -6
package/CHANGES.txt
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
0.8.0 (July 22, 2022)
|
|
2
|
+
- Added `autoRequire` configuration option to the Google Analytics to Split integration, which takes care of requiring the splitTracker plugin on trackers dynamically created by Google tag managers (See https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js).
|
|
3
|
+
- Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in modern mobile and desktop Web browsers.
|
|
4
|
+
- Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced.
|
|
5
|
+
- Updated some dependencies for vulnerability fixes.
|
|
6
|
+
|
|
7
|
+
0.7.0 (June 29, 2022)
|
|
8
|
+
- Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config sync.enabled . Running online Split will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used.
|
|
9
|
+
- Updated telemetry logic to track the anonymous config for user consent flag set to declined or unknown.
|
|
10
|
+
- Updated submitters logic, to avoid duplicating the post of impressions to Split cloud when the SDK is destroyed while its periodic post of impressions is running.
|
|
11
|
+
- Bugfixing - Updated submitters logic, to avoid dropping impressions and events that are being tracked while POST request is pending.
|
|
12
|
+
|
|
1
13
|
0.6.0 (May 24, 2022)
|
|
2
14
|
- Added `scheduler.telemetryRefreshRate` property to SDK configuration.
|
|
3
15
|
- Updated SDK telemetry storage, metrics and updater to be more effective and send less often.
|
package/cjs/settings/defaults.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.defaults = void 0;
|
|
4
4
|
var index_1 = require("@splitsoftware/splitio-commons/cjs/logger/index");
|
|
5
5
|
var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants");
|
|
6
|
-
var packageVersion = '0.
|
|
6
|
+
var packageVersion = '0.8.0';
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
9
9
|
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
package/esm/settings/defaults.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/esm/logger/index';
|
|
2
2
|
import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/esm/utils/constants';
|
|
3
|
-
var packageVersion = '0.
|
|
3
|
+
var packageVersion = '0.8.0';
|
|
4
4
|
/**
|
|
5
5
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
|
6
6
|
* Acceptable values are: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'NONE'.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splitsoftware/splitio-browserjs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Split SDK for Javascript on Browser",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"esm",
|
|
15
15
|
"src",
|
|
16
16
|
"types",
|
|
17
|
-
"full"
|
|
17
|
+
"full",
|
|
18
|
+
"scripts/ga-to-split-autorequire.js"
|
|
18
19
|
],
|
|
19
20
|
"scripts": {
|
|
20
21
|
"check": "npm run check:lint && npm run check:types && npm run check:version",
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
"build:cjs": "rimraf cjs && tsc -outDir cjs -m CommonJS && ./scripts/build_cjs_replace_imports.sh",
|
|
27
28
|
"build:umd-visualizer": "rollup --config rollup.visualizer.config.js",
|
|
28
29
|
"build:umd": "rollup --config rollup.ci.config.js --branch=$BUILD_BRANCH --commit_hash=$BUILD_COMMIT",
|
|
30
|
+
"build:ga-to-split-autorequire": "terser ./node_modules/@splitsoftware/splitio-commons/src/integrations/ga/autoRequire.js --mangle --output ./scripts/ga-to-split-autorequire.js",
|
|
29
31
|
"test": "npm run test:unit && npm run test:e2e",
|
|
30
32
|
"test:unit": "jest",
|
|
31
33
|
"test:e2e": "npm run test:e2e-logger && npm run test:e2e-offline && npm run test:e2e-online && npm run test:e2e-destroy && npm run test:e2e-errors && npm run test:e2e-push && npm run test:e2e-gaintegration && npm run test:e2e-consumer",
|
|
@@ -61,7 +63,7 @@
|
|
|
61
63
|
"bugs": "https://github.com/splitio/javascript-browser-client/issues",
|
|
62
64
|
"homepage": "https://github.com/splitio/javascript-browser-client#readme",
|
|
63
65
|
"dependencies": {
|
|
64
|
-
"@splitsoftware/splitio-commons": "1.
|
|
66
|
+
"@splitsoftware/splitio-commons": "1.6.1",
|
|
65
67
|
"@types/google.analytics": "0.0.40"
|
|
66
68
|
},
|
|
67
69
|
"devDependencies": {
|
|
@@ -77,9 +79,9 @@
|
|
|
77
79
|
"eslint-plugin-import": "^2.25.4",
|
|
78
80
|
"fetch-mock": "^9.11.0",
|
|
79
81
|
"jest": "^27.2.3",
|
|
80
|
-
"karma": "^6.
|
|
81
|
-
"karma-chrome-launcher": "^3.1.
|
|
82
|
-
"karma-rollup-preprocessor": "^7.0.
|
|
82
|
+
"karma": "^6.4.0",
|
|
83
|
+
"karma-chrome-launcher": "^3.1.1",
|
|
84
|
+
"karma-rollup-preprocessor": "^7.0.8",
|
|
83
85
|
"karma-tap": "^4.2.0",
|
|
84
86
|
"replace": "^1.2.1",
|
|
85
87
|
"rimraf": "^3.0.2",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(n,t,e){n[e]=n[e]||t;n[t]=n[t]||function(){n[t].q.push(arguments)};n[t].q=n[t].q||[];var r={};function i(n){return typeof n==="object"&&typeof n.name==="string"&&n.name}function o(e){if(e&&e[0]==="create"){var o=i(e[1])||i(e[2])||i(e[3])||(typeof e[3]==="string"?e[3]:undefined);if(!r[o]){r[o]=true;n[t]((o?o+".":"")+"require","splitTracker")}}}n[t].q.forEach(o);var u=n[t].q.push;n[t].q.push=function(n){var t=u.apply(this,arguments);o(n);return t}})(window,"ga","GoogleAnalyticsObject");
|
package/src/settings/defaults.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/
|
|
|
2
2
|
import { ConsentStatus, LogLevel } from '@splitsoftware/splitio-commons/src/types';
|
|
3
3
|
import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants';
|
|
4
4
|
|
|
5
|
-
const packageVersion = '0.
|
|
5
|
+
const packageVersion = '0.8.0';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* In browser, the default debug level, can be set via the `localStorage.splitio_debug` item.
|
package/types/full/index.d.ts
CHANGED
|
@@ -35,14 +35,14 @@ declare module JsSdk {
|
|
|
35
35
|
/**
|
|
36
36
|
* Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
|
|
37
37
|
*
|
|
38
|
-
* @see {@link https://help.split.io/hc/en-us/articles/
|
|
38
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split}
|
|
39
39
|
*/
|
|
40
40
|
export function GoogleAnalyticsToSplit(options?: SplitIO.GoogleAnalyticsToSplitOptions): SplitIO.IntegrationFactory;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Enable 'Split to Google Analytics' integration, to track Split impressions and events as Google Analytics hits.
|
|
44
44
|
*
|
|
45
|
-
* @see {@link https://help.split.io/hc/en-us/articles/
|
|
45
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics}
|
|
46
46
|
*/
|
|
47
47
|
export function SplitToGoogleAnalytics(options?: SplitIO.SplitToGoogleAnalyticsOptions): SplitIO.IntegrationFactory;
|
|
48
48
|
|
package/types/index.d.ts
CHANGED
|
@@ -35,14 +35,14 @@ declare module JsSdk {
|
|
|
35
35
|
/**
|
|
36
36
|
* Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
|
|
37
37
|
*
|
|
38
|
-
* @see {@link https://help.split.io/hc/en-us/articles/
|
|
38
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split}
|
|
39
39
|
*/
|
|
40
40
|
export function GoogleAnalyticsToSplit(options?: SplitIO.GoogleAnalyticsToSplitOptions): SplitIO.IntegrationFactory;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Enable 'Split to Google Analytics' integration, to track Split impressions and events as Google Analytics hits.
|
|
44
44
|
*
|
|
45
|
-
* @see {@link https://help.split.io/hc/en-us/articles/
|
|
45
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics}
|
|
46
46
|
*/
|
|
47
47
|
export function SplitToGoogleAnalytics(options?: SplitIO.SplitToGoogleAnalyticsOptions): SplitIO.IntegrationFactory;
|
|
48
48
|
|
package/types/splitio.d.ts
CHANGED
|
@@ -244,11 +244,11 @@ interface ISharedSettings {
|
|
|
244
244
|
*/
|
|
245
245
|
localhostMode?: SplitIO.LocalhostFactory
|
|
246
246
|
/**
|
|
247
|
-
* Controls the SDK continuous synchronization flags.
|
|
248
|
-
*
|
|
249
|
-
* When `true` a running SDK will process rollout plan updates performed on the UI (default).
|
|
247
|
+
* Controls the SDK continuous synchronization flags.
|
|
248
|
+
*
|
|
249
|
+
* When `true` a running SDK will process rollout plan updates performed on the UI (default).
|
|
250
250
|
* When false it'll just fetch all data upon init
|
|
251
|
-
*
|
|
251
|
+
*
|
|
252
252
|
* @property {boolean} enabled
|
|
253
253
|
* @default true
|
|
254
254
|
*/
|
|
@@ -628,7 +628,7 @@ declare namespace SplitIO {
|
|
|
628
628
|
/**
|
|
629
629
|
* Configuration params for 'Google Analytics to Split' integration plugin, to track Google Analytics hits as Split events.
|
|
630
630
|
*
|
|
631
|
-
* @see {@link https://help.split.io/hc/en-us/articles/
|
|
631
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split}
|
|
632
632
|
*/
|
|
633
633
|
interface GoogleAnalyticsToSplitOptions {
|
|
634
634
|
/**
|
|
@@ -669,6 +669,17 @@ declare namespace SplitIO {
|
|
|
669
669
|
* If not provided, events are sent using the key and traffic type provided at SDK config.
|
|
670
670
|
*/
|
|
671
671
|
identities: Identity[],
|
|
672
|
+
/**
|
|
673
|
+
* Optional flag to log an error if the `auto-require` script is not detected.
|
|
674
|
+
* The auto-require script automatically requires the `splitTracker` plugin for created trackers,
|
|
675
|
+
* and should be placed right after your Google Analytics, Google Tag Manager or gtag.js script tag.
|
|
676
|
+
*
|
|
677
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js}
|
|
678
|
+
*
|
|
679
|
+
* @property {boolean} autoRequire
|
|
680
|
+
* @default false
|
|
681
|
+
*/
|
|
682
|
+
autoRequire?: boolean,
|
|
672
683
|
}
|
|
673
684
|
/**
|
|
674
685
|
* Object representing the data sent by Split (events and impressions).
|
|
@@ -680,7 +691,7 @@ declare namespace SplitIO {
|
|
|
680
691
|
/**
|
|
681
692
|
* Configuration params for 'Split to Google Analytics' integration plugin, to track Split impressions and events as Google Analytics hits.
|
|
682
693
|
*
|
|
683
|
-
* @see {@link https://help.split.io/hc/en-us/articles/
|
|
694
|
+
* @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics}
|
|
684
695
|
*/
|
|
685
696
|
interface SplitToGoogleAnalyticsOptions {
|
|
686
697
|
/**
|