Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If you are using GitHub pages for hosting, this command is a convenient way to b
We truly appreciate your interest in this project!
This project is **community-maintained**, which means it's **not officially supported** by our support team.

If you need help, have found a bug, or want to contribute improvements, the best place to do that is right here by [opening a GitHub issue](https://github.com/Couchbase-Ecosystem/cbl-reactnative-docs/issues).
If you need help, have found a bug, or want to contribute improvements, the best place to do that is right here - by [opening a GitHub issue](https://github.com/couchbase/cbl-reactnative-docs/issues).
Our support portal is unable to assist with requests related to this project, so we kindly ask that all inquiries stay within GitHub.

Your collaboration helps us all move forward together thank you!
Your collaboration helps us all move forward together - thank you!
64 changes: 34 additions & 30 deletions docs/DataSync/remote-sync-gateway.md

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions docs/Guides/Migration/v1.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
id: migration-guide-v1-1
sidebar_position: 2
---

# Version 1.1

> Description - _Quick reference for customer-facing changes in @couchbase/couchbase-lite-react-native version 1.1_
> Related Content - [Release Notes](../../ProductNotes/release-notes.md) | [Using Logs](../../Troubleshooting/using-logs.md)

## At a Glance

Version 1.1 is focused on React Native New Architecture support and better troubleshooting:

1. **TurboModules** - iOS and Android modules now support the React Native New Architecture.
2. **Improved file logging** - React Native wrapper diagnostics can be written to file and custom log sinks.
3. **LogSinks.write()** - application code can write messages into configured Couchbase Lite log sinks.
4. **Reliability fixes** - listener cleanup, document expiration, and conflict-aware deletes are improved.
5. **Official npm package** - published as `@couchbase/couchbase-lite-react-native`, replacing the legacy `cbl-reactnative` package.

## NPM Package Rename

Version 1.1 is published on npm as [`@couchbase/couchbase-lite-react-native`](https://www.npmjs.com/package/@couchbase/couchbase-lite-react-native). The legacy unscoped package `cbl-reactnative` (1.0.1 and earlier) is superseded. New installs and upgrades should use the scoped package.

| What to update | Before (`cbl-reactnative`) | After (`@couchbase/couchbase-lite-react-native`) |
|---|---|---|
| Install | `npm install cbl-reactnative` | `npm install @couchbase/couchbase-lite-react-native` |
| TypeScript imports | `from 'cbl-reactnative'` | `from '@couchbase/couchbase-lite-react-native'` |
| Android Gradle path | `node_modules/cbl-reactnative/android/build.gradle` | `node_modules/@couchbase/couchbase-lite-react-native/android/build.gradle` |
| Expo plugin podspec path | `node_modules/cbl-reactnative/cbl-reactnative.podspec` | `node_modules/@couchbase/couchbase-lite-react-native/cbl-reactnative.podspec` |

**Upgrade checklist:**

1. Remove `cbl-reactnative` from `package.json`
2. Install `@couchbase/couchbase-lite-react-native`
3. Update all import paths and native wiring paths
4. Rebuild native projects (`pod install`, Gradle clean build)

## TurboModule Support

Version 1.1 supports [React Native New Architecture](https://reactnative.dev/architecture/overview) through TurboModules. Existing application-level Couchbase Lite APIs remain largely compatible, but New Architecture should be enabled to use the TurboModule implementation.

For Expo development builds, enable New Architecture in `app.json`:

```json
{
"expo": {
"newArchEnabled": true
}
}
```

For React Native Android projects, make sure `newArchEnabled=true` is set in the Android project configuration.

## Logging Changes

### React Native Logs in File and Custom Sinks

When a file or custom log sink is enabled, version 1.1 can forward React Native wrapper diagnostics into the same logging pipeline as native Couchbase Lite logs.

React Native-originated lines are prefixed with `RN`:

```text
RN ::DEBUG:: database_Open
RN ::WARNING:: query_RemoveChangeListener rejected: no listener for token
RN ::ERROR:: collection_Save failed
```

This helps diagnose issues that cross the JavaScript/native boundary while keeping sensitive payloads out of forwarded logs.

### Writing Application Logs

Use `LogSinks.write()` to write application messages into configured Couchbase Lite sinks:

```typescript
import { LogSinks, LogLevel, LogDomain } from '@couchbase/couchbase-lite-react-native';

await LogSinks.write(
LogLevel.WARNING,
LogDomain.DATABASE,
'Retrying database open after transient failure'
);
```

## Smaller Behavior Improvements

- Passing `null` to `setDocumentExpiration()` clears a document expiration.
- Delete operations using `ConcurrencyControl.FAIL_ON_CONFLICT` reject stale revisions more consistently.
- Query, collection, and replicator listener routing is more consistent on New Architecture builds.
- Android replication filters support JavaScript arrow functions.
- `FileSystem.getFilesInDirectory(path)` can list generated log files.

## Repository Links

- [@couchbase/couchbase-lite-react-native on npm](https://www.npmjs.com/package/@couchbase/couchbase-lite-react-native)
- [couchbase/couchbase-lite-react-native](https://github.com/couchbase/couchbase-lite-react-native)
- [couchbase/couchbase-lite-js-common](https://github.com/couchbase/couchbase-lite-js-common)
8 changes: 4 additions & 4 deletions docs/Guides/Migration/v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ sidebar_position: 1

# Version 1.0

> Description _Quick reference for all API changes in cbl-reactnative version 1.0_
> Related Content [Release Notes](../../ProductNotes/release-notes.md) | [Using Logs](../../Troubleshooting/using-logs.md)
> Description - _Quick reference for all API changes in @couchbase/couchbase-lite-react-native version 1.0_
> Related Content - [Release Notes](../../ProductNotes/release-notes.md) | [Using Logs](../../Troubleshooting/using-logs.md)

:::important AT A GLANCE
Version 1.0 introduces several API changes:
Expand Down Expand Up @@ -54,7 +54,7 @@ await Database.setLogLevel(LogDomain.DATABASE, LogLevel.INFO);

**NEW (Required in 1.0):**
```typescript
import { LogSinks, LogLevel, LogDomain } from 'cbl-reactnative';
import { LogSinks, LogLevel, LogDomain } from '@couchbase/couchbase-lite-react-native';

await LogSinks.setConsole({
level: LogLevel.VERBOSE,
Expand Down Expand Up @@ -85,7 +85,7 @@ const replicator = await Replicator.create(config);

**NEW (Recommended in 1.0):**
```typescript
import { CollectionConfiguration } from 'cbl-reactnative';
import { CollectionConfiguration } from '@couchbase/couchbase-lite-react-native';

const collectionConfig = new CollectionConfiguration(collection);
const config = new ReplicatorConfiguration([collectionConfig], endpoint);
Expand Down
6 changes: 5 additions & 1 deletion docs/ProductNotes/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ sidebar_position: 2
Supported iOS and Android versions are dependent on React Native. See the [React Native Documentation](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md) documentation for more information.
:::

The cbl-reactnative library is build against the native SDK for iOS and Android. The current version of the native SDK is 3.2.0. To see the compatibility notes for the native SDK, see the following documentation:
The @couchbase/couchbase-lite-react-native library is built against Couchbase Lite Enterprise for iOS and Android. Version 1.1 uses Couchbase Lite Android Enterprise 3.3.3 and Couchbase Lite Swift Enterprise 3.3.3.

Version 1.1 supports [React Native New Architecture](https://reactnative.dev/architecture/overview) through TurboModules. Apps should use React Native 0.76.3 or higher and enable New Architecture for the TurboModule path.

To see the compatibility notes for the native SDK, see the following documentation:

- [Couchbase Mobile Compatibility Guide - iOS](https://docs.couchbase.com/couchbase-lite/current/swift/supported-os.html).

Expand Down
40 changes: 36 additions & 4 deletions docs/ProductNotes/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,38 @@ sidebar_position: 1

# Release Notes

**1.1.0** (June 2026)

New Features:
- Official React Native New Architecture / TurboModule support for iOS and Android native modules.
- Improved file logging: React Native wrapper diagnostics can now be forwarded into configured file and custom log sinks.
- React Native-originated log lines are prefixed with `RN ::LEVEL::` so they are easy to distinguish from native Couchbase Lite log output.
- `LogSinks.write()` API for writing app-authored messages into the Couchbase Lite logging pipeline.
- `FileSystem.getFilesInDirectory(path)` API for listing files in a directory, useful when discovering generated log files.

Improvements and Fixes:
- Updated Couchbase Lite Android and iOS Enterprise SDKs to 3.3.3.
- Improved listener reliability for collection, query, and replicator events on the New Architecture event path.
- Replicator event payloads now include error fields where applicable.
- Document expiration handling now supports clearing expiration with `null` and uses stricter UTC ISO-8601 parsing.
- Delete operations using `ConcurrencyControl.FAIL_ON_CONFLICT` now honor revision IDs more consistently.
- Android replicator filters can use JavaScript arrow functions in the V8 evaluation path.

Repository Updates:
- Official npm package: [@couchbase/couchbase-lite-react-native](https://www.npmjs.com/package/@couchbase/couchbase-lite-react-native)
- The legacy `cbl-reactnative` package is superseded; new installs and upgrades should use the scoped package
- Main React Native repository: [couchbase/couchbase-lite-react-native](https://github.com/couchbase/couchbase-lite-react-native)
- Shared JavaScript library repository: [couchbase/couchbase-lite-js-common](https://github.com/couchbase/couchbase-lite-js-common)

Migration from 1.0.x:
- Existing application-level APIs remain largely compatible.
- Enable React Native New Architecture to use the TurboModule implementation.
- Review logging setup if you want React Native wrapper logs included in file or custom log sinks.

See [Migration Guide](../Guides/Migration/v1.1.md) for detailed instructions.

---

**1.0.0** (December 2025)

New Features:
Expand Down Expand Up @@ -46,14 +78,14 @@ See [Migration Guide](../Guides/Migration/v1.md) for detailed instructions.
---

**0.6.3**
- Array handling and improve blob data validation in DataAdapter [null-pointer issue](https://github.com/Couchbase-Ecosystem/cbl-reactnative/pull/73)
- Array handling and improve blob data validation in DataAdapter [null-pointer issue](https://github.com/couchbase/couchbase-lite-react-native/pull/73)
- Fix a crash caused by improper handling of encryption key

**0.6.1**
- Implemented [Collection Change Listeners](https://github.com/Couchbase-Ecosystem/cbl-reactnative/pull/54) on Android
- Implemented [Query Change Listeners](https://github.com/Couchbase-Ecosystem/cbl-reactnative/pull/55) on Android
- Implemented [Collection Change Listeners](https://github.com/couchbase/couchbase-lite-react-native/pull/54) on Android
- Implemented [Query Change Listeners](https://github.com/couchbase/couchbase-lite-react-native/pull/55) on Android
- Fixed data adapter issues and improved testing
- Fixed [issue](https://github.com/Couchbase-Ecosystem/cbl-reactnative/issues/38) related to collection `getDocument` always pulling blob content
- Fixed [issue](https://github.com/couchbase/couchbase-lite-react-native/issues/38) related to collection `getDocument` always pulling blob content

**0.5.0**
- Implemented Collection Document Change
Expand Down
12 changes: 8 additions & 4 deletions docs/Queries/live-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar_position: 6

## Activating a Live Query

A live query is a query that, once activated, remains active and monitors the database for changes; refreshing the result set whenever a change occurs. As such, it is a great way to build reactive user interfaces — especially table/list views — that keep themselves up to date.
A live query is a query that, once activated, remains active and monitors the database for changes; refreshing the result set whenever a change occurs. As such, it is a great way to build reactive user interfaces - especially table/list views - that keep themselves up to date.

**So, a simple use case may be:** A replicator running and pulling new data from a server, whilst a live-query-driven UI automatically updates to show the data without the user having to manually refresh. This helps your app feel quick and responsive.

Expand All @@ -23,7 +23,7 @@ Each time you start watching a live query, the query is executed and an initial
#### Example 1. Starting a Live Query - Change Listener

```typescript
import { ListenerToken } from 'cbl-reactnative';
import { ListenerToken } from '@couchbase/couchbase-lite-react-native';

// Register a change listener
const token: ListenerToken = await query.addChangeListener((change) => {
Expand All @@ -44,6 +44,10 @@ const token: ListenerToken = await query.addChangeListener((change) => {
Change listeners now return a `ListenerToken` object with a `remove()` method for cleanup.
:::

:::note Version 1.1
Live query listeners use the TurboModule typed event path on New Architecture builds. This improves listener routing and cleanup consistency across iOS and Android.
:::

#### Example 2. Stopping a Live Query - Change Listener

```typescript
Expand Down Expand Up @@ -78,7 +82,7 @@ interface QueryChange {
#### Example 3. Complete Live Query with Error Handling

```typescript
import { ListenerToken } from 'cbl-reactnative';
import { ListenerToken } from '@couchbase/couchbase-lite-react-native';

const query = database.createQuery(
'SELECT META().id, name, email FROM _default.users WHERE isActive = true'
Expand All @@ -104,7 +108,7 @@ await token.remove();

```typescript
import { useEffect, useState } from 'react';
import { ListenerToken } from 'cbl-reactnative';
import { ListenerToken } from '@couchbase/couchbase-lite-react-native';

function ActiveUsersScreen({ database }) {
const [users, setUsers] = useState([]);
Expand Down
26 changes: 13 additions & 13 deletions docs/Queries/query-troubleshooeting.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cblite <your-database-name>.cblite2

### Output

The output from explain() remains the same whether invoked by an app, or cblite — see [Example 3](#example-3-queryexplain-output) for an example of how it looks.
The output from explain() remains the same whether invoked by an app, or cblite - see [Example 3](#example-3-queryexplain-output) for an example of how it looks.

#### Example 3. Query.explain() Output

Expand All @@ -66,7 +66,7 @@ This output ([Example 3](#example-3-queryexplain-output)) comprises three main e

### Format

The query plan section of the output displays a tabular form of the translated query's execution plan. It primarily shows how the data will be retrieved and, where appropriate, how it will be sorted for navigation and-or presentation purposes. For more on SQLite's Explain Query Plan see: https://www.sqlite.org/eqp.html.
The query plan section of the output displays a tabular form of the translated query's execution plan. It primarily shows how the data will be retrieved and, where appropriate, how it will be sorted for navigation and-or presentation purposes. For more on SQLite's Explain Query Plan - see: https://www.sqlite.org/eqp.html.

#### Example 4. A Query Plan

Expand All @@ -76,22 +76,22 @@ The query plan section of the output displays a tabular form of the translated q
52|0|0| USE TEMP B-TREE FOR ORDER BY
```

1. **Retrieval method** This line shows the retrieval method being used for
1. **Retrieval method** - This line shows the retrieval method being used for
the query; here a sequential read of the database. Something you may well be
looking to optimize see [Retrieval Method](#retrieval-method) for more.
looking to optimize - see [Retrieval Method](#retrieval-method) for more.
2. **Grouping method** --- This line shows that the `GROUP BY` clause used in
the query requires the data to be sorted and that a b-tree will be used for
temporary storage see [Order and Group](#order-and-group).
3. **Ordering method** This line shows that the `ORDER BY` clause used in the
temporary storage - see [Order and Group](#order-and-group).
3. **Ordering method** - This line shows that the `ORDER BY` clause used in the
query requires the data to be sorted and that a b-tree will be used for
temporary storage see [Order and Group](#order-and-group).
temporary storage - see [Order and Group](#order-and-group).

### Retrieval Method {#retrieval-method}

The query optimizer will attempt to retrieve the requested data items as
efficiently as possible, which generally will be by using one or more of the
available indexes. The retrieval method shows the approach decided upon by the
optimizer see [Table 1](#).
optimizer - see [Table 1](#).

#### Table 1. Retrieval Methods

Expand All @@ -104,7 +104,7 @@ optimizer — see [Table 1](#).
When looking to optimize a query's retrieval method, consider whether:

- Providing an additional index makes sense.
- You could use an existing index perhaps by restructuring the query to
- You could use an existing index - perhaps by restructuring the query to
minimize wildcard use, or the reliance on functions that modify the query's
interpretation of index keys (for example, 'lower').
- You could reduce the data set being requested to minimize the query's
Expand Down Expand Up @@ -164,14 +164,14 @@ after certain events, such as:
- On a database close
- When running a database compact.

So, if your analysis of the [Query Explain output](#example-3) indicates a
So, if your analysis of the [Query Explain output](#example-3-queryexplain-output) indicates a
sub-optimal query and your rewrites fail to sufficiently optimize it, consider
compacting the database. Then re-generate the Query Explain and note any
improvements in optimization. They may not, in themselves, resolve the issue
entirely; but they can provide a uesful guide toward further optimizing changes
you could make.

## Wildcard and Like-based Queries
## Wildcard and Like-based Queries {#wildcard-queries}

Like-based searches can use the index(es) only if:

Expand All @@ -188,7 +188,7 @@ query plan decides on a retrieval method of `SCAN TABLE`.

:::tip

For more on indexes — see: [Indexing](../indexes.md).
For more on indexes - see: [Indexing](../indexes.md).

:::

Expand Down Expand Up @@ -323,5 +323,5 @@ for your next batch and-so-on.
Optimize document size in design. Smaller documents load more quickly. Break
your data into logical linked units.

Consider Using Full Text Search instead of complex `LIKE` or `REGEX` patterns
Consider Using Full Text Search instead of complex `LIKE` or `REGEX` patterns -
see [Full Text Search](../full-text-search.md).
4 changes: 2 additions & 2 deletions docs/Queries/sqlplusplus-mobile-and-server-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SQL++ for Mobile's boolean logic rules are based on SQLite's, so:
- Numbers `0` or `0.0` are `FALSE`
- Arrays and dictionaries are `FALSE`
- String and Blob are `TRUE` if the values are casted as a non-zero or `FALSE`
if the values are casted as `0` or `0.0` — see:
if the values are casted as `0` or `0.0` - see:
[SQLITE's CAST and Boolean expressions](https://sqlite.org/lang_expr.html) for
more details.
- `NULL` is `FALSE`
Expand All @@ -77,7 +77,7 @@ Logical operations with the `MISSING` value could result in `TRUE` or `FALSE` if
the result can be determined regardless of the missing value, otherwise the
result will be `MISSING`.

In SQL++ for Mobile — unlike SQL++ for Server `NULL` is implicitly converted
In SQL++ for Mobile - unlike SQL++ for Server - `NULL` is implicitly converted
to `FALSE` before evaluating logical operations. [Table 2](#table-2-logical-operations-comparison) summarizes the
result of logical operations with different operand values and also shows where
the Couchbase Server behavior differs.
Expand Down
Loading
Loading