Skip Lite: Add support for `.defaultIsolation(.mainActor)`
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 3.2k
- Forks
- 106
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how skip.yml settings reach the transpiler and how skip create handles app versus library configuration. Check the SwiftPM build plugin integration, including whether swiftSettings are available, and define the setting and prompt behavior needed to enable or disable default MainActor isolation. Done means the configured behavior is supported for both generated apps and libraries, with coverage for the chosen defaults.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- build-system, mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100