Skip to content

Commit

Permalink
Added MIGRATION-GUIDE.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilianoSanchez committed Nov 12, 2024
1 parent e39e0d6 commit 947925d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
40 changes: 40 additions & 0 deletions MIGRATION-GUIDE.md
Original file line number Diff line number Diff line change
@@ -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' });
```

0 comments on commit 947925d

Please sign in to comment.