Skip to content

Commit f97f225

Browse files
authored
Merge pull request #137 from splitio/SDKS-6931
[SDKS-6931][DW] Replace splits, splitName, webConsole and apikey
2 parents 35133be + c742423 commit f97f225

11 files changed

Lines changed: 22 additions & 22 deletions

CHANGES.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
- Updated submitters logic, to avoid duplicating the post of impressions to Split cloud when the SDK is destroyed while its periodic post of impressions is running.
3131

3232
1.5.0 (June 13, 2022)
33-
- Bugfixing - Fixed issue with useTreatments hooks, to return control treatments without evaluating splits when the SDK client is not ready or is destroyed, to avoid not ready impressions and warning log.
33+
- Bugfixing - Fixed issue with useTreatments hooks, to return control treatments without evaluating feature flags when the SDK client is not ready or is destroyed, to avoid not ready impressions and warning log.
3434
- Updated @splitsoftware/splitio dependency to version 10.19.1, which includes:
3535
- Added `scheduler.telemetryRefreshRate` property to SDK configuration, and deprecated `scheduler.metricsRefreshRate` property.
3636
- Updated SDK telemetry storage, metrics and updater to be more effective and send less often.
@@ -74,15 +74,15 @@
7474
1.2.3 (February 8, 2021)
7575
- Updated React peer dependency range to include React@17.x.x.
7676
- Added `memoize-one` dependency for basic memoization utilities.
77-
- Bugfixing - Optimizing splits evaluation via memoization in order to remove `shouldComponentUpdate` method of `SplitTreatments` component and avoid stopping render propagation (issue #42).
77+
- Bugfixing - Optimizing feature flags evaluation via memoization in order to remove `shouldComponentUpdate` method of `SplitTreatments` component and avoid stopping render propagation (issue #42).
7878

7979
1.2.2 (December 15, 2020)
8080
- Updated @splitsoftware/splitio dependency to version 10.15.2.
81-
- Updated internal validation to avoid errors when passing an invalid list of split names to `SplitTreatments` component and `useTreatments` hook.
81+
- Updated internal validation to avoid errors when passing an invalid list of feature flag names to `SplitTreatments` component and `useTreatments` hook.
8282
- Updated node-fetch and init dev dependencies for vulnerability fixes
8383

8484
1.2.1 (Oct 7, 2020)
85-
- Updated @splitsoftware/splitio dependency to version 10.15.0, which uses the optimized impressions sending and supports filtering the splits to be synced. Learn more in our javascript-client changelog or documentation.
85+
- Updated @splitsoftware/splitio dependency to version 10.15.0, which uses the optimized impressions sending and supports filtering the feature flags to be synced. Learn more in our javascript-client changelog or documentation.
8686
- Updated some NPM dependencies mostly for vulnerability fixes.
8787

8888
1.2.0 (July 23, 2020)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![npm version](https://badge.fury.io/js/%40splitsoftware%2Fsplitio-react.svg)](https://badge.fury.io/js/%40splitsoftware%2Fsplitio-react) [![Build Status](https://github.com/splitio/react-client/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/splitio/react-client/actions/workflows/ci-cd.yml)
44

55
## Overview
6-
This SDK 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.
6+
This SDK is designed to work with Split, the platform for controlled rollouts, which serves features to your users via feature flag to manage your complete customer experience.
77

88
[![Twitter Follow](https://img.shields.io/twitter/follow/splitsoftware.svg?style=social&label=Follow&maxAge=1529000)](https://twitter.com/intent/follow?screen_name=splitsoftware)
99

@@ -25,7 +25,7 @@ import { SplitFactory, SplitTreatments } from '@splitsoftware/splitio-react';
2525
// Define your config object
2626
const CONFIG = {
2727
core: {
28-
authorizationKey: 'YOUR_BROWSER_API_KEY',
28+
authorizationKey: 'YOUR_BROWSER_SDK_KEY',
2929
key: 'CUSTOMER_ID'
3030
}
3131
};

src/__tests__/SplitTreatments.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('SplitTreatments', () => {
9595
});
9696

9797
/**
98-
* Input validation. Passing invalid split names or attributes while the Sdk
98+
* Input validation. Passing invalid feature flag names or attributes while the Sdk
9999
* is not ready doesn't emit errors, and logs meaningful messages instead.
100100
*/
101101
it('Input validation: invalid "names" and "attributes" props in SplitTreatments.', (done) => {
@@ -214,7 +214,7 @@ describe('SplitTreatments optimization', () => {
214214
expect(renderTimes).toBe(2);
215215
expect(outerFactory.client().getTreatmentsWithConfig).toBeCalledTimes(2);
216216

217-
// If passing same reference but mutated (bad practice), the component re-renders but doesn't re-evaluate splits
217+
// If passing same reference but mutated (bad practice), the component re-renders but doesn't re-evaluate feature flags
218218
attributesRef.att2 = 'att2_val2';
219219
wrapper.rerender(<Component names={[...names]} attributes={attributesRef} splitKey={splitKey} />);
220220
expect(renderTimes).toBe(3);

src/__tests__/testUtils/sdkConfigs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import SplitIO from '@splitsoftware/splitio/types/splitio';
22

33
export const sdkBrowser: SplitIO.IBrowserSettings = {
44
core: {
5-
authorizationKey: 'api-key',
5+
authorizationKey: 'sdk-key',
66
key: 'customer-key',
77
},
88
};

src/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export interface ISplitClientProps extends IUpdateProps {
152152
trafficType?: string;
153153

154154
/**
155-
* An object of type Attributes used to evaluate the splits.
155+
* An object of type Attributes used to evaluate the feature flags.
156156
*/
157157
attributes?: SplitIO.Attributes;
158158

@@ -168,8 +168,8 @@ export interface ISplitClientProps extends IUpdateProps {
168168
export interface ISplitTreatmentsChildProps extends ISplitContextValues {
169169

170170
/**
171-
* An object with the treatments with configs for a bulk of splits, returned by client.getTreatmentsWithConfig().
172-
* Each existing configuration is a stringified version of the JSON you defined on the Split web console. For example:
171+
* An object with the treatments with configs for a bulk of feature flags, returned by client.getTreatmentsWithConfig().
172+
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface. For example:
173173
* {
174174
* split1: { treatment: 'on', config: null }
175175
* split2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
@@ -190,7 +190,7 @@ export interface ISplitTreatmentsProps {
190190
names: string[];
191191

192192
/**
193-
* An object of type Attributes used to evaluate the splits.
193+
* An object of type Attributes used to evaluate the feature flags.
194194
*/
195195
attributes?: SplitIO.Attributes;
196196

src/useTreatments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { checkHooks, IClientWithContext } from './utils';
77
* It uses the 'useContext' hook to access the client from the Split context,
88
* and invokes the 'getTreatmentsWithConfig' method.
99
*
10-
* @return A TreatmentsWithConfig instance, that might contain control treatments if the client is not available or ready, or if split names do not exist.
10+
* @return A TreatmentsWithConfig instance, that might contain control treatments if the client is not available or ready, or if feature flag names do not exist.
1111
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#get-treatments-with-configurations}
1212
*/
1313
const useTreatments = (featureFlagNames: string[], attributes?: SplitIO.Attributes, key?: SplitIO.SplitKey): SplitIO.TreatmentsWithConfig => {

src/withSplitTreatments.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import SplitTreatments from './SplitTreatments';
88
* along with the passed props from SplitTreatments (see ISplitTreatmentsChildProps).
99
*
1010
* @param names list of feature flag names
11-
* @param attributes An object of type Attributes used to evaluate the splits.
11+
* @param attributes An object of type Attributes used to evaluate the feature flags.
1212
*/
1313
function withSplitTreatments(names: string[], attributes?: SplitIO.Attributes) {
1414

types/SplitTreatments.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { ISplitTreatmentsProps } from './types';
33
/**
4-
* SplitTreatments accepts a list of split names and optional attributes. It access the client at SplitContext to
4+
* SplitTreatments accepts a list of feature flag names and optional attributes. It access the client at SplitContext to
55
* call 'client.getTreatmentsWithConfig()' method, and passes the returned treatments to a child as a function.
66
*
77
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#get-treatments-with-configurations}

types/types.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export interface ISplitClientProps extends IUpdateProps {
125125
*/
126126
trafficType?: string;
127127
/**
128-
* An object of type Attributes used to evaluate the splits.
128+
* An object of type Attributes used to evaluate the feature flags.
129129
*/
130130
attributes?: SplitIO.Attributes;
131131
/**
@@ -138,8 +138,8 @@ export interface ISplitClientProps extends IUpdateProps {
138138
*/
139139
export interface ISplitTreatmentsChildProps extends ISplitContextValues {
140140
/**
141-
* An object with the treatments with configs for a bulk of splits, returned by client.getTreatmentsWithConfig().
142-
* Each existing configuration is a stringified version of the JSON you defined on the Split web console. For example:
141+
* An object with the treatments with configs for a bulk of feature flags, returned by client.getTreatmentsWithConfig().
142+
* Each existing configuration is a stringified version of the JSON you defined on the Split user interface. For example:
143143
* {
144144
* split1: { treatment: 'on', config: null }
145145
* split2: { treatment: 'off', config: '{"bannerText":"Click here."}' }
@@ -157,7 +157,7 @@ export interface ISplitTreatmentsProps {
157157
*/
158158
names: string[];
159159
/**
160-
* An object of type Attributes used to evaluate the splits.
160+
* An object of type Attributes used to evaluate the feature flags.
161161
*/
162162
attributes?: SplitIO.Attributes;
163163
/**

types/useTreatments.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* It uses the 'useContext' hook to access the client from the Split context,
44
* and invokes the 'getTreatmentsWithConfig' method.
55
*
6-
* @return A TreatmentsWithConfig instance, that might contain control treatments if the client is not available or ready, or if split names do not exist.
6+
* @return A TreatmentsWithConfig instance, that might contain control treatments if the client is not available or ready, or if feature flag names do not exist.
77
* @see {@link https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK#get-treatments-with-configurations}
88
*/
99
declare const useTreatments: (featureFlagNames: string[], attributes?: import("@splitsoftware/splitio/types/splitio").Attributes | undefined, key?: import("@splitsoftware/splitio/types/splitio").SplitKey | undefined) => SplitIO.TreatmentsWithConfig;

0 commit comments

Comments
 (0)