@splitsoftware/splitio
Advanced tools
Comparing version 10.28.1-rc.2 to 10.28.1-rc.3
10.29.0 (September XX, 2024) | ||
- Added `factory.destroy()` method, which invokes the `destroy` method on all SDK clients created by the factory. | ||
- Updated @splitsoftware/splitio-commons package to version 1.18.0 that includes minor updates: | ||
- Added support for targeting rules based on large segments for browsers. | ||
- Updated some transitive dependencies for vulnerability fixes. | ||
- Bugfixing - Removed an overloaded `client` method in the `SplitIO.ISDK` interface that accepted a key and trafficType parameters. This interface corresponds to the SDK factory instance in NodeJS, which, unlike `SplitIO.IBrowserSDK` for the Browser, does not handle multiple client instances based on keys or traffic types. | ||
@@ -6,0 +8,0 @@ 10.28.0 (September 6, 2024) |
@@ -11,3 +11,2 @@ import { splitApiFactory } from '@splitsoftware/splitio-commons/esm/services/splitApi'; | ||
import { integrationsManagerFactory } from '@splitsoftware/splitio-commons/esm/integrations/browser'; | ||
import { __InLocalStorageMockFactory } from '@splitsoftware/splitio-commons/esm/utils/settingsValidation/storage/storageCS'; | ||
import { sdkFactory } from '@splitsoftware/splitio-commons/esm/sdkFactory'; | ||
@@ -21,6 +20,4 @@ import { LOCALHOST_MODE, STORAGE_LOCALSTORAGE } from '@splitsoftware/splitio-commons/esm/utils/constants'; | ||
return settings.storage.type === STORAGE_LOCALSTORAGE ? | ||
InLocalStorage(settings.storage) | ||
: settings.storage.__originalType === STORAGE_LOCALSTORAGE ? | ||
__InLocalStorageMockFactory | ||
: InMemoryStorageCSFactory; | ||
InLocalStorage(settings.storage) : | ||
InMemoryStorageCSFactory; | ||
} | ||
@@ -27,0 +24,0 @@ /** |
@@ -7,2 +7,3 @@ import { splitApiFactory } from '@splitsoftware/splitio-commons/esm/services/splitApi'; | ||
import { InMemoryStorageFactory } from '@splitsoftware/splitio-commons/esm/storages/inMemory/InMemoryStorage'; | ||
import { getSnapshot } from '@splitsoftware/splitio-commons/esm/storages/dataLoader'; | ||
import { sdkManagerFactory } from '@splitsoftware/splitio-commons/esm/sdkManager'; | ||
@@ -37,3 +38,12 @@ import { sdkClientMethodFactory } from '@splitsoftware/splitio-commons/esm/sdkClient/sdkClientMethod'; | ||
impressionsObserverFactory: impressionObserverSSFactory, | ||
filterAdapterFactory: bloomFilterFactory | ||
filterAdapterFactory: bloomFilterFactory, | ||
extraProps: function (params) { | ||
if (params.settings.mode !== CONSUMER_MODE) { | ||
return { | ||
getState: function (userKeys) { | ||
return getSnapshot(params.storage, userKeys); | ||
} | ||
}; | ||
} | ||
} | ||
}; | ||
@@ -40,0 +50,0 @@ switch (settings.mode) { |
@@ -1,1 +0,1 @@ | ||
export var packageVersion = '10.28.1-rc.2'; | ||
export var packageVersion = '10.28.1-rc.3'; |
import { isLocalStorageAvailable } from '@splitsoftware/splitio-commons/esm/utils/env/isLocalStorageAvailable'; | ||
import { LOCALHOST_MODE, STORAGE_MEMORY } from '@splitsoftware/splitio-commons/esm/utils/constants'; | ||
import { STORAGE_MEMORY } from '@splitsoftware/splitio-commons/esm/utils/constants'; | ||
var STORAGE_LOCALSTORAGE = 'LOCALSTORAGE'; | ||
export function validateStorage(settings) { | ||
var log = settings.log, mode = settings.mode, _a = settings.storage, _b = _a === void 0 ? { type: STORAGE_MEMORY } : _a, type = _b.type, _c = _b.options, options = _c === void 0 ? {} : _c, prefix = _b.prefix; | ||
var __originalType; | ||
var fallbackToMemory = function () { | ||
__originalType = type; | ||
type = STORAGE_MEMORY; | ||
}; | ||
// In localhost mode, fallback to Memory storage and track original type to emit SDK_READY_FROM_CACHE if corresponds. | ||
// ATM, other mode settings (e.g., 'consumer') are ignored in client-side API, and so treated as standalone. | ||
if (mode === LOCALHOST_MODE && type === STORAGE_LOCALSTORAGE) { | ||
fallbackToMemory(); | ||
} | ||
var log = settings.log, _a = settings.storage, _b = _a === void 0 ? { type: STORAGE_MEMORY } : _a, type = _b.type, _c = _b.options, options = _c === void 0 ? {} : _c, prefix = _b.prefix; | ||
// If an invalid storage type is provided OR we want to use LOCALSTORAGE and | ||
@@ -20,3 +10,3 @@ // it's not available, fallback into MEMORY | ||
type === STORAGE_LOCALSTORAGE && !isLocalStorageAvailable()) { | ||
fallbackToMemory(); | ||
type = STORAGE_MEMORY; | ||
log.error('Invalid or unavailable storage. Fallback into MEMORY storage'); | ||
@@ -28,4 +18,3 @@ } | ||
prefix: prefix, | ||
__originalType: __originalType | ||
}; | ||
} |
@@ -14,3 +14,2 @@ "use strict"; | ||
var browser_1 = require("@splitsoftware/splitio-commons/cjs/integrations/browser"); | ||
var storageCS_1 = require("@splitsoftware/splitio-commons/cjs/utils/settingsValidation/storage/storageCS"); | ||
var sdkFactory_1 = require("@splitsoftware/splitio-commons/cjs/sdkFactory"); | ||
@@ -24,6 +23,4 @@ var constants_1 = require("@splitsoftware/splitio-commons/cjs/utils/constants"); | ||
return settings.storage.type === constants_1.STORAGE_LOCALSTORAGE ? | ||
(0, inLocalStorage_1.InLocalStorage)(settings.storage) | ||
: settings.storage.__originalType === constants_1.STORAGE_LOCALSTORAGE ? | ||
storageCS_1.__InLocalStorageMockFactory | ||
: InMemoryStorageCS_1.InMemoryStorageCSFactory; | ||
(0, inLocalStorage_1.InLocalStorage)(settings.storage) : | ||
InMemoryStorageCS_1.InMemoryStorageCSFactory; | ||
} | ||
@@ -30,0 +27,0 @@ /** |
@@ -10,2 +10,3 @@ "use strict"; | ||
var InMemoryStorage_1 = require("@splitsoftware/splitio-commons/cjs/storages/inMemory/InMemoryStorage"); | ||
var dataLoader_1 = require("@splitsoftware/splitio-commons/cjs/storages/dataLoader"); | ||
var sdkManager_1 = require("@splitsoftware/splitio-commons/cjs/sdkManager"); | ||
@@ -40,3 +41,12 @@ var sdkClientMethod_1 = require("@splitsoftware/splitio-commons/cjs/sdkClient/sdkClientMethod"); | ||
impressionsObserverFactory: impressionObserverSS_1.impressionObserverSSFactory, | ||
filterAdapterFactory: bloomFilter_1.bloomFilterFactory | ||
filterAdapterFactory: bloomFilter_1.bloomFilterFactory, | ||
extraProps: function (params) { | ||
if (params.settings.mode !== constants_1.CONSUMER_MODE) { | ||
return { | ||
getState: function (userKeys) { | ||
return (0, dataLoader_1.getSnapshot)(params.storage, userKeys); | ||
} | ||
}; | ||
} | ||
} | ||
}; | ||
@@ -43,0 +53,0 @@ switch (settings.mode) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.packageVersion = void 0; | ||
exports.packageVersion = '10.28.1-rc.2'; | ||
exports.packageVersion = '10.28.1-rc.3'; |
@@ -8,13 +8,3 @@ "use strict"; | ||
function validateStorage(settings) { | ||
var log = settings.log, mode = settings.mode, _a = settings.storage, _b = _a === void 0 ? { type: constants_1.STORAGE_MEMORY } : _a, type = _b.type, _c = _b.options, options = _c === void 0 ? {} : _c, prefix = _b.prefix; | ||
var __originalType; | ||
var fallbackToMemory = function () { | ||
__originalType = type; | ||
type = constants_1.STORAGE_MEMORY; | ||
}; | ||
// In localhost mode, fallback to Memory storage and track original type to emit SDK_READY_FROM_CACHE if corresponds. | ||
// ATM, other mode settings (e.g., 'consumer') are ignored in client-side API, and so treated as standalone. | ||
if (mode === constants_1.LOCALHOST_MODE && type === STORAGE_LOCALSTORAGE) { | ||
fallbackToMemory(); | ||
} | ||
var log = settings.log, _a = settings.storage, _b = _a === void 0 ? { type: constants_1.STORAGE_MEMORY } : _a, type = _b.type, _c = _b.options, options = _c === void 0 ? {} : _c, prefix = _b.prefix; | ||
// If an invalid storage type is provided OR we want to use LOCALSTORAGE and | ||
@@ -24,3 +14,3 @@ // it's not available, fallback into MEMORY | ||
type === STORAGE_LOCALSTORAGE && !(0, isLocalStorageAvailable_1.isLocalStorageAvailable)()) { | ||
fallbackToMemory(); | ||
type = constants_1.STORAGE_MEMORY; | ||
log.error('Invalid or unavailable storage. Fallback into MEMORY storage'); | ||
@@ -32,5 +22,4 @@ } | ||
prefix: prefix, | ||
__originalType: __originalType | ||
}; | ||
} | ||
exports.validateStorage = validateStorage; |
{ | ||
"name": "@splitsoftware/splitio", | ||
"version": "10.28.1-rc.2", | ||
"version": "10.28.1-rc.3", | ||
"description": "Split SDK", | ||
@@ -43,3 +43,3 @@ "files": [ | ||
"dependencies": { | ||
"@splitsoftware/splitio-commons": "1.17.1-rc.1", | ||
"@splitsoftware/splitio-commons": "1.17.1-rc.2", | ||
"@types/google.analytics": "0.0.40", | ||
@@ -46,0 +46,0 @@ "@types/ioredis": "^4.28.0", |
@@ -11,3 +11,2 @@ import { splitApiFactory } from '@splitsoftware/splitio-commons/src/services/splitApi'; | ||
import { integrationsManagerFactory } from '@splitsoftware/splitio-commons/src/integrations/browser'; | ||
import { __InLocalStorageMockFactory } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/storage/storageCS'; | ||
import { sdkFactory } from '@splitsoftware/splitio-commons/src/sdkFactory'; | ||
@@ -24,6 +23,4 @@ import { LOCALHOST_MODE, STORAGE_LOCALSTORAGE } from '@splitsoftware/splitio-commons/src/utils/constants'; | ||
return settings.storage.type === STORAGE_LOCALSTORAGE ? | ||
InLocalStorage(settings.storage) | ||
: settings.storage.__originalType === STORAGE_LOCALSTORAGE ? | ||
__InLocalStorageMockFactory | ||
: InMemoryStorageCSFactory; | ||
InLocalStorage(settings.storage) : | ||
InMemoryStorageCSFactory; | ||
} | ||
@@ -30,0 +27,0 @@ |
@@ -7,2 +7,3 @@ import { splitApiFactory } from '@splitsoftware/splitio-commons/src/services/splitApi'; | ||
import { InMemoryStorageFactory } from '@splitsoftware/splitio-commons/src/storages/inMemory/InMemoryStorage'; | ||
import { getSnapshot } from '@splitsoftware/splitio-commons/src/storages/dataLoader'; | ||
import { sdkManagerFactory } from '@splitsoftware/splitio-commons/src/sdkManager'; | ||
@@ -51,3 +52,13 @@ import { sdkClientMethodFactory } from '@splitsoftware/splitio-commons/src/sdkClient/sdkClientMethod'; | ||
filterAdapterFactory: bloomFilterFactory | ||
filterAdapterFactory: bloomFilterFactory, | ||
extraProps: (params) => { | ||
if (params.settings.mode !== CONSUMER_MODE) { | ||
return { | ||
getState(userKeys) { | ||
return getSnapshot(params.storage, userKeys); | ||
} | ||
}; | ||
} | ||
} | ||
}; | ||
@@ -54,0 +65,0 @@ |
@@ -1,1 +0,1 @@ | ||
export const packageVersion = '10.28.1-rc.2'; | ||
export const packageVersion = '10.28.1-rc.3'; |
import { isLocalStorageAvailable } from '@splitsoftware/splitio-commons/src/utils/env/isLocalStorageAvailable'; | ||
import { LOCALHOST_MODE, STORAGE_MEMORY } from '@splitsoftware/splitio-commons/src/utils/constants'; | ||
import { STORAGE_MEMORY } from '@splitsoftware/splitio-commons/src/utils/constants'; | ||
@@ -9,3 +9,2 @@ const STORAGE_LOCALSTORAGE = 'LOCALSTORAGE'; | ||
log, | ||
mode, | ||
storage: { | ||
@@ -17,15 +16,3 @@ type, | ||
} = settings; | ||
let __originalType; | ||
const fallbackToMemory = () => { | ||
__originalType = type; | ||
type = STORAGE_MEMORY; | ||
}; | ||
// In localhost mode, fallback to Memory storage and track original type to emit SDK_READY_FROM_CACHE if corresponds. | ||
// ATM, other mode settings (e.g., 'consumer') are ignored in client-side API, and so treated as standalone. | ||
if (mode === LOCALHOST_MODE && type === STORAGE_LOCALSTORAGE) { | ||
fallbackToMemory(); | ||
} | ||
// If an invalid storage type is provided OR we want to use LOCALSTORAGE and | ||
@@ -35,3 +22,3 @@ // it's not available, fallback into MEMORY | ||
type === STORAGE_LOCALSTORAGE && !isLocalStorageAvailable()) { | ||
fallbackToMemory(); | ||
type = STORAGE_MEMORY; | ||
log.error('Invalid or unavailable storage. Fallback into MEMORY storage'); | ||
@@ -44,4 +31,3 @@ } | ||
prefix, | ||
__originalType | ||
}; | ||
} |
Sorry, the diff of this file is too big to display
340466
6661
+ Added@splitsoftware/splitio-commons@1.17.1-rc.2(transitive)
- Removed@splitsoftware/splitio-commons@1.17.1-rc.1(transitive)