You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi PS Team! Thank you for this new repo, it's an exciting start!
There is however a problem with this package dependency in a way that I couldn't figure out but it is very easy to reproduce:
If you start a new Swift project the Xcode preview work as normal, with a HelloWorld view
If you add the powersync-swift dependency (with the details below, from main branch) the previews break. The bug report is too complicated
If you remove the dependency then the Previews are back. 🤷🏽♂️
Please check! Thank you!
import PackageDescription
let packageName = "PowerSync"
let package = Package(
name: packageName,
platforms: [
.iOS(.v13),
.macOS(.v10_13)
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: packageName,
targets: ["PowerSync"]),
],
dependencies: [
.package(url: "https://github.com/powersync-ja/powersync-kotlin.git", exact: "1.0.0-BETA11.0"),
.package(url: "https://github.com/powersync-ja/powersync-sqlite-core-swift.git", "0.3.1"..<"0.4.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: packageName,
dependencies: [
.product(name: "PowerSyncKotlin", package: "powersync-kotlin"),
.product(name: "PowerSyncSQLiteCore", package: "powersync-sqlite-core-swift")
]),
.testTarget(
name: "PowerSyncTests",
dependencies: ["PowerSync"]
),
]
)
The text was updated successfully, but these errors were encountered:
Thanks @DominicGBauer ! It's true that the previews started working when set as Legacy Execution. Thanks for the tip.
Also, in case this might be useful for anyone in the future, if you are using PS data in your previews and ps is passing as @Environment you might want to open it first and access data as follows:
(although as long as you dont connect, it wont be live):
#Preview {
let mockPowerSync = PowerSyncService()
mockPowerSync.openDb()
return SeasonsPage().environment(mockPowerSync)
}
Hi PS Team! Thank you for this new repo, it's an exciting start!
There is however a problem with this package dependency in a way that I couldn't figure out but it is very easy to reproduce:
powersync-swift
dependency (with the details below, from main branch) the previews break. The bug report is too complicatedPlease check! Thank you!
The text was updated successfully, but these errors were encountered: