Repository navigation
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