From dfe59366366b361255fb077911157f283138cdd0 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 21 Dec 2021 17:44:08 -0300 Subject: [PATCH 1/4] prepare release --- CHANGES.txt | 20 +++++++++++++------- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 429ad003..845f2030 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,11 +1,17 @@ +1.1.0 (December 22, 2021) + - Added support for client-side SDK instances to run in "consumer" and "partial consumer" modes, with a custom implementation of it's internal storage modules, enabling customers to implement this caching in any storage technology of choice and connect it to the SDK instance itself which will use it instead of in-memory storage. + - Updated multiple modules due to general polishing and improvements. + - Updated ioredis dependency for vulnerability fixes. + - Bugfixing - Fixed issue returning dynamic configs if treatment name contains a dot ("."). + 1.0.0 (October 20, 2021) -- BREAKING CHANGE on multiple modules due to general polishing, improvements and bug fixes. In most cases the change is to use named exports. This affected mostly modules related with synchronization and storages. - - Updated streaming logic to use the newest version of our streaming service, including: - - Integration with Auth service V2, connecting to the new channels and applying the received connection delay. - - Implemented handling of the new MySegmentsV2 notification types (SegmentRemoval, KeyList, Bounded and Unbounded) - - New control notification for environment scoped streaming reset. -- Updated localhost mode to emit SDK_READY_FROM_CACHE event in Browser when using localStorage (Related to issue https://github.com/splitio/react-client/issues/34). -- Updated dependencies for vulnerability fixes. + - BREAKING CHANGE on multiple modules due to general polishing, improvements and bug fixes. In most cases the change is to use named exports. This affected mostly modules related with synchronization and storages. + - Updated streaming logic to use the newest version of our streaming service, including: + - Integration with Auth service V2, connecting to the new channels and applying the received connection delay. + - Implemented handling of the new MySegmentsV2 notification types (SegmentRemoval, KeyList, Bounded and Unbounded) + - New control notification for environment scoped streaming reset. + - Updated localhost mode to emit SDK_READY_FROM_CACHE event in Browser when using localStorage (Related to issue https://github.com/splitio/react-client/issues/34). + - Updated dependencies for vulnerability fixes. 0.1.0 (March 30, 2021) - Initial public release. It includes common modules to be consumed by the different Split implementations written in JavaScript. Based on the original JS SDK in the `javascript-client` repository. diff --git a/package-lock.json b/package-lock.json index 43488ed1..0cdd8424 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-commons", - "version": "1.0.1-rc.5", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b2483879..1f058127 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-commons", - "version": "1.0.1-rc.5", + "version": "1.1.0", "description": "Split Javascript SDK common components", "main": "cjs/index.js", "module": "esm/index.js", From a95573df4a2c178268c89affcfc84a663c1428b3 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 21 Dec 2021 19:11:13 -0300 Subject: [PATCH 2/4] updated README --- CHANGES.txt | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 845f2030..ad8321b2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,6 @@ 1.1.0 (December 22, 2021) - - Added support for client-side SDK instances to run in "consumer" and "partial consumer" modes, with a custom implementation of it's internal storage modules, enabling customers to implement this caching in any storage technology of choice and connect it to the SDK instance itself which will use it instead of in-memory storage. + - Added support for the SDK to run in "consumer" and "partial consumer" modes, with a pluggable implementation of it's internal storage, enabling + customers to implement this caching with any storage technology of choice and connect it to the SDK instance to use instead of its default in-memory storage. - Updated multiple modules due to general polishing and improvements. - Updated ioredis dependency for vulnerability fixes. - Bugfixing - Fixed issue returning dynamic configs if treatment name contains a dot ("."). diff --git a/README.md b/README.md index 5ebcc78a..7d6d7a13 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Split Javascript SDK common components -[![npm version](https://badge.fury.io/js/%40splitsoftware%2Fsplitio-commons.svg)](https://badge.fury.io/js/%40splitsoftware%2Fsplitio) [![Build Status](https://travis-ci.com/splitio/javascript-commons.svg?branch=main)](https://travis-ci.com/splitio/javascript-commons) +[![npm version](https://badge.fury.io/js/%40splitsoftware%2Fsplitio-commons.svg)](https://badge.fury.io/js/%40splitsoftware%2Fsplitio-commons) [![Build Status](https://github.com/splitio/javascript-commons/actions/workflows/ci.yml/badge.svg)](https://github.com/splitio/javascript-commons/actions/workflows/ci.yml) ## Overview This library 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. From 537aae859cd1aeb3bbcaeae9e93a49bcc4bf781e Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Fri, 7 Jan 2022 20:23:26 -0300 Subject: [PATCH 3/4] updated readme --- CHANGES.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ad8321b2..8ba93e81 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,16 +1,16 @@ 1.1.0 (December 22, 2021) - Added support for the SDK to run in "consumer" and "partial consumer" modes, with a pluggable implementation of it's internal storage, enabling customers to implement this caching with any storage technology of choice and connect it to the SDK instance to use instead of its default in-memory storage. - - Updated multiple modules due to general polishing and improvements. + - Updated multiple modules due to general polishing and improvements, including the replacement of default exports with named exports, to avoid runtime errors with some particular configurations of Webpack projects. - Updated ioredis dependency for vulnerability fixes. - Bugfixing - Fixed issue returning dynamic configs if treatment name contains a dot ("."). 1.0.0 (October 20, 2021) - BREAKING CHANGE on multiple modules due to general polishing, improvements and bug fixes. In most cases the change is to use named exports. This affected mostly modules related with synchronization and storages. - - Updated streaming logic to use the newest version of our streaming service, including: - - Integration with Auth service V2, connecting to the new channels and applying the received connection delay. - - Implemented handling of the new MySegmentsV2 notification types (SegmentRemoval, KeyList, Bounded and Unbounded) - - New control notification for environment scoped streaming reset. + - Updated streaming logic to use the newest version of our streaming service, including: + - Integration with Auth service V2, connecting to the new channels and applying the received connection delay. + - Implemented handling of the new MySegmentsV2 notification types (SegmentRemoval, KeyList, Bounded and Unbounded) + - New control notification for environment scoped streaming reset. - Updated localhost mode to emit SDK_READY_FROM_CACHE event in Browser when using localStorage (Related to issue https://github.com/splitio/react-client/issues/34). - Updated dependencies for vulnerability fixes. From c660e8179384394c9266e566282d0f2bdb971d5f Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Tue, 11 Jan 2022 12:25:30 -0300 Subject: [PATCH 4/4] updated release date and licence.txt --- CHANGES.txt | 4 ++-- LICENSE | 2 +- src/sdkFactory/index.ts | 4 ++-- src/sync/polling/updaters/splitChangesUpdater.ts | 7 +++++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 8ba93e81..b6952027 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,6 @@ -1.1.0 (December 22, 2021) +1.1.0 (January 11, 2022) - Added support for the SDK to run in "consumer" and "partial consumer" modes, with a pluggable implementation of it's internal storage, enabling - customers to implement this caching with any storage technology of choice and connect it to the SDK instance to use instead of its default in-memory storage. + customers to implement this caching with any storage technology of choice and connect it to the SDK instance to be used instead of its default in-memory storage. - Updated multiple modules due to general polishing and improvements, including the replacement of default exports with named exports, to avoid runtime errors with some particular configurations of Webpack projects. - Updated ioredis dependency for vulnerability fixes. - Bugfixing - Fixed issue returning dynamic configs if treatment name contains a dot ("."). diff --git a/LICENSE b/LICENSE index 18dec1b3..051b5fd9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2021 Split Software, Inc. +Copyright © 2022 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/src/sdkFactory/index.ts b/src/sdkFactory/index.ts index 5fe1f10f..61433a5e 100644 --- a/src/sdkFactory/index.ts +++ b/src/sdkFactory/index.ts @@ -43,8 +43,8 @@ export function sdkFactory(params: ISdkFactoryParams): SplitIO.ICsSDK | SplitIO. // ATM, only used by PluggableStorage mode: settings.mode, - // Callback used to emit SDK_READY in consumer mode, where `syncManagerFactory` is undefined - // or only instantiates submitters, and therefore it is not able to emit readiness events. + // Callback used to emit SDK_READY in consumer mode, where `syncManagerFactory` is undefined, + // or partial consumer mode, where it only has submitters, and therefore it doesn't emit readiness events. onReadyCb: (error) => { if (error) return; // Don't emit SDK_READY if storage failed to connect. Error message is logged by wrapperAdapter readinessManager.splits.emit(SDK_SPLITS_ARRIVED); diff --git a/src/sync/polling/updaters/splitChangesUpdater.ts b/src/sync/polling/updaters/splitChangesUpdater.ts index 754ceed9..822dbf13 100644 --- a/src/sync/polling/updaters/splitChangesUpdater.ts +++ b/src/sync/polling/updaters/splitChangesUpdater.ts @@ -168,9 +168,12 @@ export function splitChangesUpdaterFactory( return false; }); - // After triggering the requests, if we have cached splits information let's notify that. + // After triggering the requests, if we have cached splits information let's notify that to emit SDK_READY_FROM_CACHE. + // Wrapping in a promise since checkCache can be async. if (splitsEventEmitter && startingUp) { - Promise.resolve(splits.checkCache()).then(cacheReady => { if (cacheReady) splitsEventEmitter.emit(SDK_SPLITS_CACHE_LOADED); }); + Promise.resolve(splits.checkCache()).then(isCacheReady => { + if (isCacheReady) splitsEventEmitter.emit(SDK_SPLITS_CACHE_LOADED); + }); } return fetcherPromise; }