From 5da611a3ebe67cc947e53212081a729246796aa6 Mon Sep 17 00:00:00 2001 From: benitav Date: Wed, 11 Dec 2024 14:32:13 +0200 Subject: [PATCH 1/4] Beta release polish --- Demo/PowerSyncExample/_Secrets.swift | 6 +++--- Demo/README.md | 2 +- README.md | 14 +++++--------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Demo/PowerSyncExample/_Secrets.swift b/Demo/PowerSyncExample/_Secrets.swift index 8c3d86e..bd26b41 100644 --- a/Demo/PowerSyncExample/_Secrets.swift +++ b/Demo/PowerSyncExample/_Secrets.swift @@ -2,7 +2,7 @@ import Foundation // Enter your Supabase and PowerSync project details. enum Secrets { - static let powerSyncEndpoint = "https://your-id.powersync.journeyapps.com" - static let supabaseURL = URL(string: "https://your-id.supabase.co")! - static let supabaseAnonKey = "anon-key" + static let powerSyncEndpoint = "https://660fe3a331d70135abf2c626.powersync.journeyapps.com" + static let supabaseURL = URL(string: "https://beaywnuieweznatavpeg.supabase.co")! + static let supabaseAnonKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJlYXl3bnVpZXdlem5hdGF2cGVnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjU0NTk3OTAsImV4cCI6MjA0MTAzNTc5MH0.sb5_RBESMWbfnq_xaZy00T8Mia9lzY0-BBc7ZovS5t0" } diff --git a/Demo/README.md b/Demo/README.md index 70d24e4..4d8c7c8 100644 --- a/Demo/README.md +++ b/Demo/README.md @@ -14,7 +14,7 @@ Follow this guide to: ## Configure The App -Open the project in XCode. +Open this directory in XCode. Open the “_Secrets” file and insert the credentials of your Supabase and PowerSync projects (more info can be found [here](https://docs.powersync.com/integration-guides/supabase-+-powersync#test-everything-using-our-demo-app)). diff --git a/README.md b/README.md index f0231da..312b9b6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # PowerSync Swift -The SDK reference for the PowerSync Swift SDK is available [here](https://docs.powersync.com/client-sdk-references/swift). +This is the PowerSync SDK for Swift clients. The SDK reference is available [here](https://docs.powersync.com/client-sdk-references/swift). ## Beta Release @@ -32,18 +32,14 @@ Add .package(url: "https://github.com/powersync-ja/powersync-swift", exact: "") ``` - -to your `Package.swift` file and pin the dependency to a specific version. This is required because the package is in beta. +to your `Package.swift` file and pin the dependency to a specific version. The version is required because the package is in beta. ## Underlying Kotlin Dependency -The PowerSync Swift SDK currently makes use of the [PowerSync Kotlin Multiplatform SDK](https://github.com/powersync-ja/powersync-kotlin) with the API tool [SKIE](https://skie.touchlab.co/) and KMMBridge under the hood to help generate and publish the native Swift SDK. We will move to an entirely Swift native API in v1 and do not expect there to be any breaking changes. +The PowerSync Swift SDK currently makes use of the [PowerSync Kotlin Multiplatform SDK](https://github.com/powersync-ja/powersync-kotlin) with the API tool [SKIE](https://skie.touchlab.co/) and KMMBridge under the hood to help generate and publish a native Swift package. We will move to an entirely Swift native API in v1 and do not expect there to be any breaking changes. For more details, see the [Swift SDK reference](https://docs.powersync.com/client-sdk-references/swift). ## Migration from Alpha to Beta -* The `PowerSyncDatabase` no longer needs a driver argument and it must be removed. -* The interface for `PowerSyncDatabase` now uses `PowerSyncDatabaseProtocol` which may require some changes to databases uses. -* If you were using `__uploadData` and `__fetchCredentials` in your `PowerSyncBackendConnector` you must remove the `__` and update the methods to `uploadData` and `fetchCredentials`. -* `@MainThread` usage is no longer required and should be removed. -* Implementing `SuspendTaskWrapper` for database transactions is no longer required and should be removed. +See these [developer notes](https://docs.powersync.com/client-sdk-references/swift) if you are migrating from the alpha to the beta version of the Swift SDK. + From 78eb283664508f409ab4d4f4f6ccca4e70ba59eb Mon Sep 17 00:00:00 2001 From: benitav Date: Wed, 11 Dec 2024 17:00:39 +0200 Subject: [PATCH 2/4] Revert secrets --- Demo/PowerSyncExample/_Secrets.swift | 7 +++---- Demo/README.md | 11 +++++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Demo/PowerSyncExample/_Secrets.swift b/Demo/PowerSyncExample/_Secrets.swift index bd26b41..6f9208a 100644 --- a/Demo/PowerSyncExample/_Secrets.swift +++ b/Demo/PowerSyncExample/_Secrets.swift @@ -2,7 +2,6 @@ import Foundation // Enter your Supabase and PowerSync project details. enum Secrets { - static let powerSyncEndpoint = "https://660fe3a331d70135abf2c626.powersync.journeyapps.com" - static let supabaseURL = URL(string: "https://beaywnuieweznatavpeg.supabase.co")! - static let supabaseAnonKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJlYXl3bnVpZXdlem5hdGF2cGVnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjU0NTk3OTAsImV4cCI6MjA0MTAzNTc5MH0.sb5_RBESMWbfnq_xaZy00T8Mia9lzY0-BBc7ZovS5t0" -} + static let powerSyncEndpoint = "https://your-id.powersync.journeyapps.com" + static let supabaseURL = URL(string: "https://your-id.supabase.co")! + static let supabaseAnonKey = "anon-key" \ No newline at end of file diff --git a/Demo/README.md b/Demo/README.md index 4d8c7c8..3337782 100644 --- a/Demo/README.md +++ b/Demo/README.md @@ -14,11 +14,15 @@ Follow this guide to: ## Configure The App -Open this directory in XCode. +1. Open this directory in XCode. -Open the “_Secrets” file and insert the credentials of your Supabase and PowerSync projects (more info can be found [here](https://docs.powersync.com/integration-guides/supabase-+-powersync#test-everything-using-our-demo-app)). +2. Open the “_Secrets” file and insert the credentials of your Supabase and PowerSync projects (more info can be found [here](https://docs.powersync.com/integration-guides/supabase-+-powersync#test-everything-using-our-demo-app)). -### Finish XCode configuration +3. Enable CasePathMacros. We are using SwiftUI Navigation for the demo which requires this. + +### Troubleshooting + +If you run into build issues, try: 1. Clear Swift caches @@ -32,7 +36,6 @@ rm -rf ~/Library/org.swift.swiftpm - Reset Packages: File -> Packages -> Reset Package Caches - Clean Build: Product -> Clean Build Folder. -3. Enable CasePathMacros. We are using SwiftUI Navigation for the demo which requires this. ## Run project From a3698c491be65da7473ce7abfaed6307bcecf4de Mon Sep 17 00:00:00 2001 From: benitav Date: Wed, 11 Dec 2024 17:18:33 +0200 Subject: [PATCH 3/4] Closing bracket --- Demo/PowerSyncExample/_Secrets.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Demo/PowerSyncExample/_Secrets.swift b/Demo/PowerSyncExample/_Secrets.swift index 6f9208a..1e1b04e 100644 --- a/Demo/PowerSyncExample/_Secrets.swift +++ b/Demo/PowerSyncExample/_Secrets.swift @@ -4,4 +4,5 @@ import Foundation enum Secrets { static let powerSyncEndpoint = "https://your-id.powersync.journeyapps.com" static let supabaseURL = URL(string: "https://your-id.supabase.co")! - static let supabaseAnonKey = "anon-key" \ No newline at end of file + static let supabaseAnonKey = "anon-key" +} \ No newline at end of file From dc5d5336c9879ef4d68062ec76897ee62842db5d Mon Sep 17 00:00:00 2001 From: benitav Date: Wed, 11 Dec 2024 18:26:30 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 312b9b6..312e42f 100644 --- a/README.md +++ b/README.md @@ -41,5 +41,5 @@ The PowerSync Swift SDK currently makes use of the [PowerSync Kotlin Multiplatfo ## Migration from Alpha to Beta -See these [developer notes](https://docs.powersync.com/client-sdk-references/swift) if you are migrating from the alpha to the beta version of the Swift SDK. +See these [developer notes](https://docs.powersync.com/client-sdk-references/swift#migrating-from-the-alpha-to-the-beta-sdk) if you are migrating from the alpha to the beta version of the Swift SDK.