diff --git a/CHANGES.txt b/CHANGES.txt index 429ad003..b6952027 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,11 +1,18 @@ +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 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 ("."). + 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. + - 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. + - 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/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/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. diff --git a/package-lock.json b/package-lock.json index b6c2312b..0b72381e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-commons", - "version": "1.0.1-rc.6", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7a34192c..dc09153e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio-commons", - "version": "1.0.1-rc.6", + "version": "1.1.0", "description": "Split Javascript SDK common components", "main": "cjs/index.js", "module": "esm/index.js", 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; }