Skip to content

Commit c8d2efa

Browse files
Enhance documentation with migration guide for version 1.0, update breaking changes section, and adjust category positions for guides and product notes.
1 parent 249a1a6 commit c8d2efa

5 files changed

Lines changed: 32 additions & 36 deletions

File tree

docs/Guides/Migration/v1.md

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: migration-guide-v1
33
sidebar_position: 1
44
---
55

6-
# Migration Guide: Version 1.0
6+
# Version 1.0
77

88
> Description — _Quick reference for all API changes in cbl-reactnative version 1.0_
99
> Related Content — [Release Notes](../../ProductNotes/release-notes.md) | [Using Logs](../../Troubleshooting/using-logs.md)
@@ -16,6 +16,29 @@ Version 1.0 introduces several API changes:
1616
3. **New ReplicatorConfiguration** - Collections passed in constructor
1717
:::
1818

19+
## Breaking Changes
20+
21+
### Listener Token Return Type (TypeScript)
22+
23+
We changed all `addChangeListener` functions to return a `ListenerToken` instead of a `string`, enabling the new `token.remove()` API and aligning with other platforms.
24+
25+
This is a breaking change **only for TypeScript code** that explicitly typed the token as `string`. JavaScript users and untyped TypeScript won't be affected.
26+
27+
**TypeScript Migration Example:**
28+
29+
```typescript
30+
// BEFORE (TypeScript compilation error in 1.0)
31+
const token: string = await collection.addChangeListener(listener);
32+
33+
// AFTER
34+
const token: ListenerToken = await collection.addChangeListener(listener);
35+
token.remove();
36+
```
37+
38+
The existing `removeChangeListener(token)` methods remain available for backward compatibility but are deprecated.
39+
40+
---
41+
1942
## Deprecated APIs
2043

2144
### 1. Logging API
@@ -75,7 +98,7 @@ See: [Remote Sync](../../DataSync/remote-sync-gateway.md#example-1-replication-c
7598

7699
---
77100

78-
### 3. Listener Removal Methods
101+
### 3. Listener Removal Methods (Deprecated)
79102

80103
**OLD (Deprecated in 1.0):**
81104
```typescript
@@ -93,27 +116,6 @@ This method is deprecated. It remains available for backward compatibility, but
93116

94117
---
95118

96-
### 4. Listener Token Return Type (TypeScript)
97-
98-
We changed all `addChangeListener` functions to return a `ListenerToken` instead of a `string`, enabling the new `token.remove()` API and aligning with other platforms.
99-
100-
This is a small breaking change **only for TypeScript code** that explicitly typed the token as `string`. JavaScript users and untyped TypeScript won't be affected.
101-
102-
**TypeScript Migration Example:**
103-
104-
```typescript
105-
// BEFORE (TypeScript compilation error in 1.0)
106-
const token: string = await collection.addChangeListener(listener);
107-
108-
// AFTER
109-
const token: ListenerToken = await collection.addChangeListener(listener);
110-
token.remove();
111-
```
112-
113-
The existing `removeChangeListener(token)` methods remain available for backward compatibility but are deprecated.
114-
115-
---
116-
117119
## New Features in 1.0
118120

119121
### 1. Three Log Sink Types
@@ -234,16 +236,6 @@ await collection.removeChangeListener(token);
234236
await token.remove();
235237
```
236238

237-
**Step 4: Update TypeScript Token Types (Required for TypeScript)**
238-
239-
```typescript
240-
// Old (compilation error)
241-
const token: string = await collection.addChangeListener(...);
242-
243-
// New
244-
const token: ListenerToken = await collection.addChangeListener(...);
245-
```
246-
247239
---
248240

249241
## Important Property Names

docs/Guides/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Guides",
3-
"position": 10,
3+
"position": 17,
44
"collapsible": true,
55
"collapsed": false
66
}

docs/ProductNotes/_category_.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label": "Product Notes",
3-
"position": 17,
3+
"position": 18,
44
"link": {
55
"type": "generated-index",
66
"description": "Learn more about releases, compatibility, and supported platforms."

docs/ProductNotes/release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ New Features:
1818
- Replicator Document Change Listeners - Track individual document replication
1919
- New ReplicatorConfiguration API - Collections passed during initialization using CollectionConfiguration
2020
- Collection.fullName() method - Get fully qualified collection name (scope.collection)
21-
- Couchbase Lite 3.3.0 - Updated iOS and Android SDKs to latest stable version
21+
- Couchbase Lite 3.3.0 - Updated iOS and Android SDKs to Couchbase Lite 3.3.0
2222

2323
Breaking Changes:
2424
- TypeScript: ListenerToken type changed from string to ListenerToken object (affects explicitly typed code only)

docs/intro.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ Couchbase Lite for React Native is a community provided solution that is activel
5050
* Encryption
5151
- Full Database
5252

53+
## Upgrading from 0.6.x?
54+
55+
See the [Migration Guide](Guides/Migration/v1.md) for detailed instructions on upgrading to version 1.0.
56+
5357
## Limitations
5458
Some of the features supported by other platform implementations of Couchbase Lite are currently not supported:
5559

0 commit comments

Comments
 (0)