Skip to content

Commit

Permalink
Merge branch 'upgrade_js_sdk_v11' into tsdoc_linter
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Nov 11, 2024
2 parents edbc8c1 + 05f3f95 commit d752428
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
2.0.0 (November XX, 2024)
- Added support for targeting rules based on large segments.
- Updated @splitsoftware/splitio package to version 11.0.0 that includes major updates, and updated some transitive dependencies for vulnerability fixes.
- Updated @splitsoftware/splitio package to version 11.0.1 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:
- Removed the `core.trafficType` configuration option and made required the `trafficType` argument when calling the `track` helper function. This is because traffic types can no longer be bound to SDK clients in JavaScript SDK v11.0.0, and so the traffic type must be provided as argument in the `track` method calls.
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"homepage": "https://github.com/splitio/redux-client#readme",
"dependencies": {
"@splitsoftware/splitio": "11.0.0-rc.4",
"@splitsoftware/splitio": "11.0.1",
"tslib": "^2.3.1"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions src/asyncActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { matching, __getStatus, validateGetTreatmentsParams, isMainClient } from
export interface ISplitSdk {
config: SplitIO.IBrowserSettings | SplitIO.INodeSettings;
splitio: ISplitFactoryBuilder;
factory: SplitIO.ISDK | SplitIO.INodeSDK;
sharedClients: { [stringKey: string]: SplitIO.IClient };
factory: SplitIO.IBrowserSDK | SplitIO.ISDK;
sharedClients: { [stringKey: string]: SplitIO.IBrowserClient };
isDetached: boolean; // true: server-side, false: client-side (i.e., client with bound key)
dispatch: Dispatch<Action>;
}
Expand Down Expand Up @@ -173,7 +173,7 @@ export function getTreatments(params: IGetTreatmentsParams): Action | (() => voi
} else { // Split SDK running in Node

// Evaluate Split and return redux action.
const client = splitSdk.factory.client() as unknown as SplitIO.INodeClient;
const client = splitSdk.factory.client() as unknown as SplitIO.IClient;
const treatments = splitNames ?
client.getTreatmentsWithConfig(params.key, splitNames, params.attributes) :
client.getTreatmentsWithConfigByFlagSets(params.key, flagSets, params.attributes);
Expand All @@ -185,7 +185,7 @@ export function getTreatments(params: IGetTreatmentsParams): Action | (() => voi
/**
* Interface of SDK client for not detached execution (browser).
*/
interface IClientNotDetached extends SplitIO.IClient {
interface IClientNotDetached extends SplitIO.IBrowserClient {
_trackingStatus?: boolean;
/**
* stored evaluations to execute on SDK update. It is an object because we might
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function track(params: ITrackParams): boolean {

if (splitSdk.isDetached) { // Node
// In node, user must always provide key and TT as params
const client = splitSdk.factory.client() as SplitIO.INodeClient;
const client = splitSdk.factory.client() as SplitIO.IClient;

return client.track(key, trafficType, eventType, value, properties);
} else { // Browser
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export interface ITrackParams {
properties?: SplitIO.Properties;
}

export type ISplitFactoryBuilder = ((settings: SplitIO.IBrowserSettings) => SplitIO.ISDK) | ((settings: SplitIO.INodeSettings) => SplitIO.INodeSDK);
export type ISplitFactoryBuilder = ((settings: SplitIO.IBrowserSettings) => SplitIO.IBrowserSDK) | ((settings: SplitIO.INodeSettings) => SplitIO.ISDK);

export type ISplitAction = {
type: string;
Expand Down

0 comments on commit d752428

Please sign in to comment.