Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.11.0 #104

Merged
merged 17 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
node_modules
lib
es
types
coverage
examples
.vscode
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.11.0 (April 3, 2024)
- Added `sideEffects: false` property in the package.json file to allow tree shaking.
- Updated Redux-Thunk peer dependency range to include [email protected].
- Updated the build process and added the `tslib` package as an explicit dependency to import TypeScript helpers, thereby avoiding duplicated helper code in the output files.
- Updated @splitsoftware/splitio package to version 10.25.2, which includes vulnerability fixes and other improvements.

1.10.0 (December 18, 2023)
- Added support for Flag Sets on the SDK, which enables grouping feature flags and interacting with the group rather than individually (more details in our documentation):
- Added a new optional `flagSets` property to the param object of the `getTreatments` action creator, to support evaluating flags in given flag set/s. Either `splitNames` or `flagSets` must be provided to the function. If both are provided, `splitNames` will be used.
Expand Down
322 changes: 112 additions & 210 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio-redux",
"version": "1.10.0",
"version": "1.11.0",
"description": "A library to easily use Split JS SDK with Redux and React Redux",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down Expand Up @@ -59,17 +59,16 @@
},
"homepage": "https://github.com/splitio/redux-client#readme",
"dependencies": {
"@splitsoftware/splitio": "10.24.1"
"@splitsoftware/splitio": "10.25.2",
"tslib": "^2.3.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/jest": "^27.0.0",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@types/react-redux": "^7.1.5",
"@types/redux-mock-store": "^1.0.1",
"@types/redux-thunk": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"eslint": "^8.36.0",
Expand All @@ -80,10 +79,10 @@
"jest": "^27.2.3",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-redux": "^8.0.0",
"redux": "^4.2.0",
"react-redux": "9.0.0",
"redux": "^5.0.1",
"redux-mock-store": "^1.5.4",
"redux-thunk": "^2.3.0",
"redux-thunk": "^3.1.0",
"replace": "^1.2.1",
"rimraf": "^3.0.0",
"ts-jest": "^27.0.5",
Expand All @@ -92,7 +91,7 @@
"peerDependencies": {
"react-redux": ">=4.0.0",
"redux": ">=2.0.0",
"redux-thunk": "^2.0.0"
"redux-thunk": ">=2.0.0"
},
"peerDependenciesMeta": {
"react-redux": {
Expand All @@ -104,5 +103,6 @@
"pre-commit": "npm run check",
"pre-push": "npm test && npm run build"
}
}
},
"sideEffects": false
}
5 changes: 3 additions & 2 deletions src/__tests__/utils/mockStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import thunk from 'redux-thunk';
import { thunk } from 'redux-thunk';
import configureMockStore from 'redux-mock-store';
const middlewares = [thunk];

const middlewares: any[] = [thunk];

/**
* Utils to not call requires files every time that we need mock the store
Expand Down
18 changes: 9 additions & 9 deletions src/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,49 +73,49 @@ export const splitReducer: Reducer<ISplitState> = function (
) {
switch (action.type) {
case SPLIT_READY:
return setReady(state, action.payload.timestamp);
return setReady(state, (action as any).payload.timestamp);

case SPLIT_READY_FROM_CACHE:
return setReadyFromCache(state, action.payload.timestamp);
return setReadyFromCache(state, (action as any).payload.timestamp);

case SPLIT_TIMEDOUT:
return {
...state,
isTimedout: true,
hasTimedout: true,
lastUpdate: action.payload.timestamp,
lastUpdate: (action as any).payload.timestamp,
};

case SPLIT_UPDATE:
return setUpdated(state, action.payload.timestamp);
return setUpdated(state, (action as any).payload.timestamp);

case SPLIT_DESTROY:
return {
...state,
isDestroyed: true,
lastUpdate: action.payload.timestamp,
lastUpdate: (action as any).payload.timestamp,
};

case ADD_TREATMENTS: {
const { key, treatments } = action.payload;
const { key, treatments } = (action as any).payload;
const result = { ...state };
return assignTreatments(result, key, treatments);
}

case SPLIT_READY_WITH_EVALUATIONS: {
const { key, treatments, timestamp } = action.payload;
const { key, treatments, timestamp } = (action as any).payload;
const result = setReady(state, timestamp);
return assignTreatments(result, key, treatments);
}

case SPLIT_READY_FROM_CACHE_WITH_EVALUATIONS: {
const { key, treatments, timestamp } = action.payload;
const { key, treatments, timestamp } = (action as any).payload;
const result = setReadyFromCache(state, timestamp);
return assignTreatments(result, key, treatments);
}

case SPLIT_UPDATE_WITH_EVALUATIONS: {
const { key, treatments, timestamp } = action.payload;
const { key, treatments, timestamp } = (action as any).payload;
const result = setUpdated(state, timestamp);
return assignTreatments(result, key, treatments);
}
Expand Down
22 changes: 12 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "es6", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"module": "es6", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": false, /* Generates corresponding '.d.ts' file. */
// "jsx": "react", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": false, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
"sourceMap": false, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "es", /* Redirect output structure to the directory. */
"outDir": "es", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */

// @TODO uncomment the following when migrating to JS-commons and Rollup, to avoid duplicated helpers code in builds.
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
"importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */

Expand Down Expand Up @@ -62,6 +60,10 @@
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
},
"include": ["src"],
"exclude": ["./src/__tests__"]
"include": [
"src"
],
"exclude": [
"./src/__tests__"
]
}
61 changes: 0 additions & 61 deletions types/actions.d.ts

This file was deleted.

69 changes: 0 additions & 69 deletions types/asyncActions.d.ts

This file was deleted.

23 changes: 0 additions & 23 deletions types/constants.d.ts

This file was deleted.

35 changes: 0 additions & 35 deletions types/helpers.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions types/index.d.ts

This file was deleted.

Loading
Loading