New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@react-native-replicache/react-native-op-sqlite

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-replicache/react-native-op-sqlite

> Plug-in React Native compatibility bindings for [Replicache](https://replicache.dev/).

latest
Source
npmnpm
Version
1.3.1
Version published
Weekly downloads
0
-100%
Maintainers
0
Weekly downloads
 
Created
Source

React Native Replicache

Plug-in React Native compatibility bindings for Replicache.

https://user-images.githubusercontent.com/5165963/219898954-f5e94045-69bf-4c33-84e8-7d152c6f2c32.mov

Replicache version compatibility

  • 1.0.0 : replicache <= 14.2.2
  • 1.3.0 : replicache >= 15

Why is this needed?

Replicache enables us to build applications that are performant, offline-capable and collaborative. By default, it uses IndexedDB for client-side persistance. Unfortunately, this technology is not available in React Native and is only supported in web-browsers.

Thankfully, Replicache allows us to provide our own transactional data-store via kvStore. The goal of this project is to provide some implementations of such a store, along with some guidance in getting up and running with Replicache in React Native.

What are the strategies?

React Native has relatively good support for SQLite - which provides the strict serializable transactions that we require.

Here we provide a store implementation backed by op-sqlite. However, we also offer more bindings here. Be sure to see what best fits your project!

Any additional considerations?

Some configuration is required to receive poke events from the server. In our example, seen here, we use a polyfill for Server Sent Events. These aren't built into React Native, but are really handy for a demo.

You most likely want to use web-sockets for this. This is relatively trivial with Pusher/Ably etc and similar to the web-app so we won't discuss that further here.

How can I install this?

  • Install the following in your React Native project:
    • yarn add expo-crypto @op-engineering/op-sqlite @react-native-replicache/react-native-op-sqlite
  • Ensure that you've polyfilled crypto.getRandomValues on the global namespace.
  • Pass in createReplicacheOPSQLiteKVStore to Replicache's kvStore option.

Keywords

react-native-replicache

FAQs

Package last updated on 28 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts