Repository navigation
Releases: amerllica/react-native-tinode
Release list
v0.2.0
Highlights
react-native-tinode is now a thin React layer over the official tinode-sdk.
The in-repo TypeScript port of the SDK is gone. This became possible when
tinode/tinode-js#103 was merged: the official SDK now accepts
storage, netInfo and network in new Tinode(config) and ships the storage adapters that this package used to
carry. SDK fixes now come from upstream, and this package keeps only the React providers and hooks, the TypeScript
types and two Hermes polyfills. See #2.
Breaking
netInfomoves from aTinodeProvider/TinodeStoresProviderprop into the config:
createTinode({ ...config, netInfo: NetInfo })or<TinodeProvider config={{ ...config, netInfo }}>. The SDK
then reconnects at once when the network comes back. The provider still reconnects on anAppStatechange.Topic,TopicMe,TopicFnd,CommError,MetaGetBuilderandLargeFileHelperare types only, because
upstream does not export the classes. UseisCommError(error)instead ofinstanceof CommError.
Added
tinode-sdkis a dependency. Until its next npm release, it is installed from a pinned commit of the tinode-js
develbranch, so installing needsgitand access to github.com.- TypeScript declarations for the
tinode-sdksurface, one file per area. The emitted types do not refer to
tinode-sdk, so your app does not need its types. - Hermes polyfills for
Intl.Segmenter(grapheme level) andTextDecoder(UTF-8). They are installed only when
missing, before the SDK loads. Without them the SDK crashes on Hermes withIntl.Segmenter is not a constructor. createTinodepassesstorage,netInfoandnetworkto the SDK.
Fixed
- The
TextDecoderpolyfill decodes malformed UTF-8 and skips a leading BOM like the WHATWGTextDecoder. - The
Intl.Segmenterpolyfill rejects granularities other thangraphemeand supportscontaining().
Changed
fromMMKVis a typed const.- The grapheme fallback tables are removed. Hermes supports
\p{}Unicode property escapes now. CreateTinodeOptionsis derived fromTinodeConfig, so the two cannot drift apart.
Removed
src/core(the SDK port and its 14 test suites),src/react/netinfo.tsand thefake-indexeddbdev dependency.
Known limits
LargeFileHelper.download()works on the web only, because the currenttinode-sdkneeds a DOM for it. Until
the fix is released upstream, download attachments yourself withfetchand the auth token.upload()works on
native.- Not checked: signing in against a local Tinode server. The example app loads the SDK on Hermes and shows the
sign-in screen in Expo Go on the iOS simulator.
Docs
- README: the package is a React layer over
tinode-sdk, the GitHub install, and why theAppStatereconnect stays
in the provider. - Design decisions,
NOTICEand
the auth token guide are updated.
Contributors
- @amerllica: this release, and the upstream change
tinode/tinode-js#103 that makes it possible. - @or-else: reviewed and merged tinode/tinode-js#103 into tinode-js
devel.
- Install:
yarn add react-native-tinode@0.2.0 - npm: https://www.npmjs.com/package/react-native-tinode/v/0.2.0
- SDK:
tinode-sdkfrom tinode-jsdevelat
7043616 - Full Changelog: v0.1.1...v0.2.0
v0.1.1
Highlights
A release pipeline fix. 0.1.1 has the same code as 0.1.0.
Fixed
- The release job pins npm to 11.x. Before,
npm install --global npm@latestinstalled an npm that does not run on
the Node version in.nvmrc, so the job stopped before it could publish.
Contributors
- Install:
yarn add react-native-tinode@0.1.1 - npm: https://www.npmjs.com/package/react-native-tinode/v/0.1.1
- Full Changelog: v0.1.0...v0.1.1
v0.1.0
Highlights
The first release. react-native-tinode is a Tinode chat client for React Native
and the web, written in TypeScript. It is a port of the official JavaScript SDK
(tinode-js v0.25.4) that does not need browser APIs, with React hooks on top.
It runs on iOS, Android and the web, in Expo Go and in bare React Native, with no native code.
Added
- Client:
Tinode,Topic,TopicMe,TopicFnd,AccessMode,MetaGetBuilderandCommError, ported to
TypeScript with typed protocol messages. - Transports: websocket, long polling, and
LargeFileHelperfor uploads and downloads.upload()takes a web
Blob/Fileor a React Native file object{ uri, name, type }. - Formats:
Draftyrich text andTheCardcontact cards, with a grapheme fallback for Hermes. - Offline cache with pluggable storage:
MemoryAdapter,IndexedDBAdapteron the web, andKeyValueAdapterfor
expo-sqlitekv-store, MMKV (fromMMKV) and AsyncStorage on native. - React:
TinodeProvider,TinodeStoresProvider,createTinode, and the hooksuseTinode,useConnection,
useLogin,useMeTopic,useTopic,useMessagesanduseTyping. - Push:
registerDeviceToken(tinode, token)sends the device push token to the server. - Example app with login, contacts and chat screens. It caches chats with
expo-sqliteon native.
Docs
- README with installation, quick start, hooks, storage, files and push.
- Design decisions.
- Persistence guides for
each supported store.
Internal
- Licensed under Apache-2.0 as a port of tinode-js. See NOTICE.
- Releases are published only by GitHub Actions on a
vX.Y.Ztag onmain, with npm trusted publishing and
provenance. A version that is already on npm is not published again.
Contributors
- @amerllica: the port, the React layer, the example app and the docs.
- Thanks to Tinode LLC for tinode-js, which this
release is ported from.
- Install:
yarn add react-native-tinode@0.1.0 - npm: https://www.npmjs.com/package/react-native-tinode/v/0.1.0
- Full Changelog: https://github.com/amerllica/react-native-tinode/commits/v0.1.0