@splitsoftware/splitio 10.20.1-rc.2 → 10.21.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 CHANGED
@@ -1,7 +1,9 @@
1
- 10.20.1 (July XX, 2022)
2
- - Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in mobile and modern Web browsers (See https://developer.chrome.com/blog/page-lifecycle-api/#legacy-lifecycle-apis-to-avoid).
1
+ 10.21.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.
3
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.
4
- - Bugfixing - Moved js-yaml dependency from @splitsoftware/splitio-commons to avoid issues in Node v14 when installing third-party dependencies that also uses js-yaml as a transitive dependency (Related to issue https://github.com/splitio/javascript-client/issues/662)
5
+ - Updated some dependencies for vulnerability fixes.
6
+ - Bugfixing - Moved js-yaml dependency from @splitsoftware/splitio-commons to avoid resolution to an incompatible version on certain npm versions when installing third-party dependencies that also define js-yaml as transitive dependency (Related to issue https://github.com/splitio/javascript-client/issues/662).
5
7
 
6
8
  10.20.0 (June 29, 2022)
7
9
  - 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.
@@ -1 +1 @@
1
- export var packageVersion = '10.20.1-rc.2';
1
+ export var packageVersion = '10.21.0';
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.packageVersion = void 0;
4
- exports.packageVersion = '10.20.1-rc.2';
4
+ exports.packageVersion = '10.21.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio",
3
- "version": "10.20.1-rc.2",
3
+ "version": "10.21.0",
4
4
  "description": "Split SDK",
5
5
  "files": [
6
6
  "README.md",
@@ -10,7 +10,8 @@
10
10
  "lib",
11
11
  "types",
12
12
  "es",
13
- "src"
13
+ "src",
14
+ "scripts/ga-to-split-autorequire.js"
14
15
  ],
15
16
  "repository": "splitio/javascript-client",
16
17
  "homepage": "https://github.com/splitio/javascript-client#readme",
@@ -32,7 +33,7 @@
32
33
  "node": ">=6"
33
34
  },
34
35
  "dependencies": {
35
- "@splitsoftware/splitio-commons": "1.5.1-rc.2",
36
+ "@splitsoftware/splitio-commons": "1.6.1",
36
37
  "@types/google.analytics": "0.0.40",
37
38
  "@types/ioredis": "^4.28.0",
38
39
  "ioredis": "^4.28.0",
@@ -83,6 +84,7 @@
83
84
  "postbuild-cjs": "cross-env NODE_ENV=cjs node scripts/copy.packages.json.js && ./scripts/build_cjs_replace_imports.sh",
84
85
  "build-umd": "webpack --config webpack.dev.js --env branch=$BUILD_BRANCH --env commit_hash=$BUILD_COMMIT && webpack --config webpack.prod.js --env branch=$BUILD_BRANCH --env commit_hash=$BUILD_COMMIT && ./scripts/clean_umd_build.sh",
85
86
  "build:npm": "rimraf lib es && npm run build-cjs && npm run build-esm",
87
+ "build:ga-to-split-autorequire": "terser ./node_modules/@splitsoftware/splitio-commons/src/integrations/ga/autoRequire.js --mangle --output ./scripts/ga-to-split-autorequire.js && cp ./scripts/ga-to-split-autorequire.js umd/ga-to-split-autorequire.js",
86
88
  "build": "rimraf lib umd es && npm run build-cjs && npm run build-esm && npm run build-umd",
87
89
  "check": "npm run check:lint && npm run check:version",
88
90
  "check:lint": "eslint src",
@@ -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");
@@ -1 +1 @@
1
- export const packageVersion = '10.20.1-rc.2';
1
+ export const packageVersion = '10.21.0';
@@ -716,7 +716,7 @@ declare namespace SplitIO {
716
716
  /**
717
717
  * Enable 'Google Analytics to Split' integration, to track Google Analytics hits as Split events.
718
718
  *
719
- * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#integrations}
719
+ * @see {@link https://help.split.io/hc/en-us/articles/360040838752#google-analytics-to-split}
720
720
  */
721
721
  interface IGoogleAnalyticsToSplitConfig {
722
722
  type: 'GOOGLE_ANALYTICS_TO_SPLIT',
@@ -758,6 +758,17 @@ declare namespace SplitIO {
758
758
  * If not provided, events are sent using the key and traffic type provided at SDK config
759
759
  */
760
760
  identities?: Identity[],
761
+ /**
762
+ * Optional flag to log an error if the `auto-require` script is not detected.
763
+ * The auto-require script automatically requires the `splitTracker` plugin for created trackers,
764
+ * and should be placed right after your Google Analytics, Google Tag Manager or gtag.js script tag.
765
+ *
766
+ * @see {@link https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js}
767
+ *
768
+ * @property {boolean} autoRequire
769
+ * @default false
770
+ */
771
+ autoRequire?: boolean,
761
772
  }
762
773
  /**
763
774
  * Object representing the data sent by Split (events and impressions).
@@ -769,7 +780,7 @@ declare namespace SplitIO {
769
780
  /**
770
781
  * Enable 'Split to Google Analytics' integration, to track Split impressions and events as Google Analytics hits.
771
782
  *
772
- * @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#integrations}
783
+ * @see {@link https://help.split.io/hc/en-us/articles/360040838752#split-to-google-analytics}
773
784
  */
774
785
  interface ISplitToGoogleAnalyticsConfig {
775
786
  type: 'SPLIT_TO_GOOGLE_ANALYTICS',