Swift 6.2 allows targets to opt into marking classes as @MainActor by default. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0466-control-default-actor-isolation.md
SwiftPM packages can opt-in to the behavior like this:
.target(
name: "MyLibrary",
swiftSettings: [
.defaultIsolation(.mainActor), // Sets the whole module to @MainActor
]
)
Skip Lite doesn't know anything about that. (The SwiftPM build plugin API doesn't even expose swiftSettings.)
We'd presumably need to add a skip.yml setting to enable .defaultIsolation(.mainActor), and then the transpiler would need to be updated to support that.
Apple's guidance is that apps/UI libraries should opt-in to .defaultIsolation(.mainActor), but non-UI libraries should opt out. I think it would make sense to have skip create prompt the user whether they want to use .defaultIsolation(.mainActor), defaulting to "yes" for apps, and "no" for libraries.
Swift 6.2 allows targets to opt into marking classes as
@MainActorby default. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0466-control-default-actor-isolation.mdSwiftPM packages can opt-in to the behavior like this:
Skip Lite doesn't know anything about that. (The SwiftPM build plugin API doesn't even expose
swiftSettings.)We'd presumably need to add a
skip.ymlsetting to enable.defaultIsolation(.mainActor), and then the transpiler would need to be updated to support that.Apple's guidance is that apps/UI libraries should opt-in to
.defaultIsolation(.mainActor), but non-UI libraries should opt out. I think it would make sense to haveskip createprompt the user whether they want to use.defaultIsolation(.mainActor), defaulting to "yes" for apps, and "no" for libraries.