Skip to content

Commit ff7940b

Browse files
authored
Merge pull request #32 from Couchbase-Ecosystem/cbl-321
feat: updated to RN 0.76.3/cbl 3.2.1
2 parents c7ae6a4 + 8c1fe82 commit ff7940b

File tree

130 files changed

+24384
-37380
lines changed

Some content is hidden

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

130 files changed

+24384
-37380
lines changed

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
android/
2+
build/
3+
expo-example/
4+
node_modules/
5+
dist/
6+
lib/
7+
src/cblite-js
8+
ios/
9+
bable.config.js

.eslintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:react/recommended",
6+
"prettier"
7+
],
8+
"plugins": ["@typescript-eslint", "react", "prettier"],
9+
"rules": {
10+
"prettier/prettier": "error"
11+
}
12+
}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "android/src/main/java/com/cblreactnative/cbl-js-kotlin"]
88
path = android/src/main/java/com/cblreactnative/cbl-js-kotlin
99
url = [email protected]:Couchbase-Ecosystem/cbl-js-kotlin.git
10+
[submodule "expo-example/cblite-js-tests"]
11+
path = expo-example/cblite-js-tests
12+
url = [email protected]:Couchbase-Ecosystem/cblite-js-tests.git

.prettierignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
android/
2+
build/
3+
expo-example/
4+
node_modules/
5+
dist/
6+
lib/
7+
src/cblite-js
8+
ios/
9+
bable.config.js

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5",
4+
"tabWidth": 2,
5+
"semi": true,
6+
"printWidth": 80
7+
}

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ buildscript {
33
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["CblReactnative_kotlinVersion"]
44

55
repositories {
6-
maven {url 'https://mobile.maven.couchbase.com/maven2/dev/'}
76
google()
7+
maven {url 'https://mobile.maven.couchbase.com/maven2/dev/'}
88
mavenCentral()
99
}
1010

@@ -50,7 +50,7 @@ def supportsNamespace() {
5050

5151
android {
5252
if (supportsNamespace()) {
53-
namespace "com.cbl.reactnative"
53+
namespace "com.cblreactnative"
5454
sourceSets {
5555
main {
5656
manifest.srcFile "src/main/AndroidManifestNew.xml"
@@ -90,8 +90,8 @@ repositories {
9090

9191
allprojects {
9292
repositories {
93-
maven { url 'https://mobile.maven.couchbase.com/maven2/dev/' }
9493
google()
94+
maven { url 'https://mobile.maven.couchbase.com/maven2/dev/' }
9595
mavenCentral()
9696
}
9797
}
@@ -107,6 +107,6 @@ dependencies {
107107
implementation "com.facebook.react:react-native:+"
108108
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
109109
implementation "org.json:json:20240303"
110-
implementation "com.couchbase.lite:couchbase-lite-android-ee-ktx:3.1.9"
110+
implementation "com.couchbase.lite:couchbase-lite-android-ee-ktx:3.2.1"
111111
}
112112

android/gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CblReactnative_kotlinVersion=1.7.0
2-
CblReactnative_minSdkVersion=25
3-
CblReactnative_targetSdkVersion=31
4-
CblReactnative_compileSdkVersion=31
1+
CblReactnative_kotlinVersion=1.9.25
2+
CblReactnative_minSdkVersion=24
3+
CblReactnative_targetSdkVersion=34
4+
CblReactnative_compileSdkVersion=34
55
CblReactnative_ndkversion=21.4.7075529

android/src/main/java/com/cblreactnative/CblReactnativeModule.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class CblReactnativeModule(reactContext: ReactApplicationContext) :
5252

5353
// Collection Functions
5454
@ReactMethod
55-
5655
fun collection_CreateCollection(
5756
collectionName: String,
5857
name: String,
@@ -484,7 +483,8 @@ class CblReactnativeModule(reactContext: ReactApplicationContext) :
484483

485484
@ReactMethod
486485
fun collection_Save(
487-
document: ReadableMap,
486+
document: String,
487+
blobs: String,
488488
docId: String,
489489
name: String,
490490
scopeName: String,
@@ -505,21 +505,23 @@ class CblReactnativeModule(reactContext: ReactApplicationContext) :
505505
concurrencyControl =
506506
DataAdapter.intToConcurrencyControl(concurrencyControlValue.toInt())
507507
}
508-
val doc = DataAdapter.toMap(document).toMap()
509508
val result = CollectionManager.saveDocument(
510509
docId,
511-
doc,
510+
document,
511+
blobs,
512512
concurrencyControl,
513513
collectionName,
514514
scopeName,
515515
name
516516
)
517-
writableMap.putString("_id", result.first)
518-
if (result.second != null) {
519-
writableMap.putBoolean("concurrencyControlResult", result.second!!)
517+
writableMap.putString("_id", result._id)
518+
if (result._concurrencyControl != null) {
519+
writableMap.putBoolean("concurrencyControlResult", result._concurrencyControl)
520520
} else {
521521
writableMap.putNull("concurrencyControlResult")
522522
}
523+
writableMap.putString("_revId", result._revId)
524+
writableMap.putInt("_sequence", result._sequence.toInt())
523525
context.runOnUiQueueThread {
524526
promise.resolve(writableMap)
525527
}

android/src/main/java/com/cblreactnative/DataAdapter.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ object DataAdapter {
7777
val itemValue = map[key]
7878
if (itemValue is Blob) {
7979
document.getBlob(key)?.let { blob ->
80-
val properties = blob.properties.toMap()
80+
val properties = blob.properties.toMutableMap()
81+
val raw = blob.content?.toTypedArray()
82+
properties["raw"] = raw
8183
map[key] = properties
8284
}
8385
}

0 commit comments

Comments
 (0)