skiptools / skiptools/skip

Skip Lite: Add support for `.defaultIsolation(.mainActor)`

Open
#674 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

project transpilation
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.