Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes #360

Open
wants to merge 18 commits into
base: SDKS-8407_baseline
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7b6e433
Removed the deprecated GOOGLE_ANALYTICS_TO_SPLIT and SPLIT_TO_GOOGLE_…
EmilianoSanchez Oct 4, 2024
bb9a458
Update objectAssign polyfill to reduce code size
EmilianoSanchez Oct 7, 2024
9d97256
Update compat linter: 'defaults, ie 10, node 6' -> 'defaults, node 14'
EmilianoSanchez Oct 7, 2024
f82c7c6
Removed Map and Set polyfills
EmilianoSanchez Oct 7, 2024
781e72a
Simplify set utils and add CHANGELOG entry
EmilianoSanchez Oct 7, 2024
e1a49f5
Removed eslint-disable-next-line compat/compat
EmilianoSanchez Oct 8, 2024
4c979f7
Removed the migration logic for the old format of MySegments keys in …
EmilianoSanchez Oct 8, 2024
66210e6
Removed the function, which handled the logic to bound an optional t…
EmilianoSanchez Oct 8, 2024
9af5a94
Update changelog entry
EmilianoSanchez Oct 8, 2024
464102f
rc
EmilianoSanchez Oct 8, 2024
c7a2002
Adding setToArray util to avoid depending on Array.from
EmilianoSanchez Oct 9, 2024
2459b10
Merge branch 'breaking_changes_update_supported_runtimes' into breaki…
EmilianoSanchez Oct 18, 2024
2950ee6
Merge pull request #359 from splitio/breaking_changes_remove_deprecat…
EmilianoSanchez Oct 18, 2024
b875d03
Merge pull request #357 from splitio/breaking_changes_update_supporte…
EmilianoSanchez Oct 18, 2024
2cbfe21
Merge pull request #356 from splitio/breaking_changes
EmilianoSanchez Oct 18, 2024
e954789
Merge branch 'SDKS-8407_baseline' into breaking_changes_baseline
EmilianoSanchez Oct 18, 2024
18b3243
rc
EmilianoSanchez Oct 18, 2024
e79229a
Merge branch 'SDKS-8407_baseline' into breaking_changes_baseline
EmilianoSanchez Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"message": "Don't declare const enum, because it is not supported by Babel used for building RN SDK"
}
],
"compat/compat": ["error", "defaults, ie 10, node 6"],
"compat/compat": ["error", "defaults, node >=14"],
"no-throw-literal": "error",
"import/no-default-export": "error",
"import/no-self-import": "error"
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- Updated default flag spec version to 1.2.
- Removed `/mySegments` endpoint from SplitAPI module, as it is replaced by `/memberships` endpoint.
- Removed support for MY_SEGMENTS_UPDATE and MY_SEGMENTS_UPDATE_V2 notification types, as they are replaced by MEMBERSHIPS_MS_UPDATE and MEMBERSHIPS_LS_UPDATE notification types.
- Removed the deprecated `GOOGLE_ANALYTICS_TO_SPLIT` and `SPLIT_TO_GOOGLE_ANALYTICS` integrations.
- Removed the migration logic for the old format of MySegments keys in LocalStorage introduced in JavaScript SDK v10.17.3.
- Removed the `sdkClientMethodCSWithTT` function, which handled the logic to bound an optional traffic type to SDK clients. Client-side SDK implementations must use `sdkClientMethodCS` module, which, unlike the previous function, does not allow passing a traffic type but simplifies the SDK API.
- Removed internal ponyfills for `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 to provide a polyfill.

1.17.0 (September 6, 2024)
- Added `sync.requestOptions.getHeaderOverrides` configuration option to enhance SDK HTTP request Headers for Authorization Frameworks.
Expand Down
198 changes: 106 additions & 92 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio-commons",
"version": "1.17.1-rc.4",
"version": "2.0.0-rc.1",
"description": "Split JavaScript SDK common components",
"main": "cjs/index.js",
"module": "esm/index.js",
Expand Down Expand Up @@ -64,7 +64,7 @@
"@typescript-eslint/parser": "^6.6.0",
"cross-env": "^7.0.2",
"eslint": "^8.48.0",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-compat": "^6.0.1",
"eslint-plugin-import": "^2.25.3",
"fetch-mock": "^9.11.0",
"ioredis": "^4.28.0",
Expand Down
2 changes: 1 addition & 1 deletion src/evaluator/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class Engine {

constructor(private baseInfo: ISplit, private evaluator: IEvaluator) {

// in case we don't have a default treatment in the instanciation, use 'control'
// in case we don't have a default treatment in the instantiation, use 'control'
if (typeof this.baseInfo.defaultTreatment !== 'string') {
this.baseInfo.defaultTreatment = CONTROL;
}
Expand Down
9 changes: 4 additions & 5 deletions src/evaluator/__tests__/evaluate-features.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { evaluateFeatures, evaluateFeaturesByFlagSets } from '../index';
import { EXCEPTION, NOT_IN_SPLIT, SPLIT_ARCHIVED, SPLIT_KILLED, SPLIT_NOT_FOUND } from '../../utils/labels';
import { loggerMock } from '../../logger/__tests__/sdkLogger.mock';
import { _Set } from '../../utils/lang/sets';
import { WARN_FLAGSET_WITHOUT_FLAGS } from '../../logger/constants';

const splitsMock = {
Expand All @@ -17,8 +16,8 @@ const splitsMock = {
};

const flagSetsMock = {
reg_and_config: new _Set(['regular', 'config']),
arch_and_killed: new _Set(['killed', 'archived']),
reg_and_config: new Set(['regular', 'config']),
arch_and_killed: new Set(['killed', 'archived']),
};

const mockStorage = {
Expand All @@ -38,7 +37,7 @@ const mockStorage = {
return splits;
},
getNamesByFlagSets(flagSets) {
return flagSets.map(flagset => flagSetsMock[flagset] || new _Set());
return flagSets.map(flagset => flagSetsMock[flagset] || new Set());
}
}
};
Expand Down Expand Up @@ -192,7 +191,7 @@ describe('EVALUATOR - Multiple evaluations at once by flag sets', () => {
// Should support async storage too
expect(await getResultsByFlagsets(['inexistent_set1', 'inexistent_set2'], {
splits: {
getNamesByFlagSets(flagSets) { return Promise.resolve(flagSets.map(flagset => flagSetsMock[flagset] || new _Set())); }
getNamesByFlagSets(flagSets) { return Promise.resolve(flagSets.map(flagset => flagSetsMock[flagset] || new Set())); }
}
})).toEqual({});
expect(loggerMock.warn.mock.calls).toEqual([
Expand Down
8 changes: 4 additions & 4 deletions src/evaluator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IStorageAsync, IStorageSync } from '../storages/types';
import { IEvaluationResult } from './types';
import { SplitIO } from '../types';
import { ILogger } from '../logger/types';
import { ISet, setToArray, returnSetsUnion, _Set } from '../utils/lang/sets';
import { returnSetsUnion, setToArray } from '../utils/lang/sets';
import { WARN_FLAGSET_WITHOUT_FLAGS } from '../logger/constants';

const treatmentException = {
Expand Down Expand Up @@ -97,12 +97,12 @@ export function evaluateFeaturesByFlagSets(
storage: IStorageSync | IStorageAsync,
method: string,
): MaybeThenable<Record<string, IEvaluationResult>> {
let storedFlagNames: MaybeThenable<ISet<string>[]>;
let storedFlagNames: MaybeThenable<Set<string>[]>;

function evaluate(
featureFlagsByFlagSets: ISet<string>[],
featureFlagsByFlagSets: Set<string>[],
) {
let featureFlags = new _Set();
let featureFlags = new Set<string>();
for (let i = 0; i < flagSets.length; i++) {
const featureFlagByFlagSet = featureFlagsByFlagSets[i];
if (featureFlagByFlagSet.size) {
Expand Down
3 changes: 1 addition & 2 deletions src/evaluator/matchers/semver_inlist.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { _Set } from '../../utils/lang/sets';
import { Semver } from '../../utils/Semver';

export function inListSemverMatcherContext(ruleAttr: string[]) {
// @TODO ruleAttr validation should be done at the `parser` or `matchersTransform` level to reuse for all matchers
if (!ruleAttr || ruleAttr.length === 0) throw new Error('whitelistMatcherData is required for IN_LIST_SEMVER matcher type');

const listOfSemvers = new _Set(ruleAttr.map((version) => new Semver(version).version));
const listOfSemvers = new Set(ruleAttr.map((version) => new Semver(version).version));

return function inListSemverMatcher(runtimeAttr: string): boolean {
const runtimeSemver = new Semver(runtimeAttr).version;
Expand Down
4 changes: 1 addition & 3 deletions src/evaluator/matchers/whitelist.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { _Set } from '../../utils/lang/sets';

export function whitelistMatcherContext(ruleAttr: string[]) {
const whitelistSet = new _Set(ruleAttr);
const whitelistSet = new Set(ruleAttr);

return function whitelistMatcher(runtimeAttr: string): boolean {
const isInWhitelist = whitelistSet.has(runtimeAttr);
Expand Down
98 changes: 0 additions & 98 deletions src/integrations/__tests__/browser.spec.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/integrations/browser.ts

This file was deleted.

Loading
Loading