Skip to content

Commit 5c74b69

Browse files
authored
Merge pull request #13 from jayant-dhingra-cb/docs_1_1
Docs 1 1
2 parents 55b6bed + 91d20d0 commit 5c74b69

23 files changed

Lines changed: 186 additions & 69 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
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

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

docs/DataSync/remote-sync-gateway.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ import {
137137
BasicAuthenticator,
138138
Replicator,
139139
ListenerToken
140-
} from 'cbl-reactnative';
140+
} from '@couchbase/couchbase-lite-react-native';
141141

142142
// Create endpoint and authenticator
143143
const endpoint = new URLEndpoint('ws://localhost:4984/projects');
@@ -202,7 +202,7 @@ The `addCollection()` method is deprecated. It remains available for backward co
202202
The new API allows each collection to have its own replication settings:
203203

204204
```typescript
205-
import { CollectionConfiguration } from 'cbl-reactnative';
205+
import { CollectionConfiguration } from '@couchbase/couchbase-lite-react-native';
206206

207207
// Configure users collection
208208
const usersConfig = new CollectionConfiguration(usersCollection)
@@ -726,7 +726,7 @@ The returned *ReplicationStatus* structure comprises:
726726
#### Example 14. Monitor replication
727727

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

731731
const token: ListenerToken = await replicator.addChangeListener((change) => {
732732
const status = change.status;
@@ -764,7 +764,7 @@ interface ReplicatorStatusChange {
764764
#### Example 14b. Advanced Replication Status Monitoring
765765

766766
```typescript
767-
import { ListenerToken, ReplicatorActivityLevel } from 'cbl-reactnative';
767+
import { ListenerToken, ReplicatorActivityLevel } from '@couchbase/couchbase-lite-react-native';
768768

769769
const token: ListenerToken = await replicator.addChangeListener((change) => {
770770
const status = change.status;
@@ -851,7 +851,7 @@ For example, the code snippet in [Example 15](#example-15-register-a-document-li
851851
#### Example 15. Register a document listener
852852

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

856856
const token: ListenerToken = await replicator.addDocumentChangeListener((replication) => {
857857
const direction = replication.isPush ? "Push" : "Pull";
@@ -973,7 +973,7 @@ As always, when there is a problem with replication, logging is your friend. You
973973
#### Example 21. Set logging verbosity
974974

975975
```typescript
976-
import { LogSinks, LogLevel, LogDomain } from 'cbl-reactnative';
976+
import { LogSinks, LogLevel, LogDomain } from '@couchbase/couchbase-lite-react-native';
977977

978978
// Verbose / Replicator and Network
979979
await LogSinks.setConsole({

docs/Guides/Migration/v1.1.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_position: 2
55

66
# Version 1.1
77

8-
> Description - _Quick reference for customer-facing changes in cbl-reactnative version 1.1_
8+
> Description - _Quick reference for customer-facing changes in @couchbase/couchbase-lite-react-native version 1.1_
99
> Related Content - [Release Notes](../../ProductNotes/release-notes.md) | [Using Logs](../../Troubleshooting/using-logs.md)
1010
1111
## At a Glance
@@ -16,6 +16,25 @@ Version 1.1 is focused on React Native New Architecture support and better troub
1616
2. **Improved file logging** - React Native wrapper diagnostics can be written to file and custom log sinks.
1717
3. **LogSinks.write()** - application code can write messages into configured Couchbase Lite log sinks.
1818
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)
1938

2039
## TurboModule Support
2140

@@ -54,7 +73,7 @@ This helps diagnose issues that cross the JavaScript/native boundary while keepi
5473
Use `LogSinks.write()` to write application messages into configured Couchbase Lite sinks:
5574

5675
```typescript
57-
import { LogSinks, LogLevel, LogDomain } from 'cbl-reactnative';
76+
import { LogSinks, LogLevel, LogDomain } from '@couchbase/couchbase-lite-react-native';
5877

5978
await LogSinks.write(
6079
LogLevel.WARNING,
@@ -73,5 +92,6 @@ await LogSinks.write(
7392

7493
## Repository Links
7594

95+
- [@couchbase/couchbase-lite-react-native on npm](https://www.npmjs.com/package/@couchbase/couchbase-lite-react-native)
7696
- [couchbase/couchbase-lite-react-native](https://github.com/couchbase/couchbase-lite-react-native)
7797
- [couchbase/couchbase-lite-js-common](https://github.com/couchbase/couchbase-lite-js-common)

docs/Guides/Migration/v1.md

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

66
# Version 1.0
77

8-
> Description - _Quick reference for all API changes in cbl-reactnative version 1.0_
8+
> Description - _Quick reference for all API changes in @couchbase/couchbase-lite-react-native version 1.0_
99
> Related Content - [Release Notes](../../ProductNotes/release-notes.md) | [Using Logs](../../Troubleshooting/using-logs.md)
1010
1111
:::important AT A GLANCE
@@ -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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ 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 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.
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.
1313

1414
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.
1515

docs/ProductNotes/release-notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Improvements and Fixes:
2323
- Android replicator filters can use JavaScript arrow functions in the V8 evaluation path.
2424

2525
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
2628
- Main React Native repository: [couchbase/couchbase-lite-react-native](https://github.com/couchbase/couchbase-lite-react-native)
2729
- Shared JavaScript library repository: [couchbase/couchbase-lite-js-common](https://github.com/couchbase/couchbase-lite-js-common)
2830

docs/Queries/live-queries.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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) => {
@@ -82,7 +82,7 @@ interface QueryChange {
8282
#### Example 3. Complete Live Query with Error Handling
8383

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

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

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

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

docs/StartHere/build-run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
ReplicatorConfiguration,
3030
ReplicatorType,
3131
URLEndpoint
32-
} from 'cbl-reactnative';
32+
} from '@couchbase/couchbase-lite-react-native';
3333

3434

3535
async function runDbSample() : Promise<void> {

docs/StartHere/example-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Several example apps are available for developers to review. These apps are des
99

1010
## React Native Module Example App
1111

12-
The cbl-reactnative module has an example app in the repository's [expo-example](https://github.com/couchbase/couchbase-lite-react-native/tree/main/expo-example) folder. This example app is designed to show off all the various APIs and is used to test the Native Module during the development process.
12+
The @couchbase/couchbase-lite-react-native module has an example app in the repository's [expo-example](https://github.com/couchbase/couchbase-lite-react-native/tree/main/expo-example) folder. This example app is designed to show off all the various APIs and is used to test the Native Module during the development process.
1313

1414
## Expo Travel Sample App
1515

docs/StartHere/install.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This Native Module is currently under active development. If you find problems,
99
:::
1010

1111
:::note
12-
The version of this Native Module is based on supporting Couchbase Lite Enterprise for iOS and Android. This Native Module is not compatible with Couchbase Lite Community Edition. A [license](https://www.couchbase.com/pricing/) is required to use Couchbase Lite Enterprise edition.
12+
The version of this Native Module is based on supporting Couchbase Lite Enterprise for iOS and Android. A [license](https://www.couchbase.com/pricing/) is required to use Couchbase Lite Enterprise edition.
1313
:::
1414

1515
## Get Started
@@ -22,12 +22,18 @@ The installation for the Native Module is provided in two sections: one section
2222

2323
### React Native Based Apps
2424

25-
To use the Couchbase Lite React Native Native Module in a standard React Native app, you will need to install the npm package. From the root of your applications project directory (the directory containing your `package.json` file), run the following command:
25+
To use the Couchbase Lite React Native Native Module in a standard React Native app, you will need to install the npm package [@couchbase/couchbase-lite-react-native](https://www.npmjs.com/package/@couchbase/couchbase-lite-react-native). From the root of your applications project directory (the directory containing your `package.json` file), run one of the following commands:
2626

2727
```bash
28-
npm install cbl-reactnative
28+
npm install @couchbase/couchbase-lite-react-native
29+
# or
30+
yarn add @couchbase/couchbase-lite-react-native
2931
```
3032

33+
:::note
34+
New projects should install the scoped package above. Upgrading from the legacy `cbl-reactnative` package (1.0.1 and earlier)? See the [Version 1.1 Migration Guide](../Guides/Migration/v1.1.md#npm-package-rename).
35+
:::
36+
3137
Once installed, you will want to build each native project (iOS and Android) to link the native module to your project.
3238

3339
#### iOS
@@ -47,14 +53,14 @@ For React Native New Architecture builds, make sure `newArchEnabled=true` is set
4753
If your app needs manual Gradle wiring, update the Android Gradle file to include the native module. This can be done by editing the build.gradle file in the android directory of your React native app and adding the following line below the apply plugin line for the com.facebook.react.rootproject:
4854

4955
```kotlin
50-
apply from: "../node_modules/cbl-reactnative/android/build.gradle"
56+
apply from: "../node_modules/@couchbase/couchbase-lite-react-native/android/build.gradle"
5157
```
5258

5359
when completed the last two lines of the file should look something like this:
5460

5561
```kotlin
5662
apply plugin: "com.facebook.react.rootproject"
57-
apply from: "../node_modules/cbl-reactnative/android/build.gradle"
63+
apply from: "../node_modules/@couchbase/couchbase-lite-react-native/android/build.gradle"
5864
```
5965

6066
Now you can install the gradle dependencies and build the Android project:
@@ -85,7 +91,7 @@ npm run start
8591

8692
For developers using Expo, you must make sure you have the dev-client installed in your app. Expo Go is not compatible with custom React Native Native Module. To install the dev-client, review the [Expo documentation](https://docs.expo.dev/develop/development-builds/introduction/#what-is-expo-dev-client) along with the [Local App develompent documentation](https://docs.expo.dev/guides/local-app-development/). These directions assume dev-client is setup and you can build locally your app on iOS and Android.
8793

88-
The expo environment dynamically builds both the Cocoapod file for iOS and Gradle file for Android. Because of this you will need to register the cbl-reactnative package with the expo environment via the Expo plugin api.
94+
The expo environment dynamically builds both the Cocoapod file for iOS and Gradle file for Android. Because of this you will need to register the @couchbase/couchbase-lite-react-native package with the expo environment via the Expo plugin api.
8995

9096
This can be done by creating a new file in the root of your project called `plugin.config.js` and adding the following code:
9197

@@ -98,7 +104,7 @@ const {
98104

99105
// Function to modify Android build.gradle
100106
function modifyAndroidBuildGradle(config) {
101-
const lineToAdd = ` apply from: "../node_modules/cbl-reactnative/android/build.gradle"`;
107+
const lineToAdd = ` apply from: "../node_modules/@couchbase/couchbase-lite-react-native/android/build.gradle"`;
102108
if (!config.modResults.contents.includes(lineToAdd)) {
103109
config.modResults.contents += `\n${lineToAdd}`;
104110
console.debug(config.modResults.contents);
@@ -117,7 +123,7 @@ function modifyXcodeProject(config) {
117123
// Function to modify Podfile properties to include the native module podspec
118124
function includeNativeModulePod(config) {
119125
return withPodfileProperties(config, async (podConfig) => {
120-
const podspecPath = `../node_modules/cbl-reactnative/cbl-reactnative.podspec`;
126+
const podspecPath = `../node_modules/@couchbase/couchbase-lite-react-native/cbl-reactnative.podspec`;
121127
if (podConfig.modResults.podfileProperties !== undefined && podConfig.modResults.podfileProperties.pod !== undefined) {
122128
podConfig.modResults.podfileProperties.pod(
123129
`'cbl-reactnative', :path => '${podspecPath}'`

0 commit comments

Comments
 (0)