Releases: GetStream/stream-chat-react-native
[2.0.0-beta.0] 2020-10-14
Upgrade
Please check Upgrade Docs for complete summary of upgrading from 0.x.x to 2.x.x
Changelog
BREAKING CHANGES
- You will need to install https://github.com/LinusU/react-native-get-random-values and add this line
import 'react-native-get-random-values';to yourindex.js - Expo 39 is now the lowest supported version
Typescript
This library has been moved to full typescript. Please check Typescript doc for details
Component prop changes
Channel
- add
additionalKeyboardAvoidingViewPropsprop to allow custom keyboard props
ChannelListMessenger
- remove
setActiveChannelprop
ChannelPreviewMessenger
- renamed the
latestMessageprop tolatestMessagePreview. This name change is more semantic to what the prop does and reduces confusion with thelastMessageprop
MessageContent
- removed
retrySendMessageprop in favor ofretrySendMessagewithinMessagesContext
MessageInput
- remove
parentprop toparent_idas it needs to be just an id string instead of the entire parent object - add
setInputRefprop to actually allow forwarding of the TextInput ref controls
MessageSystem
- add
formatDateprop to allow custom date formatting
ChannelContext
-
We have split the
ChannelContextinto three separate contexts to further modularize the code and reduce renders as items in context change. The following contexts now contain the following values, previously all held within theChannelContext:-
ChannelContext:channeldisabledEmptyStateIndicatorerroreventHistorylastReadloadingLoadingIndicatormarkReadmembersreadsetLastReadtypingwatcherCountwatchers
-
MessagesContextAttachmentclearEditingStateeditingeditMessageemojiDatahasMoreloadingMoreloadMoreMessagemessagesremoveMessageretrySendMessagesendMessagesetEditingStateupdateMessage
-
ThreadContextcloseThreadloadMoreThreadopenThreadthreadthreadHasMorethreadLoadingMorethreadMessages
-
-
All contexts are exported and any values can be accessed through a higher order component (ex:
withMessagesContext) or with one of our custom context hooks (ex: accessMessagesContextbyconst { messages } = useMessagesContext();).
[1.3.4] 2020-10-13
- Fixing keyboard glitch functionality for android a7f94b9
[1.3.3] 2020-10-05
- Fixing retry upload functionality e89b87f
[1.3.2] 2020-10-02
-
SuggestionsList (for user-mentions feature in MessageInput) doesn't update the position as per keyboard position. For the time being, we have fixed this by dismissing the suggestions list when keyboard gets dismissed - 0fdff4f
-
Exported IconBadge and IconSquare components, to fix the tutorial f1b6a39
-
Added file size to file attachment 7e653a4
[1.3.0] 2020-09-25
BREAKING CHANGES
MessageInput
- Replaced the default image picker react-native-image-picker for react-native-image-crop-picker and added
compressImageQualityprop to support image compression out-of-the-box - Added
FileUploadPreviewandImageUploadPreviewprops to support custom overrides to those components
KeyboardCompatibleView and Channel component
Implementation of internal KeyboardCompatibleView has been changed so as to make animations smoother and fix existing issues with keyboard behavior.
Support for following props have been dropped from Channel and KeyboardCompatibleView
- keyboardDismissAnimationDuration
- keyboardOpenAnimationDuration
Following new props have been introduced on Channel component. They are the same props accepted by KeyboardAvoidingView of react-native.
- keyboardBehavior ['height' | 'position' | 'padding']
- keyboardVerticalOffset
ChannelList
-
We converted the ChannelList component from a class to a function and abstracted the event listener logic into custom hooks. The default event handlers can still be overridden by providing custom prop functions to the ChannelList component. Custom logic can be provided for the following events:
onAddedToChanneloverridesnotification.added_to_channeldefaultonChannelDeletedoverrideschannel.deleteddefaultonChannelHiddenoverrideschannel.hiddendefaultonChannelTruncatedoverrideschannel.truncateddefaultonChannelUpdatedoverrideschannel.updateddefaultonMessageNewoverridesnotification.message_newdefaultonRemovedFromChanneloverridesnotification.removed_from_channeldefault
-
All custom event handlers now accept two arguments, with the
thisreference no longer needed in the functional component.- 1st argument:
setChannelsreference to theuseStatehook that sets thechannelsin the React Native FlatList - 2nd argument:
eventobject returned by the StreamChat instance
- 1st argument:
e.g.,
// In following example we will override the default handler for notification.added_to_channel
<ChannelList
filters={}
onAddedToChannel={(setChannels, event) => {
setChannels(channels => {
// Do additional actions on channels array.
return channels;
})
}}
>- On upgrading to this release, ensure events and any custom handling functions (ex:
onAddedToChanneloronMessageNew) are properly processed and update the list UI as expected.
FileUploadPreview
- We fixed a bug for being unable to remove a file from the
MessageInputand made it consistent toImageUploadPreview - We have removed support for the
fileUploadPreview.dismissTexttheme value - We have added support for
fileUploadPreview.dismiss,fileUploadPreview.dismissImage, andfileUploadPreview.imageContainertheme values
Deprecated Props
-
We have removed support for the
MessageListcomponent'sonMessageTouchprop. Please use theonPressprop on theMessageSimplecomponent to perform an action on touch of a message. -
We have removed support for the
Messagecomponent'sreadOnlyprop. Please use thedisabledvalue from theChannelContextinstead. -
We have also dropped support for the following
MessageListprops:dateSeparator(use DateSeparator instead)headerComponent(use HeaderComponent instead)
this Reference Removal
- We have removed the
thisclass component reference from the prop functions inMessageSimple. For example, if you wish to override the SDK's standard long press behavior on a message, theonLongPressfunction passed in toMessageSimpleno longer takes thethiscomponent reference as it's first argument. The message and the event object become the first and second arguments, respectively.
renderText Function
- The
renderTextfunction utilized in theMessageTextContainercomponent now accepts a single object containingmarkdownRules,markdownStyles, andmessage. Previously each value was a separate function parameter.
[1.2.0] 2020-08-21
NO BREAKING CHANGES
-
Following components have been converted to functional component from class based component.
- Chat
- KeyboardCompatibleView
- SuggestionsProvider
- AutoCompleteInput
- Spinner
-
So far we exported bundled/transpiled version of components from package as single file - dist/index.js, dist/index.es using rollup. But now we are moving away from this approach and instead distributing original source of components since react-native handles bundling/transpiling part anyways. This also makes it easy for end-users to debug components exported from stream-chat-react-native.
[1.1.1] 2020-08-03
[1.1.0] 2020-07-31
-
Fixed exports of MessageStatus, MessageContent, MessageAvatar, MessageTextContainer components #268
-
Moving following components to functional components
- ChannelPreview
- ChannelPreviewMessenger
- Attachment
- Card
- FileAttachment
- EmptyStateIndicator, LoadingIndicator, LoadingErrorIndicator
-
Decoupled actionsheet from MessageInput component 59618ad
[1.0.0] 2020-07-29
We've already been on a v1 release for a while but never updated our versioning. Right now we're in the process of rewriting our components to be more future proof and we started using hooks, hence the v1.0.0 today.
Breaking change: stream-chat-react-native now relies on hooks and will need react-native >= 0.59.0 to work
Rewrite will involve following changes:
- Functional components instead of class based components
- Static typing using typescript
- UI tests
We are going to increamentally implement these changes and will try to keep everything backwards compatible unless really necessary.
[0.15.2] 2020-07-29
- Exporting
AutoCompleteInputcomponent d41d0d5