-
Notifications
You must be signed in to change notification settings - Fork 272
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
feat: add ThreadList and ThreadProvider (Threads 2.0) #2407
Conversation
eb1dfe5
to
386105c
Compare
d60dd9b
to
ffc1389
Compare
cb06b65
to
e5e0cd9
Compare
0b4c146
to
d897374
Compare
295c64b
to
cd5542d
Compare
a5173e8
to
b39a276
Compare
7be0df7
to
a624062
Compare
1456257
to
8f19a9e
Compare
d943262
to
56039ae
Compare
b3555bb
to
bd094cc
Compare
VirtualMessage: props.VirtualMessage, | ||
}), | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
[props.reactionOptions], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was by design, changing overrides "in runtime" is not a good idea.
Size Change: +18.8 kB (+1.82%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2407 +/- ##
==========================================
- Coverage 85.52% 84.50% -1.03%
==========================================
Files 369 384 +15
Lines 7864 8105 +241
Branches 1908 1955 +47
==========================================
+ Hits 6726 6849 +123
- Misses 1046 1165 +119
+ Partials 92 91 -1 ☔ View full report in Codecov by Sentry. |
79e9b6e
to
ad615d4
Compare
🚂 GetStream/stream-chat-js#1330 This PR adds components for implementing a thread list view: ThreadList and ChatView. It also adds support for reactive state stores, like the ones that handle the thread list logic in the client. Implements a binding from the reactive state store in the client to React components. Implements a thread list. The component itself consists mostly of binding to the `ThreadManager` instance in the client. The Thread component was modified to optionally use a reactive `Thread` instance from the `ThreadContext`. The component checks if `ThreadContext` is provided, and if so uses the thread instance from that context. Otherwise, it falls back to the `ChannelContext` as usual. Currently, we use `ThreadContext` in the thread list view, where it is provided by the `ChatView.ThreadAdapter` component. Note that even when `ThreadContext` is used, `ChannelContext` also must be provided. Most our components, including the ones used in threads, still expect the channel context to be there. A set of components implementing a simple in-memory router to switch between channel view and thread list view. Using it is totally optional. Most integrations will probably use their own router instead. Still, nice to have something out-of-the-box. A new way to provide component overrides. Previously we allowed passing component overrides as props to `Channel` component, and then in some nested components as well, although not consistently. `WithComponents` is a new recommended way to provide component overrides, which requires far less prop drilling and nests nicely. --------- Co-authored-by: Matvei Andrienko <m.y.andrienko@outlook.com> BREAKING CHANGE: ComponentContext no longer provides any defaults
🚂 GetStream/stream-chat-js#1330 This PR adds components for implementing a thread list view: ThreadList and ChatView. It also adds support for reactive state stores, like the ones that handle the thread list logic in the client. Implements a binding from the reactive state store in the client to React components. Implements a thread list. The component itself consists mostly of binding to the `ThreadManager` instance in the client. The Thread component was modified to optionally use a reactive `Thread` instance from the `ThreadContext`. The component checks if `ThreadContext` is provided, and if so uses the thread instance from that context. Otherwise, it falls back to the `ChannelContext` as usual. Currently, we use `ThreadContext` in the thread list view, where it is provided by the `ChatView.ThreadAdapter` component. Note that even when `ThreadContext` is used, `ChannelContext` also must be provided. Most our components, including the ones used in threads, still expect the channel context to be there. A set of components implementing a simple in-memory router to switch between channel view and thread list view. Using it is totally optional. Most integrations will probably use their own router instead. Still, nice to have something out-of-the-box. A new way to provide component overrides. Previously we allowed passing component overrides as props to `Channel` component, and then in some nested components as well, although not consistently. `WithComponents` is a new recommended way to provide component overrides, which requires far less prop drilling and nests nicely. BREAKING CHANGE: ComponentContext no longer provides any defaults --------- Co-authored-by: Matvei Andrienko <m.y.andrienko@outlook.com>
## [12.0.0-rc.11](v12.0.0-rc.10...v12.0.0-rc.11) (2024-09-04) ### ⚠ BREAKING CHANGES * ComponentContext no longer provides any defaults ### Bug Fixes * MessageActions adjustments ([#2472](#2472)) ([fbd1b6f](fbd1b6f)) * quote replies in threads ([#2487](#2487)) ([0e4a6f1](0e4a6f1)) ### Features * add ThreadList and ThreadProvider (Threads 2.0) ([#2407](#2407)) ([941707d](941707d)) ### Chores * **deps:** bump version of stream-chat in peerDeps ([#2481](#2481)) ([466385d](466385d))
🚂 GetStream/stream-chat-js#1330
This PR adds components for implementing a thread list view: ThreadList and ChatView. It also adds support for reactive state stores, like the ones that handle the thread list logic in the client.
useStateStore
Implements a binding from the reactive state store in the client to React components.
ThreadList
Implements a thread list. The component itself consists mostly of binding to the
ThreadManager
instance in the client.Thread
The Thread component was modified to optionally use a reactive
Thread
instance from theThreadContext
. The component checks ifThreadContext
is provided, and if so uses the thread instance from that context. Otherwise, it falls back to theChannelContext
as usual.Currently, we use
ThreadContext
in the thread list view, where it is provided by theChatView.ThreadAdapter
component.Note that even when
ThreadContext
is used,ChannelContext
also must be provided. Most our components, including the ones used in threads, still expect the channel context to be there.ChatView
A set of components implementing a simple in-memory router to switch between channel view and thread list view. Using it is totally optional. Most integrations will probably use their own router instead. Still, nice to have something out-of-the-box.
WithComponents
A new way to provide component overrides. Previously we allowed passing component overrides as props to
Channel
component, and then in some nested components as well, although not consistently.WithComponents
is a new recommended way to provide component overrides, which requires far less prop drilling and nests nicely.BREAKING CHANGE: ComponentContext no longer provides any defaults