Skip to content

Commit 6105b3f

Browse files
Nico's feedback: 'Notable changes' rather than 'Breaking changes'
1 parent c1803ca commit 6105b3f

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

CHANGES.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
1.11.0 (January 16, 2023)
22
- 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`:
67
- `SplitFactoryProvider` utilizes the React Hooks API, requiring React 16.8.0 or later, while `SplitFactory` is compatible with React 16.3.0 or later.
78
- 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.
910
- Updating the `factory` prop in `SplitFactoryProvider` replaces the current SDK instance, unlike `SplitFactory` where it is ignored.
1011
- Updated internal code to remove a circular dependency and avoid warning messages with tools like PNPM (Related to issue #176).
1112
- Updated @splitsoftware/splitio package to version 10.25.1 for vulnerability fixes.

src/SplitFactory.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ import { DEFAULT_UPDATE_OPTIONS } from './useSplitClient';
1515
* even if the component is updated with a different config or factory prop.
1616
*
1717
* @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.
2020
*
21-
* BREAKING CHANGES to consider when migrating:
21+
* Notable changes to consider when migrating:
2222
* - `SplitFactoryProvider` utilizes the React Hooks API, requiring React 16.8.0 or later, while `SplitFactory` is compatible with React 16.3.0 or later.
2323
* - When using the `config` prop with `SplitFactoryProvider`, `factory` and `client` properties in `SplitContext` are `null` in the first render, until
2424
* 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
2525
* 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.
2828
* - Updating the `factory` prop in `SplitFactoryProvider` replaces the current SDK instance, unlike `SplitFactory` where it is ignored.
2929
*
3030
* @see {@link https://help.split.io/hc/en-us/articles/360038825091-React-SDK#2-instantiate-the-sdk-and-create-a-new-split-client}

src/withSplitFactory.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ import { SplitFactory } from './SplitFactory';
1111
* @param factory Split factory instance to use instead of creating a new one with the config object.
1212
*
1313
* @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.
1616
*
17-
* BREAKING CHANGES to consider when migrating:
17+
* Notable changes to consider when migrating:
1818
* - `SplitFactoryProvider` utilizes the React Hooks API, requiring React 16.8.0 or later, while `SplitFactory` is compatible with React 16.3.0 or later.
1919
* - When using the `config` prop with `SplitFactoryProvider`, `factory` and `client` properties in `SplitContext` are `null` in the first render, until
2020
* 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
2121
* 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.
2424
* - Updating the `factory` prop in `SplitFactoryProvider` replaces the current SDK instance, unlike `SplitFactory` where it is ignored.
2525
*/
2626
export function withSplitFactory(config?: SplitIO.IBrowserSettings, factory?: SplitIO.IBrowserSDK, attributes?: SplitIO.Attributes) {

0 commit comments

Comments
 (0)