Skip to content

Commit 32e85ad

Browse files
committed
Merge branch 'main' into notification-feeds
2 parents e472120 + 9f296b8 commit 32e85ad

File tree

157 files changed

+4059
-1455
lines changed

Some content is hidden

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

157 files changed

+4059
-1455
lines changed

.github/workflows/lint-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Lint and test
22
env:
33
VITE_STREAM_API_KEY: ${{ vars.CLIENT_TEST_API_KEY }}
44
VITE_STREAM_API_SECRET: ${{ secrets.CLIENT_TEST_SECRET }}
5-
VITE_API_URL: ${{ vars.CLIENT_TEST_API_URL }}
65

76
on:
87
push:
@@ -37,7 +36,7 @@ jobs:
3736
run: yarn lint:all
3837

3938
- name: Build packages
40-
run: NODE_ENV=production yarn build:all
39+
run: NODE_ENV=production yarn build:libs
4140

4241
- name: Test packages
4342
run: yarn test:ci:libs

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Version and Release
22
env:
33
VITE_STREAM_API_KEY: ${{ vars.CLIENT_TEST_API_KEY }}
44
VITE_STREAM_API_SECRET: ${{ secrets.CLIENT_TEST_SECRET }}
5-
VITE_API_URL: ${{ vars.CLIENT_TEST_API_URL }}
65

76
on:
87
workflow_dispatch:

ai-docs/ai-state-management.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Other state updates:
1010
- when calling `getOrCreate` method
1111
- when calling `queryFeeds` methid
1212
- when paginating, like `feed.getNextPage`
13+
- some HTTP responses also trigger a state update: for example follow/unfollow should update the state to allow basic action on the feed without having to watch them
1314

1415
## WebSocket event handlers
1516

@@ -35,6 +36,14 @@ State update code is located in the `state-updates` folder. These methods return
3536

3637
When updating the state we need to change the reference of the key we want to update. For example if we add a new activity we need to return a new array, it's not enough to append the new activity for the existing array.
3738

39+
### State update in response WebSocket event (one-way state update)
40+
41+
The state update util method should receive a WebSocket event (and some additional info if necessary) as an input
42+
43+
### State update in response HTTP response and WebSocket event (two-way state update)
44+
45+
These methods should be able to do the state update both from an HTTP response or a WebSocket event. The state update util method should receive relevant objects (for example `event.follow` or `response.follow`).
46+
3847
## Tests
3948

4049
Tests can be run with the `yarn test` command in `packages/feeds-client` folder.

nx.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"defaultBase": "main",
33
"release": {
4-
"projects": ["@stream-io/feeds-client", "@stream-io/feeds-react-native-sdk"],
4+
"projects": [
5+
"@stream-io/feeds-client",
6+
"@stream-io/feeds-react-native-sdk",
7+
"@stream-io/feeds-react-sdk"
8+
],
59
"projectsRelationship": "independent",
610
"conventionalCommits": {
711
"types": {

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"build:libs": "yarn workspaces foreach -v --topological-dev --no-private run build",
1717
"build:client": "yarn workspace @stream-io/feeds-client run build",
1818
"build:react-native-sdk": "yarn workspace @stream-io/feeds-react-native-sdk run build",
19+
"build:react-sdk": "yarn workspace @stream-io/feeds-react-native-sdk run build",
1920
"clean:all": "yarn workspaces foreach -vt run clean",
2021
"lint:all": "eslint --max-warnings=0 --cache 'packages/**/*.{ts,tsx}'",
2122
"lint:all:fix": "eslint --max-warnings=0 'packages/**/*.{ts,tsx}' --fix",
@@ -34,10 +35,10 @@
3435
"@jscutlery/semver": "^5.6.0",
3536
"@nx/js": "^21.2.2",
3637
"@types/eslint": "^8.56.10",
37-
"@typescript-eslint/eslint-plugin": "6.4",
38+
"@typescript-eslint/eslint-plugin": "6.21.0",
3839
"@typescript-eslint/parser": "^7.13.1",
39-
"@typescript-eslint/typescript-estree": "^7.13.1",
40-
"eslint": "^9.30.1",
40+
"@typescript-eslint/typescript-estree": "^7.18.0",
41+
"eslint": "^9.31.0",
4142
"eslint-config-prettier": "^9.1.0",
4243
"eslint-config-standard-with-typescript": "^43.0.1",
4344
"eslint-import-resolver-typescript": "^3.10.1",
@@ -53,7 +54,7 @@
5354
"patch-package": "^8.0.0",
5455
"prettier": "^3.6.2",
5556
"typescript": "^5.8.3",
56-
"typescript-eslint": "^8.35.1",
57+
"typescript-eslint": "^8.38.0",
5758
"vercel": "^37.7.1",
5859
"vite": "^5.4.8"
5960
}

packages/feeds-client/@react-bindings/contexts/StreamFeedContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createContext, useContext } from 'react';
2-
import type { Feed } from '../../src/Feed';
2+
import type { Feed } from '../../src/feed';
33

44
export const StreamFeedContext = createContext<Feed | undefined>(undefined);
55

packages/feeds-client/@react-bindings/contexts/StreamFeedsContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createContext, useContext } from 'react';
2-
import type { FeedsClient } from '../../src/FeedsClient';
2+
import type { FeedsClient } from '../../src/feeds-client';
33

44
export const StreamFeedsContext = createContext<FeedsClient | undefined>(undefined);
55

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { createContext, useContext } from 'react';
2+
import type { SearchController } from '../../src/common/SearchController';
3+
4+
export const StreamSearchContext = createContext<SearchController | undefined>(undefined);
5+
6+
/**
7+
* The props for the StreamSearchProvider component.
8+
*/
9+
export type StreamSearchContextProps = {
10+
searchController: SearchController;
11+
};
12+
13+
/**
14+
* Hook to access the nearest SearchController instance.
15+
*/
16+
export const useSearchContext = () => {
17+
return useContext(StreamSearchContext);
18+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { createContext, useContext } from 'react';
2+
import type { SearchSource } from '../../src/common/BaseSearchSource';
3+
4+
export const StreamSearchResultsContext = createContext<SearchSource | undefined>(undefined);
5+
6+
/**
7+
* The props for the StreamSearchResultsProvider component.
8+
*/
9+
export type StreamSearchResultsContextProps = {
10+
source: SearchSource;
11+
};
12+
13+
/**
14+
* Hook to access the nearest SearchSource instance.
15+
*/
16+
export const useSearchResultsContext = () => {
17+
return useContext(StreamSearchResultsContext);
18+
};

packages/feeds-client/@react-bindings/hooks/client-state-hooks/useClientConnectedUser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { FeedsClientState } from '../../../src/FeedsClient';
1+
import type { FeedsClientState } from '../../../src/feeds-client';
22
import { useStateStore } from '../useStateStore';
33
import { useFeedsClient } from '../../contexts/StreamFeedsContext';
44

0 commit comments

Comments
 (0)