Skip to content

Commit 8af925c

Browse files
Update comments and CHANGES file
1 parent d50d900 commit 8af925c

File tree

6 files changed

+24
-21
lines changed

6 files changed

+24
-21
lines changed

CHANGES.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
1.11.0 (January 15, 2023)
2-
- Added new `SplitFactoryProvider` component as replacement for the now deprecated `SplitFactory` component.
3-
This new component is a fixed version of the `SplitFactory` component, which is not handling the SDK initialization side-effects in the `componentDidMount` and `componentDidUpdate` methods (commit phase), causing some issues like the SDK not being reinitialized when component props change (Related to issue #11 and #148).
4-
The new component also supports server-side rendering. See our documentation for more details: https://help.split.io/hc/en-us/articles/360038825091-React-SDK#server-side-rendering (Related to issue #11 and #109).
1+
1.11.0 (January 16, 2023)
2+
- Added the new `SplitFactoryProvider` component as a replacement for the now deprecated `SplitFactory` component.
3+
The new component is a revised version of `SplitFactory`, addressing improper handling of the SDK initialization side-effects in the `componentDidMount` and `componentDidUpdate` methods (commit phase), causing some issues like memory leaks and the SDK not reinitializing when component props change (Related to issue #11 and #148).
4+
The `SplitFactoryProvider` component can be used as a drop-in replacement for `SplitFactory`. It utilizes the React Hooks API, that requires React 16.8.0 or later, and supports server-side rendering. See our documentation for more details (Related to issue #11 and #109).
55
- Updated internal code to remove a circular dependency and avoid warning messages with tools like PNPM (Related to issue #176).
6+
- Updated @splitsoftware/splitio package to version 10.25.1 for vulnerability fixes.
67

78
1.10.2 (December 12, 2023)
89
- 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.

package-lock.json

Lines changed: 9 additions & 9 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.3-rc.3",
3+
"version": "1.10.3-rc.4",
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.25.1-rc.0",
65+
"@splitsoftware/splitio": "10.25.1",
6666
"memoize-one": "^5.1.1",
6767
"shallowequal": "^1.1.0"
6868
},

src/SplitFactory.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import { DEFAULT_UPDATE_OPTIONS } from './useSplitClient';
99
/**
1010
* SplitFactory will initialize the Split SDK and its main client, listen for its events in order to update the Split Context,
1111
* and automatically shutdown and release resources when it is unmounted. SplitFactory must wrap other components and functions
12-
* from this library, since they access the Split Context and its elements (factory, clients, etc).
12+
* from this library, since they access the Split Context and its properties (factory, client, isReady, etc).
1313
*
1414
* The underlying SDK factory and client is set on the constructor, and cannot be changed during the component lifecycle,
1515
* even if the component is updated with a different config or factory prop.
1616
*
1717
* @deprecated Replace with the new `SplitFactoryProvider` component.
1818
* `SplitFactoryProvider` is a drop-in replacement that properly handles side effects (factory creation and destruction) within the React component lifecycle, avoiding issues with factory recreation and memory leaks.
19-
* Note: There is a subtle breaking change in `SplitFactoryProvider`. When using the `config` prop, `factory` and `client` properties in the context are `null` in the first render, until the context is updated when the factory is ready. This differs from the previous behavior where `factory` and `client` were immediately available.
19+
* Note: There is a subtle breaking change in `SplitFactoryProvider`. When using the `config` prop, `factory` and `client` properties in the context are `null` in the first render, until the context is updated when some event is emitted on
20+
* the SDK main client (ready, ready from cache, timeout or update depending on the configuration of the `updateOnXXX` props of the component). This differs from the previous behavior where `factory` and `client` were immediately available.
2021
*
2122
* @see {@link https://help.split.io/hc/en-us/articles/360038825091-React-SDK#2-instantiate-the-sdk-and-create-a-new-split-client}
2223
*/

src/SplitFactoryProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { getSplitFactory, destroySplitFactory, IFactoryWithClients, getSplitClie
77
import { DEFAULT_UPDATE_OPTIONS } from './useSplitClient';
88

99
/**
10-
* SplitFactoryProvider will initialize the Split SDK and its main client when it is mounted, listen for its events in order to update the Split Context,
11-
* and automatically shutdown and release resources when it is unmounted. SplitFactoryProvider must wrap other library components and functions
12-
* since they access the Split Context and its elements (factory, clients, etc).
10+
* SplitFactoryProvider will initialize the Split SDK and its main client when `config` prop is provided or updated, listen for its events in order to update the Split Context,
11+
* and automatically destroy the SDK (shutdown and release resources) when it is unmounted or `config` prop updated. SplitFactoryProvider must wrap other library components and
12+
* functions since they access the Split Context and its properties (factory, client, isReady, etc).
1313
*
1414
* NOTE: Either pass a factory instance or a config object. If both are passed, the config object will be ignored.
1515
* Pass the same reference to the config or factory object rather than a new instance on each render, to avoid unnecessary props changes and SDK reinitializations.

src/withSplitFactory.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import { SplitFactory } from './SplitFactory';
1212
*
1313
* @deprecated Use `SplitFactoryProvider` instead.
1414
* `SplitFactoryProvider` is a drop-in replacement of `SplitFactory` that properly handles side effects (factory creation and destruction) within the React component lifecycle, avoiding issues with factory recreation and memory leaks.
15-
* Note: There is a subtle breaking change in `SplitFactoryProvider`. When using the `config` prop, `factory` and `client` properties in the context are `null` in the first render, until the context is updated when the factory is ready. This differs from the previous behavior where `factory` and `client` were immediately available.
15+
* Note: There is a subtle breaking change in `SplitFactoryProvider`. When using the `config` prop, `factory` and `client` properties in the context are `null` in the first render, until the context is updated when some event is emitted on
16+
* the SDK main client (ready, ready from cache, timeout or update depending on the configuration of the `updateOnXXX` props of the component). This differs from the previous behavior where `factory` and `client` were immediately available.
1617
*/
1718
export function withSplitFactory(config?: SplitIO.IBrowserSettings, factory?: SplitIO.IBrowserSDK, attributes?: SplitIO.Attributes) {
1819

0 commit comments

Comments
 (0)