From 43e42a011581921e0db737874e2c3fdc87f9d625 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 17 Mar 2023 16:27:34 -0300 Subject: [PATCH 1/4] code styling updates --- .eslintrc | 3 ++- src/__tests__/browserSuites/events.spec.js | 14 +++++++------- .../browserSuites/impressions-listener.spec.js | 2 +- src/__tests__/browserSuites/manager.spec.js | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.eslintrc b/.eslintrc index 9954be9..319c486 100644 --- a/.eslintrc +++ b/.eslintrc @@ -31,7 +31,8 @@ "@typescript-eslint/no-unused-vars": "error", "keyword-spacing": "error", "comma-style": "error", - "no-trailing-spaces": "error" + "no-trailing-spaces": "error", + "space-before-function-paren": ["error", {"named": "never"}] }, "overrides": [ diff --git a/src/__tests__/browserSuites/events.spec.js b/src/__tests__/browserSuites/events.spec.js index a33dd79..e9280ac 100644 --- a/src/__tests__/browserSuites/events.spec.js +++ b/src/__tests__/browserSuites/events.spec.js @@ -72,9 +72,9 @@ export function withoutBindingTT(fetchMock, assert) { // Key binded as with getTreatment. tsStart = Date.now(); assert.ok(client.track('sometraffictype', 'someEvent', 10), 'client.track returns true if an event is added to the queue.'); - assert.ok(client.track('othertraffictype', 'genericEvent', 25), 'client.track returns true if event value is null and is added to the queue.'); - assert.ok(client.track('othertraffictype', 'genericEvent', 25, null), 'client.track returns true if event properties is null and is added to the queue.'); - assert.ok(client.track('othertraffictype', 'genericEvent', 24, { prop1: true, prop2: 'a', prop3: 2, prop4: null, willBeNulled: {} }), 'client.track returns true if event properties is an object and is added to the queue.'); + assert.ok(client.track('othertraffictype', 'genericEvent', 25), 'client.track returns true if event value is null and is added to the queue.'); + assert.ok(client.track('othertraffictype', 'genericEvent', 25, null), 'client.track returns true if event properties is null and is added to the queue.'); + assert.ok(client.track('othertraffictype', 'genericEvent', 24, { prop1: true, prop2: 'a', prop3: 2, prop4: null, willBeNulled: {} }), 'client.track returns true if event properties is an object and is added to the queue.'); assert.ok(client.track('othertraffictype', 'my.click.event'), 'client.track returns true if an event is added to the queue.'); assert.ok(client.track('othertraffictype', 'my.checkout.event', null), 'client.track returns true if an event is added to the queue.'); tsEnd = Date.now(); @@ -89,7 +89,7 @@ export function withoutBindingTT(fetchMock, assert) { assert.notOk(client.track(10, 'sometraffictype', 'someEvent'), 'client.track returns false if an event data was incorrect and it could not be added to the queue.'); assert.notOk(client.track('asd', 20, 'trafficType'), 'client.track returns false if an event data was incorrect and it could not be added to the queue.'); assert.notOk(client.track('othertraffictype', 'my.checkout.event', null, []), 'client.track returns false if an event properties was incorrect and it could not be added to the queue.'); - assert.notOk(client.track('othertraffictype', 'my.checkout.event', null, function() {}), 'client.track returns false if an event properties was incorrect and it could not be added to the queue.'); + assert.notOk(client.track('othertraffictype', 'my.checkout.event', null, function () { }), 'client.track returns false if an event properties was incorrect and it could not be added to the queue.'); assert.notOk(client.track('othertraffictype', 'my.checkout.event', null, 'asd'), 'client.track returns false if an event properties was incorrect and it could not be added to the queue.'); } @@ -143,8 +143,8 @@ export function bindingTT(fetchMock, assert) { tsStart = Date.now(); assert.ok(client.track('someEvent', 10), 'client.track returns true if an event is added to the queue.'); assert.ok(client.track('genericEvent', 25), 'client.track returns true if an event is added to the queue'); - assert.ok(client.track('genericEvent', 25, null), 'client.track returns true if event properties is null and is added to the queue.'); - assert.ok(client.track('genericEvent', 24, { prop1: true, prop2: 'a', prop3: 2, prop4: null, willBeNulled: {} }), 'client.track returns true if event properties is an object and is added to the queue.'); + assert.ok(client.track('genericEvent', 25, null), 'client.track returns true if event properties is null and is added to the queue.'); + assert.ok(client.track('genericEvent', 24, { prop1: true, prop2: 'a', prop3: 2, prop4: null, willBeNulled: {} }), 'client.track returns true if event properties is an object and is added to the queue.'); assert.ok(client.track('my.click.event'), 'client.track returns true if an event is added to the queue.'); assert.ok(client.track('my.checkout.event', null), 'client.track returns true if an event is added to the queue.'); tsEnd = Date.now(); @@ -158,6 +158,6 @@ export function bindingTT(fetchMock, assert) { assert.notOk(client.track('randomEvent', 'invalid value'), 'client.track returns false if event value is invalid and it could not be added to the queue.'); assert.notOk(client.track('my.checkout.event', ['some', 'stuff']), 'client.track returns false if event value is invalid and it could not be added to the queue.'); assert.notOk(client.track('my.checkout.event', null, []), 'client.track returns false if an event properties was incorrect and it could not be added to the queue.'); - assert.notOk(client.track('my.checkout.event', null, function() {}), 'client.track returns false if an event properties was incorrect and it could not be added to the queue.'); + assert.notOk(client.track('my.checkout.event', null, function () { }), 'client.track returns false if an event properties was incorrect and it could not be added to the queue.'); assert.notOk(client.track('my.checkout.event', null, 'asd'), 'client.track returns false if an event properties was incorrect and it could not be added to the queue.'); } diff --git a/src/__tests__/browserSuites/impressions-listener.spec.js b/src/__tests__/browserSuites/impressions-listener.spec.js index de6c41e..299daca 100644 --- a/src/__tests__/browserSuites/impressions-listener.spec.js +++ b/src/__tests__/browserSuites/impressions-listener.spec.js @@ -31,7 +31,7 @@ const config = { streamingEnabled: false }; -export default function(assert) { +export default function (assert) { const splitio = SplitFactory(config); const client = splitio.client(); const client2 = splitio.client({ matchingKey: 'marcio@split.io', bucketingKey: 'impr_bucketing_2' }); diff --git a/src/__tests__/browserSuites/manager.spec.js b/src/__tests__/browserSuites/manager.spec.js index ce13cd3..856242a 100644 --- a/src/__tests__/browserSuites/manager.spec.js +++ b/src/__tests__/browserSuites/manager.spec.js @@ -3,7 +3,7 @@ import splitChangesMockReal from '../mocks/splitchanges.real.json'; import map from 'lodash/map'; import { url } from '../testUtils'; -export default async function(settings, fetchMock, assert) { +export default async function (settings, fetchMock, assert) { fetchMock.getOnce({ url: url(settings, '/splitChanges?since=-1'), overwriteRoutes: true }, { status: 200, body: splitChangesMockReal }); const mockSplits = splitChangesMockReal; From 1eea7f71b9898f115fb350341bcd1f42fcee8539 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 17 Mar 2023 16:28:03 -0300 Subject: [PATCH 2/4] vulnerability fixes --- LICENSE | 2 +- package-lock.json | 48 +++++++++++++++++++++++------------------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/LICENSE b/LICENSE index 051b5fd..65f5999 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2022 Split Software, Inc. +Copyright © 2023 Split Software, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/package-lock.json b/package-lock.json index 3069037..1bb2ab7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8024,9 +8024,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -8188,9 +8188,9 @@ "dev": true }, "node_modules/karma/node_modules/ua-parser-js": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", - "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==", + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.34.tgz", + "integrity": "sha512-cJMeh/eOILyGu0ejgTKB95yKT3zOenSe9UGE3vj6WfiOwgGYnmATUsnDixMFvdU+rNMvWih83hrUP8VwhF9yXQ==", "dev": true, "funding": [ { @@ -10784,9 +10784,9 @@ } }, "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" @@ -10896,9 +10896,9 @@ } }, "node_modules/ua-parser-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz", - "integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.34.tgz", + "integrity": "sha512-K9mwJm/DaB6mRLZfw6q8IMXipcrmuT6yfhYmwhAkuh+81sChuYstYA+znlgaflUPaYUa3odxKPKGw6Vw/lANew==", "dev": true, "funding": [ { @@ -17398,9 +17398,9 @@ "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "jsonfile": { @@ -17491,9 +17491,9 @@ "dev": true }, "ua-parser-js": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", - "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==", + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.34.tgz", + "integrity": "sha512-cJMeh/eOILyGu0ejgTKB95yKT3zOenSe9UGE3vj6WfiOwgGYnmATUsnDixMFvdU+rNMvWih83hrUP8VwhF9yXQ==", "dev": true } } @@ -19504,9 +19504,9 @@ }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "requires": { "minimist": "^1.2.0" @@ -19589,9 +19589,9 @@ "dev": true }, "ua-parser-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz", - "integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==", + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.34.tgz", + "integrity": "sha512-K9mwJm/DaB6mRLZfw6q8IMXipcrmuT6yfhYmwhAkuh+81sChuYstYA+znlgaflUPaYUa3odxKPKGw6Vw/lANew==", "dev": true }, "unbox-primitive": { From d6476d58ac46ee544ca829391fe4703e827c58f6 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 17 Mar 2023 17:32:51 -0300 Subject: [PATCH 3/4] capitalize the s in Javascript ocurrences --- README.md | 4 ++-- package.json | 2 +- types/full/index.d.ts | 2 +- types/index.d.ts | 2 +- types/splitio.d.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e72c230..029c7b5 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,8 @@ Split has built and maintains SDKs for: * GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK) * iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK) * Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK) -* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK) -* Javascript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK) +* JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK) +* JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK) * Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK) * PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK) * Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK) diff --git a/package.json b/package.json index 58ef4b3..f6672ce 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@splitsoftware/splitio-browserjs", "version": "0.9.2", - "description": "Split SDK for Javascript on Browser", + "description": "Split SDK for JavaScript on Browser", "main": "cjs/index.js", "module": "esm/index.js", "types": "types", diff --git a/types/full/index.d.ts b/types/full/index.d.ts index 50536af..fd18469 100644 --- a/types/full/index.d.ts +++ b/types/full/index.d.ts @@ -1,4 +1,4 @@ -// Declaration file for Javascript Browser Split Software SDK +// Declaration file for JavaScript Browser Split Software SDK // Project: http://www.split.io/ // Definitions by: Nico Zelaya diff --git a/types/index.d.ts b/types/index.d.ts index 25d89a9..b9a1773 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,4 +1,4 @@ -// Declaration file for Javascript Browser Split Software SDK +// Declaration file for JavaScript Browser Split Software SDK // Project: http://www.split.io/ // Definitions by: Nico Zelaya diff --git a/types/splitio.d.ts b/types/splitio.d.ts index 9a4d665..b90d5b5 100644 --- a/types/splitio.d.ts +++ b/types/splitio.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Javascript Browser Split Software SDK +// Type definitions for JavaScript Browser Split Software SDK // Project: http://www.split.io/ // Definitions by: Nico Zelaya From c26fe9548243cb3f0a5adab942411ad9863d920d Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Mon, 20 Mar 2023 14:34:33 -0300 Subject: [PATCH 4/4] updated js-commons and general polishing --- .eslintrc | 1 - .github/workflows/ci-cd.yml | 16 ++++++++-------- CHANGES.txt | 4 ++++ README.md | 3 ++- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- rollup.ci.config.js | 2 +- rollup.common.js | 2 +- src/settings/defaults.ts | 2 +- types/splitio.d.ts | 15 ++++++++++----- 10 files changed, 38 insertions(+), 29 deletions(-) diff --git a/.eslintrc b/.eslintrc index 319c486..e45bc6c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -40,7 +40,6 @@ "files": ["src/**/*.ts"], "excludedFiles": ["src/**/__tests__/**"], "extends": [ - "eslint:recommended", "plugin:compat/recommended" ], "rules": { diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 76742e4..8c36339 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -63,14 +63,14 @@ jobs: matrix: environment: - stage - - stage-eu + # - stage-eu include: - environment: stage account_id: "079419646996" bucket: split-public-stage - - environment: stage-eu - account_id: "901851837056" - bucket: split-public-stage-eu-west-1 + # - environment: stage-eu + # account_id: "901851837056" + # bucket: split-public-stage-eu-west-1 steps: - name: Download assets @@ -106,14 +106,14 @@ jobs: matrix: environment: - prod - - prod-eu + # - prod-eu include: - environment: prod account_id: "825951051969" bucket: split-public - - environment: prod-eu - account_id: "842946900133" - bucket: split-public-eu-west-1 + # - environment: prod-eu + # account_id: "842946900133" + # bucket: split-public-eu-west-1 steps: - name: Download assets diff --git a/CHANGES.txt b/CHANGES.txt index b40c5af..66511bc 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +0.9.3 (March 20, 2023) + - Updated @splitsoftware/splitio-commons package to version 1.8.1 that includes minor improvements. + - Updated some transitive dependencies for vulnerability fixes. + 0.9.2 (December 16, 2022) - Updated some transitive dependencies for vulnerability fixes. - Bugfixing - Upgrade @splitsoftware/splitio-commons package to version 1.7.3 which includes a memory leak fix for localhost mode (Related to issue https://github.com/splitio/javascript-commons/issues/181) among other improvements. diff --git a/README.md b/README.md index 029c7b5..3058b34 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Split JavaScript SDK for Browsers -[![npm version](https://badge.fury.io/js/%40splitsoftware%2Fsplitio-browserjs.svg)](https://badge.fury.io/js/%40splitsoftware%2Fsplitio) [![Build Status](https://github.com/splitio/javascript-browser-client/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/splitio/javascript-browser-client/actions/workflows/ci-cd.yml) +[![npm version](https://badge.fury.io/js/%40splitsoftware%2Fsplitio-browserjs.svg)](https://badge.fury.io/js/%40splitsoftware%2Fsplitio-browserjs) [![Build Status](https://github.com/splitio/javascript-browser-client/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/splitio/javascript-browser-client/actions/workflows/ci-cd.yml) ## Overview This SDK is designed to work with Split, the platform for controlled rollouts, which serves features to your users via a Split feature flag to manage your complete customer experience. @@ -63,6 +63,7 @@ Split has built and maintains SDKs for: * .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK) * Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK) +* Angular [Github](https://github.com/splitio/angular-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/6495326064397-Angular-utilities) * GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK) * iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK) * Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK) diff --git a/package-lock.json b/package-lock.json index d29505e..3d8daaf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@splitsoftware/splitio-browserjs", - "version": "0.9.2", + "version": "0.9.3-rc.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio-browserjs", - "version": "0.9.2", + "version": "0.9.3-rc.1", "license": "Apache-2.0", "dependencies": { - "@splitsoftware/splitio-commons": "1.7.3", + "@splitsoftware/splitio-commons": "1.8.1", "@types/google.analytics": "0.0.40" }, "devDependencies": { @@ -3273,9 +3273,9 @@ "dev": true }, "node_modules/@splitsoftware/splitio-commons": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.7.3.tgz", - "integrity": "sha512-rWZ05g6eY0YlaDuNDWc3e/cPudbVRX7y8Lp0eKXE1wIFMf9P5pAdQWvb2KiXXsvGepM0FwA9U6epxEqatBIpiA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.8.1.tgz", + "integrity": "sha512-NHamCh+NwPTjO69kk5e6VaXjASPJzs0u3gWxITjmi0RPvGnNZ2M38/3ya1XSfARNjbDIpgHXlc1iywT07o3lEg==", "dependencies": { "tslib": "^2.3.1" }, @@ -14296,9 +14296,9 @@ "dev": true }, "@splitsoftware/splitio-commons": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.7.3.tgz", - "integrity": "sha512-rWZ05g6eY0YlaDuNDWc3e/cPudbVRX7y8Lp0eKXE1wIFMf9P5pAdQWvb2KiXXsvGepM0FwA9U6epxEqatBIpiA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.8.1.tgz", + "integrity": "sha512-NHamCh+NwPTjO69kk5e6VaXjASPJzs0u3gWxITjmi0RPvGnNZ2M38/3ya1XSfARNjbDIpgHXlc1iywT07o3lEg==", "requires": { "tslib": "^2.3.1" } diff --git a/package.json b/package.json index 2a061d9..0fc6728 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-browserjs", - "version": "0.9.2", + "version": "0.9.3-rc.1", "description": "Split SDK for JavaScript on Browser", "main": "cjs/index.js", "module": "esm/index.js", @@ -64,7 +64,7 @@ "bugs": "https://github.com/splitio/javascript-browser-client/issues", "homepage": "https://github.com/splitio/javascript-browser-client#readme", "dependencies": { - "@splitsoftware/splitio-commons": "1.7.3", + "@splitsoftware/splitio-commons": "1.8.1", "@types/google.analytics": "0.0.40" }, "devDependencies": { diff --git a/rollup.ci.config.js b/rollup.ci.config.js index 41a79b4..30717ac 100644 --- a/rollup.ci.config.js +++ b/rollup.ci.config.js @@ -3,7 +3,7 @@ import terser from '@rollup/plugin-terser'; export default env => { - const fileName = (outputSuffix) => `split-browser${env.branch !== 'main' ? `-dev-${env.commit_hash || VERSION}` : `-${VERSION}`}${outputSuffix ? `.${outputSuffix}` : ''}`; + const fileName = (outputSuffix) => `split-browser-${env.branch !== 'main' ? `dev-${env.commit_hash || VERSION}` : VERSION}${outputSuffix ? `.${outputSuffix}` : ''}`; const createRollupConfig = (input, outputSuffix) => ({ input, diff --git a/rollup.common.js b/rollup.common.js index f32b0f6..96c9336 100644 --- a/rollup.common.js +++ b/rollup.common.js @@ -8,7 +8,7 @@ export const plugins = [ nodeResolve({ // defaults `extensions` plus '.ts' files extensions: [ - '.mjs', '.js', '.json', '.node' + '.mjs', '.js', '.json', '.node', '.ts' ], browser: true, preferBuiltins: false, diff --git a/src/settings/defaults.ts b/src/settings/defaults.ts index d9d6a08..0190392 100644 --- a/src/settings/defaults.ts +++ b/src/settings/defaults.ts @@ -2,7 +2,7 @@ import { LogLevels, isLogLevelString } from '@splitsoftware/splitio-commons/src/ import { ConsentStatus, LogLevel } from '@splitsoftware/splitio-commons/src/types'; import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants'; -const packageVersion = '0.9.2'; +const packageVersion = '0.9.3-rc.1'; /** * In browser, the default debug level, can be set via the `localStorage.splitio_debug` item. diff --git a/types/splitio.d.ts b/types/splitio.d.ts index b90d5b5..6482370 100644 --- a/types/splitio.d.ts +++ b/types/splitio.d.ts @@ -296,9 +296,14 @@ interface IStatusInterface extends IEventEmitter { */ interface IBasicClient extends IStatusInterface { /** - * Destroy the client instance. + * Destroys the client instance. + * + * In 'standalone' and 'partial consumer' modes, this method will flush any pending impressions and events. + * In 'standalone' mode, it also stops the synchronization of feature flag definitions with the backend. + * In 'consumer' and 'partial consumer' modes, this method also disconnects the SDK from the Pluggable storage. + * * @function destroy - * @returns {Promise} + * @returns {Promise} A promise that will be resolved once the client is destroyed. */ destroy(): Promise } @@ -541,7 +546,7 @@ declare namespace SplitIO { /** * Optional prefix to prevent any kind of data collision when having multiple factories using the same storage type. * @property {string} prefix - * @default SPLITIO + * @default 'SPLITIO' */ prefix?: string } @@ -565,7 +570,7 @@ declare namespace SplitIO { /** * Optional prefix to prevent any kind of data collision when having multiple factories using the same storage wrapper. * @property {string} prefix - * @default SPLITIO + * @default 'SPLITIO' */ prefix?: string, /** @@ -896,7 +901,7 @@ declare namespace SplitIO { * For "localhost" mode, use "localhost" as authorizationKey. * * @property {'standalone'} mode - * @default standalone + * @default 'standalone' */ mode?: 'standalone', /**