-
Notifications
You must be signed in to change notification settings - Fork 80
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
fix!: replace StreamChatGenerics with module augmentation #1458
Conversation
Size Change: -344 B (-0.12%) Total Size: 290 kB
|
src/types.ts
Outdated
|
||
export interface CustomAttachmentType {} | ||
export interface CustomChannelType {} | ||
export interface CustomCommandType {} |
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.
Might have to figure out a better way for this to work. Currently using keyof CustomCommandType
to make it work with interface merging.
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.
This right here: https://github.com/GetStream/stream-chat-js/pull/1458/files#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410aR2124
Actual module augmentation would have to look something like:
// file.d.ts
import 'stream-chat';
declare module 'stream-chat' {
interface CustomCommandType {
customCommand: unknown;
otherCustomCommand: unknown;
}
}
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.
Looks good ! We're already doing similar things for other parts of the RN SDK (extending functionality and overloads) so this will come natural.
The entire change is breaking I assume, right ? What's the strategy to go about merging this when the time comes ? I suppose all SDKs would need to bump their major versions if they wish to upgrade their version of stream-chat
. Although kind of large in size, the change seems easy to do (if generics were being used in the first place).
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.
Yes, in case of React SDK we'd be releasing v13.0.0 which will bump its stream-chat
peer to v9.0.0 - the peer of the SDK is currently bound to v8-something.
As for the migration - see this draft of a migration guide here, feel free to suggest enhancements. Not sure where it'll live yet, I assume both React and RN will be similar in terms of migration but I'm open to adding tabs to switch between RN and React.
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.
That's fair - in that case we should pick it up earlier rather than later since stream-chat
is a direct dependency for stream-chat-react-native
(and not a peer one).
Since we'll likely have to do a V7 to go along with it as well, maybe we can do the same ? it should get rid of our pesky TS errors when there's a version mismatch (despite the fact it's a direct dependency).
fyi @oliverlaz
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.
@isekovanic I agree!
We should have a similar guide, and also we need to update the following chapters:
9765037
to
ad95891
Compare
ad95891
to
fe6b938
Compare
fe6b938
to
709bbb5
Compare
f0b88d1
to
008dd8f
Compare
747f12c
to
d04bff1
Compare
d4414ef
to
419dbd3
Compare
fix: `channel_role` has been removed from the type of the `members` parameter of the `Channel.inviteMembers` method fix: properties `created_by` and `created_by_id` have been added to `ChannelData` and `ChannelQueryOptions` types BREAKING CHANGES: - dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types - type `InviteOptions` has been renamed to `UpdateChannelOptions` - type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` - type `ThreadResponseCustomData` has been renamed to `CustomThreadData` - type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` - type `QueryFilter` no longer supports `$ne` and `$nin` operators - type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` - function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output
fix: `channel_role` has been removed from the type of the `members` parameter of the `Channel.inviteMembers` method fix: properties `created_by` and `created_by_id` have been added to `ChannelData` and `ChannelQueryOptions` types BREAKING CHANGE: - dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types - type `InviteOptions` has been renamed to `UpdateChannelOptions` - type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` - type `ThreadResponseCustomData` has been renamed to `CustomThreadData` - type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` - type `QueryFilter` no longer supports `$ne` and `$nin` operators - type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` - function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output
fix: `channel_role` has been removed from the type of the `members` parameter of the `Channel.inviteMembers` method fix: properties `created_by` and `created_by_id` have been added to `ChannelData` and `ChannelQueryOptions` types BREAKING CHANGE: - dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types - type `InviteOptions` has been renamed to `UpdateChannelOptions` - type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` - type `ThreadResponseCustomData` has been renamed to `CustomThreadData` - type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` - type `QueryFilter` no longer supports `$ne` and `$nin` operators - type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` - function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output
fix: `channel_role` has been removed from the type of the `members` parameter of the `Channel.inviteMembers` method fix: properties `created_by` and `created_by_id` have been added to `ChannelData` and `ChannelQueryOptions` types BREAKING CHANGE: dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types BREAKING CHANGE: type `InviteOptions` has been renamed to `UpdateChannelOptions` BREAKING CHANGE: type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` BREAKING CHANGE: type `ThreadResponseCustomData` has been renamed to `CustomThreadData` BREAKING CHANGE: type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` BREAKING CHANGE: type `QueryFilter` no longer supports `$ne` and `$nin` operators BREAKING CHANGE: type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` BREAKING CHANGE: function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output
fix: `channel_role` has been removed from the type of the `members` parameter of the `Channel.inviteMembers` method fix: properties `created_by` and `created_by_id` have been added to `ChannelData` and `ChannelQueryOptions` types BREAKING CHANGE: dropped jsDelivr bundle (#1468) BREAKING CHANGE: dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types BREAKING CHANGE: type `InviteOptions` has been renamed to `UpdateChannelOptions` BREAKING CHANGE: type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` BREAKING CHANGE: type `ThreadResponseCustomData` has been renamed to `CustomThreadData` BREAKING CHANGE: type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` BREAKING CHANGE: type `QueryFilter` no longer supports `$ne` and `$nin` operators BREAKING CHANGE: type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` BREAKING CHANGE: function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output
fix: `channel_role` has been removed from the type of the `members` parameter of the `Channel.inviteMembers` method fix: properties `created_by` and `created_by_id` have been added to `ChannelData` and `ChannelQueryOptions` types BREAKING CHANGE: dropped jsDelivr bundle (#1468) BREAKING CHANGE: dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types BREAKING CHANGE: type `InviteOptions` has been renamed to `UpdateChannelOptions` BREAKING CHANGE: type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` BREAKING CHANGE: type `ThreadResponseCustomData` has been renamed to `CustomThreadData` BREAKING CHANGE: type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` BREAKING CHANGE: type `QueryFilter` no longer supports `$ne` and `$nin` operators BREAKING CHANGE: type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` BREAKING CHANGE: function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output
fix: `channel_role` has been removed from the type of the `members` parameter of the `Channel.inviteMembers` method fix: properties `created_by` and `created_by_id` have been added to `ChannelData` and `ChannelQueryOptions` types BREAKING CHANGE: dropped jsDelivr bundle (#1468) BREAKING CHANGE: dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types BREAKING CHANGE: type `InviteOptions` has been renamed to `UpdateChannelOptions` BREAKING CHANGE: type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` BREAKING CHANGE: type `ThreadResponseCustomData` has been renamed to `CustomThreadData` BREAKING CHANGE: type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` BREAKING CHANGE: type `QueryFilter` no longer supports `$ne` and `$nin` operators BREAKING CHANGE: type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` BREAKING CHANGE: function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output
fix: `channel_role` has been removed from the type of the `members` parameter of the `Channel.inviteMembers` method fix: properties `created_by` and `created_by_id` have been added to `ChannelData` and `ChannelQueryOptions` types BREAKING CHANGE: dropped jsDelivr bundle (#1468) BREAKING CHANGE: dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types BREAKING CHANGE: type `InviteOptions` has been renamed to `UpdateChannelOptions` BREAKING CHANGE: type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` BREAKING CHANGE: type `ThreadResponseCustomData` has been renamed to `CustomThreadData` BREAKING CHANGE: type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` BREAKING CHANGE: type `QueryFilter` no longer supports `$ne` and `$nin` operators BREAKING CHANGE: type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` BREAKING CHANGE: function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output
## [9.0.0-rc.1](v8.57.1...v9.0.0-rc.1) (2025-02-27) ### ⚠ BREAKING CHANGES * dropped jsDelivr bundle (#1468) * dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types * type `InviteOptions` has been renamed to `UpdateChannelOptions` * type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` * type `ThreadResponseCustomData` has been renamed to `CustomThreadData` * type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` * type `QueryFilter` no longer supports `$ne` and `$nin` operators * type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` * function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output ### Bug Fixes * replace StreamChatGenerics with module augmentation ([#1458](#1458)) ([feb97da](feb97da))
## [9.0.0-rc.1](v8.57.1...v9.0.0-rc.1) (2025-02-27) ### ⚠ BREAKING CHANGES * dropped jsDelivr bundle (#1468) * dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types * type `InviteOptions` has been renamed to `UpdateChannelOptions` * type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` * type `ThreadResponseCustomData` has been renamed to `CustomThreadData` * type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` * type `QueryFilter` no longer supports `$ne` and `$nin` operators * type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` * function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output ### Bug Fixes * replace StreamChatGenerics with module augmentation ([#1458](#1458)) ([feb97da](feb97da))
## [9.0.0-rc.1](v8.57.1...v9.0.0-rc.1) (2025-02-27) ### ⚠ BREAKING CHANGES * dropped jsDelivr bundle (#1468) * dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types * type `InviteOptions` has been renamed to `UpdateChannelOptions` * type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` * type `ThreadResponseCustomData` has been renamed to `CustomThreadData` * type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` * type `QueryFilter` no longer supports `$ne` and `$nin` operators * type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` * function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output ### Bug Fixes * replace StreamChatGenerics with module augmentation ([#1458](#1458)) ([feb97da](feb97da))
## [9.0.0-rc.1](v8.57.1...v9.0.0-rc.1) (2025-02-27) ### ⚠ BREAKING CHANGES * dropped jsDelivr bundle (#1468) * dropped `StreamChatGenerics`, use `Custom<Entity>Data` to extend your types * type `InviteOptions` has been renamed to `UpdateChannelOptions` * type `UpdateChannelOptions` has been renamed to `UpdateChannelTypeRequest` * type `ThreadResponseCustomData` has been renamed to `CustomThreadData` * type `MarkAllReadOptions` has been deleted in favour of type `MarkChannelsReadOptions` * type `QueryFilter` no longer supports `$ne` and `$nin` operators * type `ChannelMembership` has been deleted in favour of type `ChannelMemberResponse` * function `formatMessage` (`utils.ts`) no longer returns `__html` property in the formatted message output ### Bug Fixes * replace StreamChatGenerics with module augmentation ([#1458](#1458)) ([feb97da](feb97da))
fix:
channel_role
has been removed from the type of themembers
parameter of theChannel.inviteMembers
methodfix: properties
created_by
andcreated_by_id
have been added toChannelData
andChannelQueryOptions
typesBREAKING CHANGES:
StreamChatGenerics
, useCustom<Entity>Data
to extend your typesInviteOptions
has been renamed toUpdateChannelOptions
UpdateChannelOptions
has been renamed toUpdateChannelTypeRequest
ThreadResponseCustomData
has been renamed toCustomThreadData
MarkAllReadOptions
has been deleted in favour of typeMarkChannelsReadOptions
QueryFilter
no longer supports$ne
and$nin
operatorsChannelMembership
has been deleted in favour of typeChannelMemberResponse
formatMessage
(utils.ts
) no longer returns__html
property in the formatted message output