Skip to content

Conversation

@Joannis
Copy link

@Joannis Joannis commented Oct 25, 2025

Hey all! I hope you're open to an effort like this. I would love to see TCA support Android, so we can share a huge chunk of our codebase between the two major platforms. This is still WIP, for some reason the Swift compiler doesn't respect #if os(..) that well.

Main changes:

  • Use OpenCombine on Linux/Android
  • Disable SwiftUI specific code using #if os(macOS) || os(iOS) ...
  • I tried doing #if canImport(SwiftUI) but that was also not respected, hence the os path

@stephencelis
Copy link
Member

@Joannis Exciting! Thanks for starting this and other discussions! We are enthusiastic about this initiative. I think the PR as it stands is doing a lot, though, so it's a bit harder for us to review. Ideally I think it could be split into smaller parts that are each easier to review in isolation.

  1. There's a lot of formatting churn, I think due to a newer version of swift-format. Are you down to first PR a reformat (and bump of the format.yml GitHub action) separately so this PR can be more focused?
  2. The #if canImport(SwiftUI) branching also feels like it could be pulled out to a separate PR.
  3. I asked in the related combine-schedulers discussion, but can all of the #if-import OpenCombines be eliminated with a module alias to Combine on non-Apple platforms, or is there a problem with that?

Once all the above is done/considered I think it'll be easier to review the OpenCombine diff and start reviewing things 😄

@stephencelis
Copy link
Member

stephencelis commented Oct 27, 2025

(As a side note, we are currently in the process of designing 2.0 of the Composable Architecture, which is being approached from first principles with modern Swift and platform agnostics, i.e. no dependence on Combine or other Apple-only frameworks. It may be a few months before any of it sees daylight, though, so we're happy to provide earlier support!)

@Joannis
Copy link
Author

Joannis commented Oct 27, 2025

I'm really happy to hear your plans for TCA 2.0, I think that's much more interesting to me by the sounds of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants