Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
xcode-version: latest-stable
- name: Build and Test
run: |
xcodebuild test -scheme PowerSync -destination "platform=iOS Simulator,name=iPhone 16"
xcodebuild test -scheme PowerSync -destination "platform=macOS,arch=arm64,name=My Mac"
xcodebuild test -scheme PowerSync -destination "platform=watchOS Simulator,arch=arm64,name=Apple Watch Ultra 2 (49mm)"
xcodebuild test -scheme PowerSync-Package -destination "platform=iOS Simulator,name=iPhone 16"
xcodebuild test -scheme PowerSync-Package -destination "platform=macOS,arch=arm64,name=My Mac"
xcodebuild test -scheme PowerSync-Package -destination "platform=watchOS Simulator,arch=arm64,name=Apple Watch Ultra 2 (49mm)"

buildSwift6:
name: Build and test with Swift 6
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

* *Potential Breaking Change*: Attachment helpers have been updated to better support Swift 6 strict concurrency checking. `Actor` isolation is improved, but developers who customize or extend `AttachmentQueue` will need to update their implementations. The default instantiation of `AttachmentQueue` remains unchanged.
`AttachmentQueueProtocol` now defines the basic requirements for an attachment queue, with most base functionality provided via an extension. Custom implementations should extend `AttachmentQueueProtocol`.
* Added `PowerSyncDynamic` product to package. Importing this product should restore XCode preview functionality.
* [Internal] Instantiate Kotlin Kermit logger directly.
* [Internal] Improved connection context error handling.

Expand Down
12 changes: 7 additions & 5 deletions Demo/PowerSyncExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
B666587C2C63B88700159A81 /* SwiftUINavigationCore in Frameworks */ = {isa = PBXBuildFile; productRef = B666587B2C63B88700159A81 /* SwiftUINavigationCore */; };
B69F7D862C8EE27400565448 /* AnyCodable in Frameworks */ = {isa = PBXBuildFile; productRef = B69F7D852C8EE27400565448 /* AnyCodable */; };
B6B3698A2C64F4B30033C307 /* Navigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6B369892C64F4B30033C307 /* Navigation.swift */; };
B6FFD5322D06DA8000EEE60F /* PowerSync in Frameworks */ = {isa = PBXBuildFile; productRef = B6FFD5312D06DA8000EEE60F /* PowerSync */; };
BE2F26EC2DA54B2F0080F1AE /* SupabaseRemoteStorage.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE2F26EB2DA54B2A0080F1AE /* SupabaseRemoteStorage.swift */; };
BEDBE19C2E5F0299004E1AB5 /* PowerSyncDynamic in Frameworks */ = {isa = PBXBuildFile; productRef = BEDBE19B2E5F0299004E1AB5 /* PowerSyncDynamic */; };
BEDBE19D2E5F0299004E1AB5 /* PowerSyncDynamic in Embed Frameworks */ = {isa = PBXBuildFile; productRef = BEDBE19B2E5F0299004E1AB5 /* PowerSyncDynamic */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
BEE4708B2E3BBB2500140D11 /* Secrets.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEE4708A2E3BBB2500140D11 /* Secrets.swift */; };
/* End PBXBuildFile section */

Expand All @@ -51,6 +52,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
BEDBE19D2E5F0299004E1AB5 /* PowerSyncDynamic in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -120,11 +122,11 @@
B66658772C63B7BB00159A81 /* IdentifiedCollections in Frameworks */,
B69F7D862C8EE27400565448 /* AnyCodable in Frameworks */,
B666587C2C63B88700159A81 /* SwiftUINavigationCore in Frameworks */,
B6FFD5322D06DA8000EEE60F /* PowerSync in Frameworks */,
6A9669022B9EE69500B05DCF /* Supabase in Frameworks */,
6A9669002B9EE4FE00B05DCF /* PostgREST in Frameworks */,
6A9668FE2B9EE4FE00B05DCF /* Auth in Frameworks */,
B666587A2C63B88700159A81 /* SwiftUINavigation in Frameworks */,
BEDBE19C2E5F0299004E1AB5 /* PowerSyncDynamic in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -487,7 +489,7 @@
B66658792C63B88700159A81 /* SwiftUINavigation */,
B666587B2C63B88700159A81 /* SwiftUINavigationCore */,
B69F7D852C8EE27400565448 /* AnyCodable */,
B6FFD5312D06DA8000EEE60F /* PowerSync */,
BEDBE19B2E5F0299004E1AB5 /* PowerSyncDynamic */,
);
productName = PowerSyncExample;
productReference = 6A7315842B9854220004CB17 /* PowerSyncExample.app */;
Expand Down Expand Up @@ -885,10 +887,10 @@
package = B69F7D842C8EE27300565448 /* XCRemoteSwiftPackageReference "AnyCodable" */;
productName = AnyCodable;
};
B6FFD5312D06DA8000EEE60F /* PowerSync */ = {
BEDBE19B2E5F0299004E1AB5 /* PowerSyncDynamic */ = {
isa = XCSwiftPackageProductDependency;
package = 18F30B282CCA4B3B00A58917 /* XCLocalSwiftPackageReference "../../powersync-swift" */;
productName = PowerSync;
productName = PowerSyncDynamic;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
1 change: 1 addition & 0 deletions Demo/PowerSyncExample/Screens/HomeScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ struct HomeScreen: View {
NavigationStack{
HomeScreen()
.environment(SystemManager())
.environment(NavigationModel())
}
}
1 change: 1 addition & 0 deletions Demo/PowerSyncExample/Screens/SignInScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ struct SignInScreen: View {
NavigationStack {
SignInScreen()
.environment(SystemManager())
.environment(NavigationModel())
}
}
1 change: 1 addition & 0 deletions Demo/PowerSyncExample/Screens/SignUpScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ struct SignUpScreen: View {
NavigationStack {
SignUpScreen()
.environment(SystemManager())
.environment(NavigationModel())
}
}
10 changes: 10 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ let package = Package(
.library(
name: packageName,
targets: ["PowerSync"]
),
.library(
name: "\(packageName)Dynamic",
// The default value normally specifies that the library is compatible with both static and dynamic linking,
// where the value used is typically specified by the consumer - which is usually defaulted to static linking.
// It's not straight forward to configure the linking option used by XCode consumers - specifying
// this additional product allows consumers to add it to their project, forcing dynamic linking.
// Dynamic linking is particularly important for XCode previews.
type: .dynamic,
targets: ["PowerSync"]
)
],
dependencies: conditionalDependencies,
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,13 @@ For more details, see the [Swift SDK reference](https://docs.powersync.com/clien
## Attachments

See the attachments [README](./Sources/PowerSync/attachments/README.md) for more information.

## XCode Previews

XCode previews currently fail to load in a reasonable time after adding PowerSync to an XCode project. XCode requires dynamic linking for previews. This is enabled by enabling `ENABLE_DEBUG_DYLIB` in the XCode project. It seems like the previews fail to load due to PowerSync providing a `binaryTarget` which is linked statically by default.

XCode previews can be enabled by either:

Enabling `Editor -> Canvas -> Use Legacy Previews Execution` in XCode.

Or adding the `PowerSyncDynamic` product when adding PowerSync to your project. This product will assert that PowerSync should be dynamically linked, which restores XCode previews.
Loading