diff --git a/CHANGES.txt b/CHANGES.txt index dcd9169..d93f835 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,7 +3,9 @@ - Updated @splitsoftware/splitio package to version 11.0.1 that includes major updates, and updated some transitive dependencies for vulnerability fixes. - Renamed distribution folders from `/lib` to `/cjs` for CommonJS build, and `/es` to `/esm` for ECMAScript Modules build. - BREAKING CHANGES: - - Removed the `core.trafficType` option from the `config` object accepted by the `initSplitSdk` action creator, and made the `trafficType` argument of the `track` helper function mandatory. This is because traffic types can no longer be bound to SDK clients since JavaScript SDK v11.0.0, so the traffic type must now be provided as an argument in `track` method calls. + - Removed the `core.trafficType` option from the `config` object accepted by the `initSplitSdk` action creator, and made the `trafficType` argument of the `track` helper function mandatory. + This is because traffic types can no longer be bound to SDK clients since JavaScript SDK v11.0.0, so the traffic type must now be provided as an argument in `track` function calls. + Refer to ./MIGRATION-GUIDE.md for more details. 1.14.1 (October 15, 2024) - Bugfixing - Fixed error in `splitReducer` when handling actions with a `null` payload, preventing crashes caused by accessing undefined payload properties (Related to https://github.com/splitio/redux-client/issues/121). diff --git a/MIGRATION-GUIDE.md b/MIGRATION-GUIDE.md new file mode 100644 index 0000000..944b7fc --- /dev/null +++ b/MIGRATION-GUIDE.md @@ -0,0 +1,40 @@ + +# Migrating to Redux SDK v2.0.0 + +Redux SDK v2.0.0 introduces a breaking change that you should consider when migrating from a previous version. + +If you were passing the `core.trafficType` option to the SDK configuration object, you should remove it since it is no longer supported. +The `trafficType` must be passed as an argument of the `track` helper function. For example: + +```js +import { initSplitSdk, track } from '@splitsoftware/splitio-redux' + +const CONFIG = { + core: { + authorizationKey: YOUR_CLIENT_SIDE_SDK_KEY, + key: USER_KEY, + trafficType: 'user' + } +} + +store.dispatch(initSplitSdk({ config: CONFIG })) + +track({ eventType: 'my_event' }); +``` + +should be refactored to: + +```js +import { initSplitSdk, track } from '@splitsoftware/splitio-redux' + +const CONFIG = { + core: { + authorizationKey: YOUR_CLIENT_SIDE_SDK_KEY, + key: USER_KEY + } +} + +store.dispatch(initSplitSdk({ config: CONFIG })) + +track({ eventType: 'my_event', trafficType: 'user' }); +```