Skip to content

Commit

Permalink
Merge pull request #124 from splitio/breaking_change_baseline
Browse files Browse the repository at this point in the history
Prepare release v2.0.0
  • Loading branch information
EmilianoSanchez authored Nov 13, 2024
2 parents da2ce96 + 8a99367 commit 60bef68
Show file tree
Hide file tree
Showing 25 changed files with 476 additions and 305 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
'plugins': [
'react',
'@typescript-eslint',
'eslint-plugin-tsdoc',
'import'
],
'rules': {
Expand Down Expand Up @@ -56,5 +57,11 @@ module.exports = {
'import/no-self-import': 'error',
'import/no-default-export': 'error',
}
}, {
// Enable TSDoc rules for TypeScript files, allowing the use of JSDoc in JS files.
'files': ['**/*.ts'],
'rules': {
'tsdoc/syntax': 'warn'
}
}],
};
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.DS_Store
node_modules
lib
es
types
coverage
examples
.vscode
.scannerwork
/node_modules
/cjs
/esm
/types
/coverage
/examples
/.vscode
/.scannerwork
16 changes: 15 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2.0.0 (November 14, 2024)
- Added support for targeting rules based on large segments.
- Updated @splitsoftware/splitio package to version 11.0.1 that includes major updates, and updated some transitive dependencies for vulnerability fixes.
- Updated `getTreatments` action creator to not dispatch an action when called while the SDK is not ready or ready from cache, to avoid unnecessary updates in the state.
- 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` function calls.
Refer to ./MIGRATION-GUIDE.md for more details.
- Updated peer dependencies to drop support for Redux library below v3.0.0.

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).

1.14.0 (September 13, 2024)
- Added `status` property to Split reducer's slice of state to track the SDK events of non-default clients (Related to https://github.com/splitio/redux-client/issues/113).
- Added `lastUpdate` and `isTimedout` properties to the object returned by the `getStatus` helper and `selectTreatmentAndStatus` and `selectTreatmentWithConfigAndStatus` selectors, to expose the last event timestamp and the timedout status of the SDK clients (Related to https://github.com/splitio/redux-client/issues/113).
Expand Down Expand Up @@ -52,7 +66,7 @@
- Updated linter dependencies and rules. The deprecated TSLint package was replaced by ESLint.
- Updated some transitive dependencies for vulnerability fixes.
- Updated @splitsoftware/splitio package to version 10.22.4 that includes minor improvements.
- Bugfixing - Fixed error when using the SDK in localhost mode for testing with NodeJS test runners such as Jest (See https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#localhost-mode).
- Bugfixing - Fixed error when using the SDK in localhost mode for testing with Node.js test runners such as Jest (See https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK#localhost-mode).

1.7.1 (November 15, 2022)
- Updated React Redux peer dependency range to include [email protected] and [email protected].
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' });
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Split has built and maintains SDKs for:
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
* JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
* JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
* Node.js [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
* PHP thin-client [Github](https://github.com/splitio/php-thin-client) [Docs](https://help.split.io/hc/en-us/articles/18305128673933-PHP-Thin-Client-SDK)
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
Expand Down
Loading

0 comments on commit 60bef68

Please sign in to comment.