Skip to content

Commit 06df6d7

Browse files
Merge pull request #175 from splitio/development
Release v1.10.2
2 parents 3546050 + 3644c4e commit 06df6d7

File tree

5 files changed

+56
-27
lines changed

5 files changed

+56
-27
lines changed

CHANGES.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
1.10.2 (December 12, 2023)
2+
- Updated @splitsoftware/splitio package to version 10.24.1 that updates localStorage usage to clear cached feature flag definitions before initiating the synchronization process, if the cache was previously synchronized with a different SDK key (i.e., a different environment) or different Split Filter criteria, to avoid using invalid cached data when the SDK is ready from cache.
3+
14
1.10.1 (November 21, 2023)
2-
- Bugfixing - Resolved an issue with `useSplitClient` hook, which was not re-rendering when an SDK client event was emitted between the hook's call (render phase) and the execution of its internal effect (commit phase).
5+
- Bugfixing - Resolved an issue with `useSplitClient` hook and `SplitClient` component, that were not re-rendering when an SDK client event was emitted between the render and the commit phases of component lifecycle.
36

47
1.10.0 (November 16, 2023)
58
- Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation):

package-lock.json

Lines changed: 23 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-react",
3-
"version": "1.10.1",
3+
"version": "1.10.2",
44
"description": "A React library to easily integrate and use Split JS SDK",
55
"main": "lib/index.js",
66
"module": "es/index.js",
@@ -62,7 +62,7 @@
6262
},
6363
"homepage": "https://github.com/splitio/react-client#readme",
6464
"dependencies": {
65-
"@splitsoftware/splitio": "10.24.0-beta",
65+
"@splitsoftware/splitio": "10.24.1",
6666
"memoize-one": "^5.1.1",
6767
"shallowequal": "^1.1.0"
6868
},

src/__tests__/SplitClient.test.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ describe('SplitClient', () => {
4747

4848
render(
4949
<SplitFactory factory={outerFactory} >
50+
{/* Equivalent to <SplitClient splitKey={undefined} > */}
5051
<SplitClient splitKey={sdkBrowser.core.key} >
5152
{({ client, isReady, isReadyFromCache, hasTimedout, isTimedout, isDestroyed, lastUpdate }: ISplitClientChildProps) => {
5253
expect(client).toBe(outerFactory.client());
@@ -201,6 +202,31 @@ describe('SplitClient', () => {
201202
expect(renderTimes).toBe(2);
202203
});
203204

205+
test('must update on SDK events between the render and commit phases', () => {
206+
const outerFactory = SplitSdk(sdkBrowser);
207+
let count = 0;
208+
209+
render(
210+
<SplitFactory factory={outerFactory} >
211+
<SplitClient splitKey='some_user' >
212+
{({ client }) => {
213+
count++;
214+
215+
// side effect in the render phase
216+
if (!(client as any).__getStatus().isReady) {
217+
console.log('emit');
218+
(client as any).__emitter__.emit(Event.SDK_READY);
219+
}
220+
221+
return null;
222+
}}
223+
</SplitClient>
224+
</SplitFactory>
225+
);
226+
227+
expect(count).toEqual(2);
228+
});
229+
204230
test('renders a passed JSX.Element with a new SplitContext value.', (done) => {
205231
const outerFactory = SplitSdk(sdkBrowser);
206232

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ export type {
3636
ISplitTreatmentsProps,
3737
IUpdateProps,
3838
IUseSplitClientOptions,
39-
IUseSplitTreatmentsOptions,
39+
IUseSplitTreatmentsOptions
4040
} from './types';

0 commit comments

Comments
 (0)