diff --git a/build.gradle.kts b/build.gradle.kts index f8a0b6f3c..4c5d38a08 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -162,8 +162,7 @@ subprojects { args( it, "--project-directory", projectDir.resolve("src/nativeInterop/cinterop"), - "--platform", "iOS", - "--cache-builds" + "--platform", "iOS" ) } } diff --git a/firebase-app/build.gradle.kts b/firebase-app/build.gradle.kts index eff011173..530e4ba3e 100644 --- a/firebase-app/build.gradle.kts +++ b/firebase-app/build.gradle.kts @@ -90,7 +90,7 @@ kotlin { compilations.getByName("main") { cinterops.create("FirebaseCore") { compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts("-verbose") + extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") } } } diff --git a/firebase-app/package.json b/firebase-app/package.json index b04ec1a26..9b852f91c 100644 --- a/firebase-app/package.json +++ b/firebase-app/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-common": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-auth/build.gradle.kts b/firebase-auth/build.gradle.kts index 00c0a4be8..1402f4358 100644 --- a/firebase-auth/build.gradle.kts +++ b/firebase-auth/build.gradle.kts @@ -119,7 +119,7 @@ kotlin { compilations.getByName("main") { cinterops.create("FirebaseAuth") { compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts("-verbose") + extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") } } } diff --git a/firebase-auth/package.json b/firebase-auth/package.json index e2668ff1f..9c71c23d8 100644 --- a/firebase-auth/package.json +++ b/firebase-auth/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-common/build.gradle.kts b/firebase-common/build.gradle.kts index c9368bda2..2496f3c15 100644 --- a/firebase-common/build.gradle.kts +++ b/firebase-common/build.gradle.kts @@ -108,7 +108,7 @@ kotlin { val jsMain by getting { dependencies { - api(npm("firebase", "8.10.0")) + api(npm("firebase", "9.4.1")) } } } diff --git a/firebase-common/package.json b/firebase-common/package.json index 96cfb72d1..306f5de28 100644 --- a/firebase-common/package.json +++ b/firebase-common/package.json @@ -23,7 +23,7 @@ }, "homepage": "https://github.com/GitLiveApp/firebase-kotlin-multiplatform-sdk", "dependencies": { - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2", "kotlinx-serialization-kotlinx-serialization-runtime": "1.3.0" diff --git a/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt b/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt index 3485345b0..f56164bae 100644 --- a/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt +++ b/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt @@ -2,7 +2,7 @@ * Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license. */ -@file:JsModule("firebase/app") +@file:JsModule("firebase/compat/app") package dev.gitlive.firebase diff --git a/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals2.kt b/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals2.kt index fbc2409a8..3c2b981c1 100644 --- a/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals2.kt +++ b/firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals2.kt @@ -6,19 +6,24 @@ package dev.gitlive.firebase import kotlin.js.Promise -@JsModule("firebase/functions") +@JsModule("firebase/compat/functions") +@JsName("default") external object functions -@JsModule("firebase/auth") +@JsModule("firebase/compat/auth") +@JsName("default") external object auth -@JsModule("firebase/database") +@JsModule("firebase/compat/database") +@JsName("default") external object database -@JsModule("firebase/firestore") +@JsModule("firebase/compat/firestore") +@JsName("default") external object firestore -@JsModule("firebase/remote-config") +@JsModule("firebase/compat/remote-config") +@JsName("default") external object remoteConfig typealias SnapshotCallback = (data: firebase.database.DataSnapshot, b: String?) -> Unit diff --git a/firebase-config/build.gradle.kts b/firebase-config/build.gradle.kts index 6b9ab1d37..47b41b596 100644 --- a/firebase-config/build.gradle.kts +++ b/firebase-config/build.gradle.kts @@ -104,7 +104,7 @@ kotlin { compilations.getByName("main") { cinterops.create("FirebaseRemoteConfig") { compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts("-verbose") + extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") } } } diff --git a/firebase-config/package.json b/firebase-config/package.json index a1a774ef7..389ebaa56 100644 --- a/firebase-config/package.json +++ b/firebase-config/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-database/build.gradle.kts b/firebase-database/build.gradle.kts index 8b5c08b7d..ab68f72d1 100644 --- a/firebase-database/build.gradle.kts +++ b/firebase-database/build.gradle.kts @@ -95,7 +95,7 @@ kotlin { compilations.getByName("main") { cinterops.create("FirebaseDatabase") { compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts("-verbose") + extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") } } } diff --git a/firebase-database/package.json b/firebase-database/package.json index a18360057..e93312c26 100644 --- a/firebase-database/package.json +++ b/firebase-database/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-firestore/build.gradle.kts b/firebase-firestore/build.gradle.kts index bff60b38e..243bf2cd1 100644 --- a/firebase-firestore/build.gradle.kts +++ b/firebase-firestore/build.gradle.kts @@ -102,7 +102,7 @@ kotlin { compilations.getByName("main") { cinterops.create("FirebaseFirestore") { compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts("-verbose") + extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") } } } diff --git a/firebase-firestore/package.json b/firebase-firestore/package.json index 4583702a3..d3df2f1c3 100644 --- a/firebase-firestore/package.json +++ b/firebase-firestore/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" } diff --git a/firebase-firestore/src/androidMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/androidMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt index 970bea996..115d4a114 100644 --- a/firebase-firestore/src/androidMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/androidMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -415,9 +415,6 @@ actual class DocumentSnapshot(val android: com.google.firebase.firestore.Documen actual fun data(strategy: DeserializationStrategy, serverTimestampBehavior: ServerTimestampBehavior): T = decode(strategy, android.getData(serverTimestampBehavior.toAndroid())) - actual fun dataMap(serverTimestampBehavior: ServerTimestampBehavior): Map = - android.getData(serverTimestampBehavior.toAndroid()) ?: emptyMap() - actual inline fun get(field: String, serverTimestampBehavior: ServerTimestampBehavior): T = decode(value = android.get(field, serverTimestampBehavior.toAndroid())) diff --git a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt index 12565196d..366b416b2 100644 --- a/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -196,8 +196,6 @@ expect class DocumentSnapshot { inline fun data(serverTimestampBehavior: ServerTimestampBehavior = ServerTimestampBehavior.NONE): T fun data(strategy: DeserializationStrategy, serverTimestampBehavior: ServerTimestampBehavior = ServerTimestampBehavior.NONE): T - fun dataMap(serverTimestampBehavior: ServerTimestampBehavior = ServerTimestampBehavior.NONE): Map - val exists: Boolean val id: String val reference: DocumentReference diff --git a/firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt index 65d2ff576..f48ae582d 100644 --- a/firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/commonTest/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -160,7 +160,6 @@ class FirebaseFirestoreTest { val pendingWritesSnapshot = deferredPendingWritesSnapshot.await() assertTrue(pendingWritesSnapshot.metadata.hasPendingWrites) assertNull(pendingWritesSnapshot.get("time", ServerTimestampBehavior.NONE)) - assertNull(pendingWritesSnapshot.dataMap(ServerTimestampBehavior.NONE)["time"]) } @Test @@ -181,7 +180,6 @@ class FirebaseFirestoreTest { val pendingWritesSnapshot = deferredPendingWritesSnapshot.await() assertTrue(pendingWritesSnapshot.metadata.hasPendingWrites) assertNotNull(pendingWritesSnapshot.get("time", ServerTimestampBehavior.ESTIMATE)) - assertNotNull(pendingWritesSnapshot.dataMap(ServerTimestampBehavior.ESTIMATE)["time"]) assertNotEquals(0.0, pendingWritesSnapshot.data(FirestoreTest.serializer(), ServerTimestampBehavior.ESTIMATE).time) } @@ -203,7 +201,6 @@ class FirebaseFirestoreTest { val pendingWritesSnapshot = deferredPendingWritesSnapshot.await() assertTrue(pendingWritesSnapshot.metadata.hasPendingWrites) assertNull(pendingWritesSnapshot.get("time", ServerTimestampBehavior.PREVIOUS)) - assertNull(pendingWritesSnapshot.dataMap(ServerTimestampBehavior.PREVIOUS)["time"]) } @Test @@ -223,23 +220,6 @@ class FirebaseFirestoreTest { assertEquals("AutoId", resultDoc.get("prop1")) } - @Test - fun testDataMap() = runTest { - val doc = Firebase.firestore - .collection("testDataMap") - .document - - doc.set(FirestoreTest.serializer(), FirestoreTest("dataMap", 123.45)) - - val resultDoc = Firebase.firestore - .collection("testDataMap") - .document(doc.id) - .get() - - assertEquals(true, resultDoc.exists) - assertEquals(mapOf("prop1" to "dataMap", "time" to 123.45), resultDoc.dataMap()) - } - private suspend fun setupFirestoreData() { Firebase.firestore.collection("FirebaseFirestoreTest") .document("one") diff --git a/firebase-firestore/src/iosMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/iosMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt index 5d928c290..02dfb91c5 100644 --- a/firebase-firestore/src/iosMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/iosMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -388,12 +388,6 @@ actual class DocumentSnapshot(val ios: FIRDocumentSnapshot) { return decode(strategy, data?.mapValues { (_, value) -> value?.takeIf { it !is NSNull } }) } - actual fun dataMap(serverTimestampBehavior: ServerTimestampBehavior): Map = - ios.dataWithServerTimestampBehavior(serverTimestampBehavior.toIos()) - ?.map { (key, value) -> key.toString() to value?.takeIf { it !is NSNull } } - ?.toMap() - ?: emptyMap() - actual inline fun get(field: String, serverTimestampBehavior: ServerTimestampBehavior): T { val value = ios.valueForField(field, serverTimestampBehavior.toIos())?.takeIf { it !is NSNull } return decode(value) diff --git a/firebase-firestore/src/jsMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt b/firebase-firestore/src/jsMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt index c078ccde3..fadb1a6b2 100644 --- a/firebase-firestore/src/jsMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt +++ b/firebase-firestore/src/jsMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt @@ -393,9 +393,6 @@ actual class DocumentSnapshot(val js: firebase.firestore.DocumentSnapshot) { actual fun data(strategy: DeserializationStrategy, serverTimestampBehavior: ServerTimestampBehavior): T = rethrow { decode(strategy, js.data(getTimestampsOptions(serverTimestampBehavior))) } - actual fun dataMap(serverTimestampBehavior: ServerTimestampBehavior): Map = - rethrow { mapOf(js.data(getTimestampsOptions(serverTimestampBehavior)).asDynamic()) } - actual inline fun get(field: String, serverTimestampBehavior: ServerTimestampBehavior) = rethrow { decode(value = js.get(field, getTimestampsOptions(serverTimestampBehavior))) } diff --git a/firebase-functions/build.gradle.kts b/firebase-functions/build.gradle.kts index f9e42f1ce..6174f47d0 100644 --- a/firebase-functions/build.gradle.kts +++ b/firebase-functions/build.gradle.kts @@ -90,7 +90,7 @@ kotlin { compilations.getByName("main") { cinterops.create("FirebaseFunctions") { compilerOpts(nativeFrameworkPaths.map { "-F$it" }) - extraOpts("-verbose") + extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=", "-verbose") } } } diff --git a/firebase-functions/package.json b/firebase-functions/package.json index a5ec276fb..ff55e2ba7 100644 --- a/firebase-functions/package.json +++ b/firebase-functions/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk", "dependencies": { "@gitlive/firebase-app": "1.4.3", - "firebase": "8.10.0", + "firebase": "9.4.1", "kotlin": "1.5.31", "kotlinx-coroutines-core": "1.5.2" }