Skip to content

Releases: amerllica/react-native-tinode

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 25 Oct 16:29
4985080

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

  • netInfo moves from a TinodeProvider / TinodeStoresProvider prop 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 an AppState change.
  • Topic, TopicMe, TopicFnd, CommError, MetaGetBuilder and LargeFileHelper are types only, because
    upstream does not export the classes. Use isCommError(error) instead of instanceof CommError.

Added

  • tinode-sdk is a dependency. Until its next npm release, it is installed from a pinned commit of the tinode-js
    devel branch, so installing needs git and access to github.com.
  • TypeScript declarations for the tinode-sdk surface, 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) and TextDecoder (UTF-8). They are installed only when
    missing, before the SDK loads. Without them the SDK crashes on Hermes with Intl.Segmenter is not a constructor.
  • createTinode passes storage, netInfo and network to the SDK.

Fixed

  • The TextDecoder polyfill decodes malformed UTF-8 and skips a leading BOM like the WHATWG TextDecoder.
  • The Intl.Segmenter polyfill rejects granularities other than grapheme and supports containing().

Changed

  • fromMMKV is a typed const.
  • The grapheme fallback tables are removed. Hermes supports \p{} Unicode property escapes now.
  • CreateTinodeOptions is derived from TinodeConfig, so the two cannot drift apart.

Removed

  • src/core (the SDK port and its 14 test suites), src/react/netinfo.ts and the fake-indexeddb dev dependency.

Known limits

  • LargeFileHelper.download() works on the web only, because the current tinode-sdk needs a DOM for it. Until
    the fix is released upstream, download attachments yourself with fetch and 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 the AppState reconnect stays
    in the provider.
  • Design decisions, NOTICE and
    the auth token guide are updated.

Contributors


v0.1.1

Choose a tag to compare

@github-actions github-actions released this 05 Oct 10:44
v0.1.1
952096e

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@latest installed an npm that does not run on
    the Node version in .nvmrc, so the job stopped before it could publish.

Contributors


v0.1.0

Choose a tag to compare

@amerllica amerllica released this 25 Oct 16:51
v0.1.0
bdc27fa

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, MetaGetBuilder and CommError, ported to
    TypeScript with typed protocol messages.
  • Transports: websocket, long polling, and LargeFileHelper for uploads and downloads. upload() takes a web
    Blob/File or a React Native file object { uri, name, type }.
  • Formats: Drafty rich text and TheCard contact cards, with a grapheme fallback for Hermes.
  • Offline cache with pluggable storage: MemoryAdapter, IndexedDBAdapter on the web, and KeyValueAdapter for
    expo-sqlite kv-store, MMKV (fromMMKV) and AsyncStorage on native.
  • React: TinodeProvider, TinodeStoresProvider, createTinode, and the hooks useTinode, useConnection,
    useLogin, useMeTopic, useTopic, useMessages and useTyping.
  • 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-sqlite on native.

Docs

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.Z tag on main, with npm trusted publishing and
    provenance. A version that is already on npm is not published again.

Contributors