Skip to content

Commit a35410a

Browse files
authored
Merge branch 'dev' into 2025-03-10-subgraph-updates
2 parents 1a835fd + 4133993 commit a35410a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+277
-268
lines changed

packages/sdk-redux/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ All notable changes to the SDK-redux will be documented in this file.
77
### Changed
88
### Fixed
99

10+
## [0.7.0]
11+
12+
### Changed
13+
- [BREAKING] update to @reduxjs/toolkit 2
14+
- [BREAKING] leave only ESM support (no CommonJS)
15+
- use lodash's smaller direct libraries
16+
1017
## [0.6.1] - 2024-08-01
1118

1219
### Changed

packages/sdk-redux/package.json

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@superfluid-finance/sdk-redux",
33
"description": "SDK Redux for streamlined front-end application development with Superfluid Protocol",
4-
"version": "0.6.1",
4+
"version": "0.7.0",
55
"bugs": "https://github.com/superfluid-finance/protocol-monorepo/issues",
66
"config": {
77
"commitizen": {
@@ -10,26 +10,25 @@
1010
},
1111
"dependencies": {
1212
"graphql-request": "6.1.0",
13-
"lodash": "4.17.21",
14-
"promise-retry": "2.0.1"
13+
"promise-retry": "2.0.1",
14+
"lodash.memoize": "4.1.2",
15+
"lodash.uniqby": "4.7.0"
1516
},
1617
"devDependencies": {
17-
"@reduxjs/toolkit": "^1.9.7",
18+
"@reduxjs/toolkit": "^2",
1819
"@types/promise-retry": "^1.1.6",
19-
"@types/react": "^18",
20-
"@types/react-dom": "^18",
21-
"react": "^18",
22-
"react-dom": "^18",
23-
"react-redux": "^8.1.3"
20+
"@types/lodash.memoize": "^4.1.7",
21+
"@types/lodash.uniqby": "^4.7.9",
22+
"@types/react": "^19",
23+
"@types/react-dom": "^19",
24+
"react": "^19",
25+
"react-dom": "^19",
26+
"react-redux": "^9"
2427
},
2528
"directories": {
2629
"test": "test"
2730
},
28-
"engines": {
29-
"node": ">=12"
30-
},
3131
"files": [
32-
"dist/main",
3332
"dist/module",
3433
"CHANGELOG.md",
3534
"LICENSE",
@@ -38,11 +37,10 @@
3837
"homepage": "https://docs.superfluid.finance/",
3938
"keywords": [],
4039
"license": "MIT",
41-
"main": "dist/main/index.js",
4240
"module": "dist/module/index.js",
4341
"peerDependencies": {
44-
"@reduxjs/toolkit": "^1.7.0 || ^1.8.0 || ^1.9.0",
45-
"@superfluid-finance/sdk-core": ">0.7.0"
42+
"@reduxjs/toolkit": ">=2",
43+
"@superfluid-finance/sdk-core": ">=0.7.0"
4644
},
4745
"repository": {
4846
"type": "git",
@@ -51,8 +49,7 @@
5149
},
5250
"scripts": {
5351
"build": "rm -rf dist && run-p -l build:*",
54-
"build:main": "tsc -p tsconfig.json",
55-
"build:module": "tsc -p tsconfig.module.json",
52+
"build:module": "tsc -p tsconfig.json",
5653
"lint": "run-s lint:*",
5754
"lint:eslint": "eslint src --ext .ts",
5855
"fix": "run-s fix:*",
@@ -66,7 +63,7 @@
6663
"cloc": "sh tasks/cloc.sh"
6764
},
6865
"sideEffects": [
69-
"./src/sdkReduxConfig.ts"
66+
"./dist/module/sdkReduxConfig.js"
7067
],
7168
"typings": "dist/module/index.d.ts"
7269
}

packages/sdk-redux/src/reduxSlices/argTypes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {ISuperTokenModifyFlowParams} from '@superfluid-finance/sdk-core';
2-
import {Signer} from 'ethers';
1+
import {type ISuperTokenModifyFlowParams} from '@superfluid-finance/sdk-core';
2+
import {type Signer} from 'ethers';
33

44
import {mutationOverridesKey, mutationSignerKey} from '../utils';
55

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {ApiModules} from '@reduxjs/toolkit/query';
2+
3+
export type ModuleName = keyof ApiModules<any, any, any, any>;

packages/sdk-redux/src/reduxSlices/rtkQuery/cacheTags/CacheTagTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {insertIf, typeGuard} from '../../../utils';
2-
import {NothingString} from '../../argTypes';
2+
import {type NothingString} from '../../argTypes';
33

44
/**
55
* Cache tag types for queries. Read more about caching from RTK-Query documentation: https://redux-toolkit.js.org/rtk-query/usage/automated-refetching#cache-tags

packages/sdk-redux/src/reduxSlices/rtkQuery/cacheTags/invalidateSpecificCacheTagsForEvents.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {AnyAction, ThunkDispatch} from '@reduxjs/toolkit';
2-
import {AllEvents} from '@superfluid-finance/sdk-core';
3-
import {uniqBy} from 'lodash';
1+
import {type ThunkDispatch, type UnknownAction} from '@reduxjs/toolkit';
2+
import {type AllEvents} from '@superfluid-finance/sdk-core';
3+
import uniqBy from 'lodash.uniqby';
44

55
import {getRpcApiSlice, getSubgraphApiSlice} from '../../../sdkReduxConfig';
66

@@ -21,7 +21,7 @@ export const getSpecificCacheTagsToInvalidateForEvents = (chainId: number, event
2121
export const invalidateSpecificCacheTagsForEvents = (
2222
chainId: number,
2323
events: AllEvents[],
24-
dispatch: ThunkDispatch<any, any, AnyAction>
24+
dispatch: ThunkDispatch<any, any, UnknownAction>
2525
) => {
2626
const tagsToInvalidate = getSpecificCacheTagsToInvalidateForEvents(chainId, events);
2727

packages/sdk-redux/src/reduxSlices/rtkQuery/cacheTags/monitorAddressForNextEventToInvalidateCache.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import {AnyAction} from '@reduxjs/toolkit';
2-
import {ThunkDispatch} from '@reduxjs/toolkit';
1+
import {type ThunkDispatch, type UnknownAction} from '@reduxjs/toolkit';
32

43
import {getFramework} from '../../../sdkReduxConfig';
54
import {MillisecondTimes} from '../../../utils';
6-
import {TransactionInfo} from '../../argTypes';
5+
import {type TransactionInfo} from '../../argTypes';
76

87
import {invalidateSpecificCacheTagsForEvents} from './invalidateSpecificCacheTagsForEvents';
98

@@ -16,7 +15,7 @@ import {invalidateSpecificCacheTagsForEvents} from './invalidateSpecificCacheTag
1615
export const monitorAddressForNextEventToInvalidateCache = async (
1716
address: string,
1817
transactionInfo: TransactionInfo,
19-
dispatch: ThunkDispatch<any, any, AnyAction>
18+
dispatch: ThunkDispatch<any, any, UnknownAction>
2019
) => {
2120
const framework = await getFramework(transactionInfo.chainId);
2221
framework.query.on(
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import {createApi} from '@reduxjs/toolkit/query/react';
22

3+
import {initializeRpcApiSlice} from '../../sdkReduxInitialization';
4+
35
/**
46
* For creating RTK-Query API (e.g. "sfApi") with auto-generated React Hooks.
57
*
68
* Read more: https://redux-toolkit.js.org/rtk-query/api/created-api/hooks
79
*/
810
export const createApiWithReactHooks = createApi;
11+
12+
initializeRpcApiSlice((options) => createApi(options));

packages/sdk-redux/src/reduxSlices/rtkQuery/getSerializeQueryArgs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {isPlainObject} from '@reduxjs/toolkit';
2-
import {SerializeQueryArgs} from '@reduxjs/toolkit/dist/query/defaultSerializeQueryArgs';
2+
import {type SerializeQueryArgs} from '@reduxjs/toolkit/query';
33

44
import {mutationOverridesKey, mutationSignerKey} from '../../utils';
55

packages/sdk-redux/src/reduxSlices/rtkQuery/rpcApiSlice/endpoints/allRpcEndpoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {RpcEndpointBuilder} from '../rpcEndpointBuilder';
1+
import {type RpcEndpointBuilder} from '../rpcEndpointBuilder';
22

33
import {createFlowEndpoints} from './flowEndpoints';
44
import {createIndexEndpoints} from './indexEndpoints';

0 commit comments

Comments
 (0)