Skip to content

Commit 185ac76

Browse files
authored
Merge pull request #14 from couchbase/docs_1_1
Docs 1 1
2 parents b549bf4 + 62075aa commit 185ac76

60 files changed

Lines changed: 6040 additions & 140 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ If you are using GitHub pages for hosting, this command is a convenient way to b
4747
We truly appreciate your interest in this project!
4848
This project is **community-maintained**, which means it's **not officially supported** by our support team.
4949

50-
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).
50+
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).
5151
Our support portal is unable to assist with requests related to this project, so we kindly ask that all inquiries stay within GitHub.
5252

53-
Your collaboration helps us all move forward together thank you!
53+
Your collaboration helps us all move forward together - thank you!

docs/DataSync/remote-sync-gateway.md

Lines changed: 34 additions & 30 deletions
Large diffs are not rendered by default.

docs/Guides/Migration/v1.1.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
id: migration-guide-v1-1
3+
sidebar_position: 2
4+
---
5+
6+
# Version 1.1
7+
8+
> Description - _Quick reference for customer-facing changes in @couchbase/couchbase-lite-react-native version 1.1_
9+
> Related Content - [Release Notes](../../ProductNotes/release-notes.md) | [Using Logs](../../Troubleshooting/using-logs.md)
10+
11+
## At a Glance
12+
13+
Version 1.1 is focused on React Native New Architecture support and better troubleshooting:
14+
15+
1. **TurboModules** - iOS and Android modules now support the React Native New Architecture.
16+
2. **Improved file logging** - React Native wrapper diagnostics can be written to file and custom log sinks.
17+
3. **LogSinks.write()** - application code can write messages into configured Couchbase Lite log sinks.
18+
4. **Reliability fixes** - listener cleanup, document expiration, and conflict-aware deletes are improved.
19+
5. **Official npm package** - published as `@couchbase/couchbase-lite-react-native`, replacing the legacy `cbl-reactnative` package.
20+
21+
## NPM Package Rename
22+
23+
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.
24+
25+
| What to update | Before (`cbl-reactnative`) | After (`@couchbase/couchbase-lite-react-native`) |
26+
|---|---|---|
27+
| Install | `npm install cbl-reactnative` | `npm install @couchbase/couchbase-lite-react-native` |
28+
| TypeScript imports | `from 'cbl-reactnative'` | `from '@couchbase/couchbase-lite-react-native'` |
29+
| Android Gradle path | `node_modules/cbl-reactnative/android/build.gradle` | `node_modules/@couchbase/couchbase-lite-react-native/android/build.gradle` |
30+
| Expo plugin podspec path | `node_modules/cbl-reactnative/cbl-reactnative.podspec` | `node_modules/@couchbase/couchbase-lite-react-native/cbl-reactnative.podspec` |
31+
32+
**Upgrade checklist:**
33+
34+
1. Remove `cbl-reactnative` from `package.json`
35+
2. Install `@couchbase/couchbase-lite-react-native`
36+
3. Update all import paths and native wiring paths
37+
4. Rebuild native projects (`pod install`, Gradle clean build)
38+
39+
## TurboModule Support
40+
41+
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.
42+
43+
For Expo development builds, enable New Architecture in `app.json`:
44+
45+
```json
46+
{
47+
"expo": {
48+
"newArchEnabled": true
49+
}
50+
}
51+
```
52+
53+
For React Native Android projects, make sure `newArchEnabled=true` is set in the Android project configuration.
54+
55+
## Logging Changes
56+
57+
### React Native Logs in File and Custom Sinks
58+
59+
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.
60+
61+
React Native-originated lines are prefixed with `RN`:
62+
63+
```text
64+
RN ::DEBUG:: database_Open
65+
RN ::WARNING:: query_RemoveChangeListener rejected: no listener for token
66+
RN ::ERROR:: collection_Save failed
67+
```
68+
69+
This helps diagnose issues that cross the JavaScript/native boundary while keeping sensitive payloads out of forwarded logs.
70+
71+
### Writing Application Logs
72+
73+
Use `LogSinks.write()` to write application messages into configured Couchbase Lite sinks:
74+
75+
```typescript
76+
import { LogSinks, LogLevel, LogDomain } from '@couchbase/couchbase-lite-react-native';
77+
78+
await LogSinks.write(
79+
LogLevel.WARNING,
80+
LogDomain.DATABASE,
81+
'Retrying database open after transient failure'
82+
);
83+
```
84+
85+
## Smaller Behavior Improvements
86+
87+
- Passing `null` to `setDocumentExpiration()` clears a document expiration.
88+
- Delete operations using `ConcurrencyControl.FAIL_ON_CONFLICT` reject stale revisions more consistently.
89+
- Query, collection, and replicator listener routing is more consistent on New Architecture builds.
90+
- Android replication filters support JavaScript arrow functions.
91+
- `FileSystem.getFilesInDirectory(path)` can list generated log files.
92+
93+
## Repository Links
94+
95+
- [@couchbase/couchbase-lite-react-native on npm](https://www.npmjs.com/package/@couchbase/couchbase-lite-react-native)
96+
- [couchbase/couchbase-lite-react-native](https://github.com/couchbase/couchbase-lite-react-native)
97+
- [couchbase/couchbase-lite-js-common](https://github.com/couchbase/couchbase-lite-js-common)

docs/Guides/Migration/v1.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ sidebar_position: 1
55

66
# Version 1.0
77

8-
> Description _Quick reference for all API changes in cbl-reactnative version 1.0_
9-
> Related Content [Release Notes](../../ProductNotes/release-notes.md) | [Using Logs](../../Troubleshooting/using-logs.md)
8+
> Description - _Quick reference for all API changes in @couchbase/couchbase-lite-react-native version 1.0_
9+
> Related Content - [Release Notes](../../ProductNotes/release-notes.md) | [Using Logs](../../Troubleshooting/using-logs.md)
1010
1111
:::important AT A GLANCE
1212
Version 1.0 introduces several API changes:
@@ -54,7 +54,7 @@ await Database.setLogLevel(LogDomain.DATABASE, LogLevel.INFO);
5454

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

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

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

9090
const collectionConfig = new CollectionConfiguration(collection);
9191
const config = new ReplicatorConfiguration([collectionConfig], endpoint);

docs/ProductNotes/compatibility.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ sidebar_position: 2
99
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.
1010
:::
1111

12-
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:
12+
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.
13+
14+
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.
15+
16+
To see the compatibility notes for the native SDK, see the following documentation:
1317

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

docs/ProductNotes/release-notes.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,38 @@ sidebar_position: 1
55

66
# Release Notes
77

8+
**1.1.0** (June 2026)
9+
10+
New Features:
11+
- Official React Native New Architecture / TurboModule support for iOS and Android native modules.
12+
- Improved file logging: React Native wrapper diagnostics can now be forwarded into configured file and custom log sinks.
13+
- React Native-originated log lines are prefixed with `RN ::LEVEL::` so they are easy to distinguish from native Couchbase Lite log output.
14+
- `LogSinks.write()` API for writing app-authored messages into the Couchbase Lite logging pipeline.
15+
- `FileSystem.getFilesInDirectory(path)` API for listing files in a directory, useful when discovering generated log files.
16+
17+
Improvements and Fixes:
18+
- Updated Couchbase Lite Android and iOS Enterprise SDKs to 3.3.3.
19+
- Improved listener reliability for collection, query, and replicator events on the New Architecture event path.
20+
- Replicator event payloads now include error fields where applicable.
21+
- Document expiration handling now supports clearing expiration with `null` and uses stricter UTC ISO-8601 parsing.
22+
- Delete operations using `ConcurrencyControl.FAIL_ON_CONFLICT` now honor revision IDs more consistently.
23+
- Android replicator filters can use JavaScript arrow functions in the V8 evaluation path.
24+
25+
Repository Updates:
26+
- Official npm package: [@couchbase/couchbase-lite-react-native](https://www.npmjs.com/package/@couchbase/couchbase-lite-react-native)
27+
- The legacy `cbl-reactnative` package is superseded; new installs and upgrades should use the scoped package
28+
- Main React Native repository: [couchbase/couchbase-lite-react-native](https://github.com/couchbase/couchbase-lite-react-native)
29+
- Shared JavaScript library repository: [couchbase/couchbase-lite-js-common](https://github.com/couchbase/couchbase-lite-js-common)
30+
31+
Migration from 1.0.x:
32+
- Existing application-level APIs remain largely compatible.
33+
- Enable React Native New Architecture to use the TurboModule implementation.
34+
- Review logging setup if you want React Native wrapper logs included in file or custom log sinks.
35+
36+
See [Migration Guide](../Guides/Migration/v1.1.md) for detailed instructions.
37+
38+
---
39+
840
**1.0.0** (December 2025)
941

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

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

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

5890
**0.5.0**
5991
- Implemented Collection Document Change

docs/Queries/live-queries.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar_position: 6
1010
1111
## Activating a Live Query
1212

13-
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.
13+
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.
1414

1515
**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.
1616

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

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

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

47+
:::note Version 1.1
48+
Live query listeners use the TurboModule typed event path on New Architecture builds. This improves listener routing and cleanup consistency across iOS and Android.
49+
:::
50+
4751
#### Example 2. Stopping a Live Query - Change Listener
4852

4953
```typescript
@@ -78,7 +82,7 @@ interface QueryChange {
7882
#### Example 3. Complete Live Query with Error Handling
7983

8084
```typescript
81-
import { ListenerToken } from 'cbl-reactnative';
85+
import { ListenerToken } from '@couchbase/couchbase-lite-react-native';
8286

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

105109
```typescript
106110
import { useEffect, useState } from 'react';
107-
import { ListenerToken } from 'cbl-reactnative';
111+
import { ListenerToken } from '@couchbase/couchbase-lite-react-native';
108112

109113
function ActiveUsersScreen({ database }) {
110114
const [users, setUsers] = useState([]);

docs/Queries/query-troubleshooeting.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ cblite <your-database-name>.cblite2
4242
4343
### Output
4444
45-
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.
45+
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.
4646
4747
#### Example 3. Query.explain() Output
4848
@@ -66,7 +66,7 @@ This output ([Example 3](#example-3-queryexplain-output)) comprises three main e
6666
6767
### Format
6868
69-
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.
69+
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.
7070
7171
#### Example 4. A Query Plan
7272
@@ -76,22 +76,22 @@ The query plan section of the output displays a tabular form of the translated q
7676
52|0|0| USE TEMP B-TREE FOR ORDER BY
7777
```
7878
79-
1. **Retrieval method** This line shows the retrieval method being used for
79+
1. **Retrieval method** - This line shows the retrieval method being used for
8080
the query; here a sequential read of the database. Something you may well be
81-
looking to optimize see [Retrieval Method](#retrieval-method) for more.
81+
looking to optimize - see [Retrieval Method](#retrieval-method) for more.
8282
2. **Grouping method** --- This line shows that the `GROUP BY` clause used in
8383
the query requires the data to be sorted and that a b-tree will be used for
84-
temporary storage see [Order and Group](#order-and-group).
85-
3. **Ordering method** This line shows that the `ORDER BY` clause used in the
84+
temporary storage - see [Order and Group](#order-and-group).
85+
3. **Ordering method** - This line shows that the `ORDER BY` clause used in the
8686
query requires the data to be sorted and that a b-tree will be used for
87-
temporary storage see [Order and Group](#order-and-group).
87+
temporary storage - see [Order and Group](#order-and-group).
8888
8989
### Retrieval Method {#retrieval-method}
9090
9191
The query optimizer will attempt to retrieve the requested data items as
9292
efficiently as possible, which generally will be by using one or more of the
9393
available indexes. The retrieval method shows the approach decided upon by the
94-
optimizer see [Table 1](#).
94+
optimizer - see [Table 1](#).
9595
9696
#### Table 1. Retrieval Methods
9797
@@ -104,7 +104,7 @@ optimizer — see [Table 1](#).
104104
When looking to optimize a query's retrieval method, consider whether:
105105
106106
- Providing an additional index makes sense.
107-
- You could use an existing index perhaps by restructuring the query to
107+
- You could use an existing index - perhaps by restructuring the query to
108108
minimize wildcard use, or the reliance on functions that modify the query's
109109
interpretation of index keys (for example, 'lower').
110110
- You could reduce the data set being requested to minimize the query's
@@ -164,14 +164,14 @@ after certain events, such as:
164164
- On a database close
165165
- When running a database compact.
166166
167-
So, if your analysis of the [Query Explain output](#example-3) indicates a
167+
So, if your analysis of the [Query Explain output](#example-3-queryexplain-output) indicates a
168168
sub-optimal query and your rewrites fail to sufficiently optimize it, consider
169169
compacting the database. Then re-generate the Query Explain and note any
170170
improvements in optimization. They may not, in themselves, resolve the issue
171171
entirely; but they can provide a uesful guide toward further optimizing changes
172172
you could make.
173173
174-
## Wildcard and Like-based Queries
174+
## Wildcard and Like-based Queries {#wildcard-queries}
175175
176176
Like-based searches can use the index(es) only if:
177177
@@ -188,7 +188,7 @@ query plan decides on a retrieval method of `SCAN TABLE`.
188188
189189
:::tip
190190
191-
For more on indexes — see: [Indexing](../indexes.md).
191+
For more on indexes - see: [Indexing](../indexes.md).
192192
193193
:::
194194
@@ -323,5 +323,5 @@ for your next batch and-so-on.
323323
Optimize document size in design. Smaller documents load more quickly. Break
324324
your data into logical linked units.
325325
326-
Consider Using Full Text Search instead of complex `LIKE` or `REGEX` patterns
326+
Consider Using Full Text Search instead of complex `LIKE` or `REGEX` patterns -
327327
see [Full Text Search](../full-text-search.md).

docs/Queries/sqlplusplus-mobile-and-server-differences.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ SQL++ for Mobile's boolean logic rules are based on SQLite's, so:
6262
- Numbers `0` or `0.0` are `FALSE`
6363
- Arrays and dictionaries are `FALSE`
6464
- String and Blob are `TRUE` if the values are casted as a non-zero or `FALSE`
65-
if the values are casted as `0` or `0.0` — see:
65+
if the values are casted as `0` or `0.0` - see:
6666
[SQLITE's CAST and Boolean expressions](https://sqlite.org/lang_expr.html) for
6767
more details.
6868
- `NULL` is `FALSE`
@@ -77,7 +77,7 @@ Logical operations with the `MISSING` value could result in `TRUE` or `FALSE` if
7777
the result can be determined regardless of the missing value, otherwise the
7878
result will be `MISSING`.
7979

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

0 commit comments

Comments
 (0)