Skip to content

refactor: remove TCA dependency and migrate to @Observable MVVM#1

Open
tosh7 wants to merge 1 commit intomainfrom
feature/remove-tca
Open

refactor: remove TCA dependency and migrate to @Observable MVVM#1
tosh7 wants to merge 1 commit intomainfrom
feature/remove-tca

Conversation

@tosh7
Copy link
Copy Markdown
Owner

@tosh7 tosh7 commented Jun 23, 2025

Summary

  • Completely remove TCA (The Composable Architecture) and migrate to Swift's native @Observable + MVVM architecture
  • Replace all 6 Reducers (Home, Result, PastResults, Counter, Initial, Round) with @Observable ViewModels
  • Remove TCA + 12 transitive dependency packages (-721 lines)

Changes

Bug Fixes

  • iPhoneConnecter: Fix nested function inside delegate method that was never executed
  • iPhoneConnecter: Fix AsyncStream continuation overwrite bug using AsyncStream.makeStream()
  • WatchConnecter: Fix typo isGmaeStartedisGameStarted
  • RoundView (Watch): Restore Finish button that was incorrectly commented out
  • RoundModel: Fix FIXME typo "cound" → "could"

Architecture Migration

  • iPhone: HomeReducer → HomeViewModel, ResultReducer → ResultViewModel, PastResultsReducer deleted
  • Watch: CounterReducer → CounterViewModel, InitialReducer → InitialViewModel, RoundReducer → RoundViewModel
  • Navigation: TCA's @Presents + .ifLet → SwiftUI native navigationDestination(isPresented:)
  • Effects: TCA's Effect.run → Swift Concurrency (async/await, AsyncStream)

Model Improvements

  • RoundModel: Changed from class: NSObject to struct: Equatable
  • CommonModel: Updated watchOS minimum target from v6 to v10

Dependency Removal

  • Removed all TCA package references from project.pbxproj
  • Removed TCA + 12 transitive dependencies from Package.resolved (2 files)

Stats

  • 26 files changed, +273 / -721 lines

Test plan

  • iPhone app launches successfully
  • Round creation flow works (Home → Result)
  • Apple Watch communication (WCSession) works correctly
  • Watch app score counting and round navigation works
  • Finish button sends score successfully

- Replace all Reducers (Home, Result, PastResults, Counter, Initial, Round)
  with @observable ViewModels using Swift Concurrency
- Fix iPhoneConnecter nested delegate function bug and AsyncStream overwrite bug
  using AsyncStream.makeStream() pattern
- Fix WatchConnecter typo: isGmaeStarted → isGameStarted
- Fix RoundView Finish button that was incorrectly commented out
- Convert RoundModel from NSObject class to struct with Equatable conformance
- Remove TCA + 12 transitive dependencies from Package.resolved and project.pbxproj
- Update CommonModel minimum watchOS target from v6 to v10

26 files changed, +273/-721 lines
@tosh7 tosh7 force-pushed the feature/remove-tca branch from 6f08745 to daaeed1 Compare March 10, 2026 03:10
@tosh7 tosh7 changed the title Migrate from TCA to MVVM architecture refactor: remove TCA dependency and migrate to @Observable MVVM Mar 10, 2026
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.

1 participant