Skip to content

Commit

Permalink
Merge branch 'breaking_changes' into refactor_storage_emits_ready_fro…
Browse files Browse the repository at this point in the history
…m_cache
  • Loading branch information
EmilianoSanchez committed Oct 18, 2024
2 parents 5a2e6d0 + a3230a2 commit a7bcd48
Show file tree
Hide file tree
Showing 31 changed files with 224 additions and 1,654 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ dump.rdb
/stats

## transpiled code
/lib
/es
/cjs
/esm
/umd

## TS tests compilated files
Expand Down
21 changes: 14 additions & 7 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
10.29.0 (October 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.
11.0.0 (October XX, 2024)
- Added support for targeting rules based on large segments for browsers.
- Added `factory.destroy()` method, which invokes the `destroy` method of all clients created by the factory.
- Updated @splitsoftware/splitio-commons package to version 2.0.0 that includes major updates and updated some transitive dependencies for vulnerability fixes.
- Renamed distribution folders from `/lib` to `/cjs` for CommonJS build, and `/es` to `/esm` for EcmaScript Modules build.
- BREAKING CHANGES:
- Dropped support for NodeJS v6. The SDK now requires NodeJS v14 or above.
- Removed internal ponyfills for the `Map` and `Set` global objects, dropping support for IE and other outdated browsers. The SDK now requires the runtime environment to support these features natively or provide a polyfill.
- Removed the deprecated `GOOGLE_ANALYTICS_TO_SPLIT` and `SPLIT_TO_GOOGLE_ANALYTICS` integrations. The `integrations` configuration option has been removed from the SDK factory configuration, along with the associated interfaces in the TypeScript definitions.
- Removed the `core.trafficType` configuration option (`SplitIO.IBrowserSettings['core']['trafficType]`) and the `trafficType` parameter from the SDK `client()` method in Browser (`SplitIO.IBrowserSDK['client']`). As a result, traffic types can no longer be bound to SDK clients, and the traffic type must be provided in the `track` method.
- TypeScript definitions:
- Removed an overloaded `client` method in the `SplitIO.ISDK` interface that accepted `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.
- Updated the `SplitIO.IBrowserSDK` and `SplitIO.IBrowserClient` interfaces to no longer extend the `SplitIO.ISDK` and `SplitIO.IClient` interfaces respectively, as the SDK factory instance in NodeJS or server-side (`SplitIO.ISDK`) has a different API than the SDK client instance in the Browser or client-side (`SplitIO.IBrowserClient`).

10.28.0 (September 6, 2024)
- Updated @splitsoftware/splitio-commons package to version 1.17.0 that includes minor updates:
Expand Down Expand Up @@ -514,7 +521,7 @@
- Bugfixing - Return correct label when consulted Split is not found.

9.1.1 (May 03, 2017)
- Bugfixing - Fixed invalid behaviour when using native Fetch API and comparing statusText
- Bugfixing - Fixed invalid behavior when using native Fetch API and comparing statusText
instead of resp.ok

9.1.0 (April 21, 2017)
Expand Down
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"main": "../lib/factory/browser.js",
"module": "../es/factory/browser.js",
"main": "../cjs/factory/browser.js",
"module": "../esm/factory/browser.js",
"types": "../types/client/index.d.ts"
}
20 changes: 0 additions & 20 deletions karma/e2e.gaIntegration.karma.conf.js

This file was deleted.

48 changes: 18 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 10 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
{
"name": "@splitsoftware/splitio",
"version": "10.28.1-rc.4",
"version": "11.0.0-rc.1",
"description": "Split SDK",
"files": [
"README.md",
"CONTRIBUTORS-GUIDE.md",
"LICENSE",
"CHANGES.txt",
"lib",
"cjs",
"types",
"es",
"esm",
"src",
"scripts/ga-to-split-autorequire.js",
"client",
"server"
],
Expand All @@ -32,16 +31,14 @@
"sdk",
"javascript"
],
"main": "lib/index.js",
"module": "es/index.js",
"main": "cjs/index.js",
"module": "esm/index.js",
"types": "types",
"engines": {
"npm": ">=3",
"node": ">=6"
"node": ">=14.0.0"
},
"dependencies": {
"@splitsoftware/splitio-commons": "1.17.1-rc.4",
"@types/google.analytics": "0.0.40",
"@splitsoftware/splitio-commons": "2.0.0-rc.1",
"@types/ioredis": "^4.28.0",
"bloom-filters": "^3.0.0",
"ioredis": "^4.28.0",
Expand Down Expand Up @@ -84,14 +81,13 @@
"webpack-merge": "^5.8.0"
},
"scripts": {
"build-esm": "rimraf es && tsc -outDir es",
"postbuild-esm": "cross-env NODE_ENV=es node scripts/copy.packages.json.js && ./scripts/build_esm_replace_imports.sh",
"build-esm": "rimraf esm && tsc -outDir esm",
"postbuild-esm": "cross-env NODE_ENV=esm node scripts/copy.packages.json.js && ./scripts/build_esm_replace_imports.sh",
"build-umd:stats": "webpack --progress --env production --json > ./stats/stat_results.json",
"build-cjs": "rimraf lib && tsc -outDir lib -m CommonJS",
"build-cjs": "rimraf cjs && tsc -outDir cjs -m CommonJS",
"postbuild-cjs": "cross-env NODE_ENV=cjs node scripts/copy.packages.json.js && ./scripts/build_cjs_replace_imports.sh",
"build-umd": "rimraf umd && webpack --config webpack.dev.js --env branch=$BUILD_BRANCH && webpack --config webpack.prod.js --env branch=$BUILD_BRANCH && ./scripts/clean_umd_build.sh",
"build:npm": "npm run build-cjs && npm run build-esm",
"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",
"build": "npm run build-cjs && npm run build-esm && npm run build-umd",
"check": "npm run check:lint && npm run check:version",
"check:lint": "eslint src",
Expand All @@ -104,7 +100,6 @@
"test-browser-e2e-destroy": "cross-env NODE_ENV=test karma start karma/e2e.destroy.karma.conf.js",
"test-browser-e2e-errorCatching": "cross-env NODE_ENV=test karma start karma/e2e.errorCatching.karma.conf.js",
"test-browser-e2e-push": "cross-env NODE_ENV=test karma start karma/e2e.push.karma.conf.js",
"test-browser-e2e-gaIntegration": "cross-env NODE_ENV=test karma start karma/e2e.gaIntegration.karma.conf.js",
"test-node": "npm run test-node-unit && npm run test-node-e2e",
"test-node-unit": "cross-env NODE_ENV=test tape -r ./ts-node.register \"src/*/**/__tests__/**/!(browser).spec.js\" | tap-min",
"test-node-e2e": "npm run test-node-e2e-online && npm run test-node-e2e-offline && npm run test-node-e2e-destroy && npm run test-node-e2e-errorCatching && npm run test-node-e2e-push && npm run test-node-e2e-redis",
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_cjs_replace_imports.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# replace splitio-commons imports to use ES modules
replace '@splitsoftware/splitio-commons/src' '@splitsoftware/splitio-commons/cjs' ./lib -r
# replace splitio-commons imports to use CommonJS
replace '@splitsoftware/splitio-commons/src' '@splitsoftware/splitio-commons/cjs' ./cjs -r

if [ $? -eq 0 ]
then
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_esm_replace_imports.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# replace splitio-commons imports to use ES modules
replace '@splitsoftware/splitio-commons/src' '@splitsoftware/splitio-commons/esm' ./es -r
# replace splitio-commons imports to use EcmaScript Modules
replace '@splitsoftware/splitio-commons/src' '@splitsoftware/splitio-commons/esm' ./esm -r

if [ $? -eq 0 ]
then
Expand Down
4 changes: 2 additions & 2 deletions scripts/copy.packages.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const copyfiles = require('copyfiles');

const input = './src/**/package.json';
const outputCjsDir = './lib';
const outputEsmDir = './es';
const outputCjsDir = './cjs';
const outputEsmDir = './esm';

copyfiles([input, process.env.NODE_ENV === 'cjs' ? outputCjsDir : outputEsmDir], {
up: 1,
Expand Down
1 change: 0 additions & 1 deletion scripts/ga-to-split-autorequire.js

This file was deleted.

4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"main": "../lib/factory/node.js",
"module": "../es/factory/node.js",
"main": "../cjs/factory/node.js",
"module": "../esm/factory/node.js",
"types": "../types/server/index.d.ts"
}
2 changes: 1 addition & 1 deletion src/__tests__/browserSuites/telemetry.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default async function telemetryBrowserSuite(fetchMock, t) {
oM: 0, st: 'memory', aF: 1, rF: 0, sE: false,
rR: { sp: 99999, ms: 60, im: 300, ev: 60, te: 1 } /* override featuresRefreshRate */,
uO: { s: true, e: true, a: false, st: false, t: true } /* override sdk, events and telemetry URLs */,
iQ: 30000, eQ: 500, iM: 0, iL: false, hP: false, nR: 1 /* 1 non ready usage */, t: [], i: [], uC: 2 /* Default GRANTED */,
iQ: 30000, eQ: 500, iM: 0, iL: false, hP: false, nR: 1 /* 1 non ready usage */, t: [], uC: 2 /* Default GRANTED */,
fsT: 0, fsI: 0
}, 'metrics/config JSON payload should be the expected');

Expand Down
10 changes: 5 additions & 5 deletions src/__tests__/browserSuites/user-consent.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function mockSubmittersRequests(fetchMock, assert, impressionFeature, eventTypeI

export default function userConsent(fetchMock, t) {

// Validate trackers, submitters and browser listener behaviour on different consent status transitions
// Validate trackers, submitters and browser listener behavior on different consent status transitions
t.test(async (assert) => {
const sendBeaconSpy = sinon.spy(window.navigator, 'sendBeacon');
let expectedTrackedImpressions = 0;
Expand All @@ -97,7 +97,7 @@ export default function userConsent(fetchMock, t) {
], ['on', 'on', 'on', 'on', 'on', 'on', 'on', 'on'], 'evaluating on SDK ready');
if (isTracking) expectedTrackedImpressions += 8;

// Trigger pagehide event to validate browser listener behaviour
// Trigger pagehide event to validate browser listener behavior
// Beacon API is used only if user consent is GRANTED
triggerPagehideEvent();
if (factory.UserConsent.getStatus() === factory.UserConsent.Status.GRANTED) {
Expand Down Expand Up @@ -137,9 +137,9 @@ export default function userConsent(fetchMock, t) {
assert.equal(trackedImpressions.length, expectedTrackedImpressions, 'Tracked impressions are the expected');
sendBeaconSpy.restore();
assert.end();
}, 'Validate trackers, submitters and browser listener behaviour on different consent status transitions');
}, 'Validate trackers, submitters and browser listener behavior on different consent status transitions');

// Validate submitter's behaviour with full queues and with events first push window
// Validate submitter's behavior with full queues and with events first push window
t.test(async (assert) => {
const config = {
...baseConfig,
Expand Down Expand Up @@ -182,6 +182,6 @@ export default function userConsent(fetchMock, t) {
await client.destroy();

assert.end();
}, 'Validate submitter\'s behaviour with full queues and with events first push window');
}, 'Validate submitter\'s behavior with full queues and with events first push window');

}
Loading

0 comments on commit a7bcd48

Please sign in to comment.