You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGES.txt
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,12 @@
1
1
1.11.0 (January 16, 2023)
2
2
- Added new `SplitFactoryProvider` component as a replacement for the now deprecated `SplitFactory` component.
3
-
- The `SplitFactoryProvider` component, a drop-in replacement for `SplitFactory`, supports server-side rendering (Related to issues #11 and #109). For more details, see our documentation.
4
-
- Bugfixing - The new component is a revised version of `SplitFactory` that addresses improper handling of SDK initialization side-effects in the `componentDidMount` and `componentDidUpdate` methods (commit phase), resolving memory leak issues on server-side, React development and strict modes. It also ensures the SDK is updated when component props change (Related to issues #11 and #148).
5
-
- BREAKING CHANGES when migrating from `SplitFactory` to `SplitFactoryProvider`:
3
+
- Bugfixing: The new component is a revised version of `SplitFactory` that properly handles SDK side effects (factory creation and destruction) within the React component lifecycle,
4
+
- resolving memory leak issues in React development mode, strict mode and server-side rendering (Related to issues #11 and #109),
5
+
- and also ensuring that the SDK is updated if `config` or `factory` props change (Related to issues #11 and #148).
6
+
- Notable changes when migrating from `SplitFactory` to `SplitFactoryProvider`:
6
7
- `SplitFactoryProvider` utilizes the React Hooks API, requiring React 16.8.0 or later, while `SplitFactory` is compatible with React 16.3.0 or later.
7
8
- When using the `config` prop with `SplitFactoryProvider`, `factory` and `client` properties in `SplitContext` are `null` in the first render, until the context is updated when some event is emitted on the SDK main client (ready, ready from cache, timeout or update depending on the configuration of the `updateOn<Event>` props of the component). This differs from the previous behavior where `factory` and `client` were immediately available.
8
-
- Updating the `config` prop in `SplitFactoryProvider` reinitializes the SDK with the new configuration, while `SplitFactory` does not reinitialize the SDK. Pass a reference to the configuration object (e.g., via a global variable, `useState`, or `useMemo`) rather than a new instance to avoid unnecessary reinitialization.
9
+
- Updating the `config` prop in `SplitFactoryProvider` reinitializes the SDK with the new configuration, while `SplitFactory` does not reinitialize the SDK. It is recommended to pass a reference to the configuration object (e.g., via a global variable, `useState`, or `useMemo`) rather than a new instance on each render, to avoid unnecessary reinitializations.
9
10
- Updating the `factory` prop in `SplitFactoryProvider` replaces the current SDK instance, unlike `SplitFactory` where it is ignored.
10
11
- Updated internal code to remove a circular dependency and avoid warning messages with tools like PNPM (Related to issue #176).
11
12
- Updated @splitsoftware/splitio package to version 10.25.1 for vulnerability fixes.
Copy file name to clipboardExpand all lines: src/SplitFactory.tsx
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -15,16 +15,16 @@ import { DEFAULT_UPDATE_OPTIONS } from './useSplitClient';
15
15
* even if the component is updated with a different config or factory prop.
16
16
*
17
17
* @deprecated Replace with the new `SplitFactoryProvider` component.
18
-
* `SplitFactoryProvider` is a drop-in replacement that properly handles side effects (factory creation and destruction) within
19
-
* the React component lifecycle, resolving memory leak issues on server-side, React development and strict modes.
18
+
* `SplitFactoryProvider` is a revised version of `SplitFactory` that properly handles SDK side effects (factory creation and destruction) within the React component lifecycle,
19
+
* resolving memory leak issues in React development mode, strict mode and server-side rendering, and also ensuring that the SDK is updated if `config` or `factory` props change.
20
20
*
21
-
* BREAKING CHANGES to consider when migrating:
21
+
* Notable changes to consider when migrating:
22
22
* - `SplitFactoryProvider` utilizes the React Hooks API, requiring React 16.8.0 or later, while `SplitFactory` is compatible with React 16.3.0 or later.
23
23
* - When using the `config` prop with `SplitFactoryProvider`, `factory` and `client` properties in `SplitContext` are `null` in the first render, until
24
24
* the context is updated when some event is emitted on the SDK main client (ready, ready from cache, timeout or update depending on the configuration
25
25
* of the `updateOn<Event>` props of the component). This differs from the previous behavior where `factory` and `client` were immediately available.
26
-
* - Updating the `config` prop in `SplitFactoryProvider` reinitializes the SDK with the new configuration, while `SplitFactory` does not reinitialize the SDK.
27
-
* Pass a reference to the configuration object (e.g., via a global variable, `useState`, or `useMemo`) rather than a new instance to avoid unnecessary reinitialization.
26
+
* - Updating the `config` prop in `SplitFactoryProvider` reinitializes the SDK with the new configuration, while `SplitFactory` does not reinitialize the SDK. It is recommended to
27
+
* pass a reference to the configuration object (e.g., via a global variable, `useState`, or `useMemo`) rather than a new instance on each render, to avoid unnecessary reinitializations.
28
28
* - Updating the `factory` prop in `SplitFactoryProvider` replaces the current SDK instance, unlike `SplitFactory` where it is ignored.
Copy file name to clipboardExpand all lines: src/withSplitFactory.tsx
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -11,16 +11,16 @@ import { SplitFactory } from './SplitFactory';
11
11
* @param factory Split factory instance to use instead of creating a new one with the config object.
12
12
*
13
13
* @deprecated Replace with the new `SplitFactoryProvider` component.
14
-
* `SplitFactoryProvider` is a drop-in replacement of `SplitFactory` that properly handles side effects (factory creation and destruction) within
15
-
* the React component lifecycle, resolving memory leak issues on server-side, React development and strict modes.
14
+
* `SplitFactoryProvider` is a revised version of `SplitFactory` that properly handles SDK side effects (factory creation and destruction) within the React component lifecycle,
15
+
* resolving memory leak issues in React development mode, strict mode and server-side rendering, and also ensuring that the SDK is updated if `config` or `factory` props change.
16
16
*
17
-
* BREAKING CHANGES to consider when migrating:
17
+
* Notable changes to consider when migrating:
18
18
* - `SplitFactoryProvider` utilizes the React Hooks API, requiring React 16.8.0 or later, while `SplitFactory` is compatible with React 16.3.0 or later.
19
19
* - When using the `config` prop with `SplitFactoryProvider`, `factory` and `client` properties in `SplitContext` are `null` in the first render, until
20
20
* the context is updated when some event is emitted on the SDK main client (ready, ready from cache, timeout or update depending on the configuration
21
21
* of the `updateOn<Event>` props of the component). This differs from the previous behavior where `factory` and `client` were immediately available.
22
-
* - Updating the `config` prop in `SplitFactoryProvider` reinitializes the SDK with the new configuration, while `SplitFactory` does not reinitialize the SDK.
23
-
* Pass a reference to the configuration object (e.g., via a global variable, `useState`, or `useMemo`) rather than a new instance to avoid unnecessary reinitialization.
22
+
* - Updating the `config` prop in `SplitFactoryProvider` reinitializes the SDK with the new configuration, while `SplitFactory` does not reinitialize the SDK. It is recommended to
23
+
* pass a reference to the configuration object (e.g., via a global variable, `useState`, or `useMemo`) rather than a new instance on each render, to avoid unnecessary reinitializations.
24
24
* - Updating the `factory` prop in `SplitFactoryProvider` replaces the current SDK instance, unlike `SplitFactory` where it is ignored.
0 commit comments