Setting/#30 - TCA 적용을 위한 Module Dependency 그래프 수정 및 루트 Feature 스캐폴드 - #31
Conversation
- swift-composable-architecture 1.25.0 → 1.26.0 버전 업데이트 - TargetDependency에 .tca() 헬퍼 추가 - Devault, DVPresentation 타겟에 TCA 의존성 연결
- DVPresentation에 Features 디렉토리 생성 (.gitkeep) - Devault에 Composition 디렉토리 생성 (.gitkeep)
- AppFeature Reducer 초기 구조 추가 (State, Action, Delegate) - AppView 초기 뷰 구현 및 task 액션 연결
- LocalStorage 초기화·성공/실패 분기를 진입점에서 제거 - ComposableArchitecture Store로 AppFeature/AppView를 호스팅 - Storage 초기화는 향후 AppInfrastructure/AppFeature.State 도입 시 재구성 예정 - ContentView / StorageUnavailableView는 참조 해제 (후속 커밋에서 정리)
WalkthroughDVPresentation 모듈에 Composable Architecture 기반 AppFeature 리듀서와 AppView SwiftUI 뷰가 새로 추가되었고, DevaultApp이 LocalStorage 분기 로직 대신 TCA Store로 AppView를 구동하도록 교체되었습니다. 아울러 tca() 의존성 헬퍼 추가, ComposableArchitecture 버전 상향(1.26.0), 각 Project.swift의 의존성 주석 정리가 함께 이루어졌습니다. ChangesTCA 도입
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant DevaultApp
participant Store
participant AppFeature
participant AppView
DevaultApp->>Store: Store(initialState: AppFeature.State()) { AppFeature() }
DevaultApp->>AppView: AppView(store:)
AppView->>Store: store.send(.task)
Store->>AppFeature: reduce(.task)
AppFeature-->>Store: .none
Suggested reviewers: 원인: LocalStorage 초기화 실패 분기가 사라지며 스토리지 오류 처리 경로가 완전히 삭제됨. 개선안: AppFeature 내부에 스토리지 초기화 실패를 감지해 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Projects/Devault/Sources/DevaultApp.swift (1)
9-14: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win
Store를body내에서 inline 생성하지 말고 저장 프로퍼티로 이동하세요.
body가 재평가될 때마다 새Store인스턴스가 생성되어 모든 TCA 상태가 초기화될 위험이 있습니다. TCA 공식 패턴대로 저장 프로퍼티로 선언하세요.♻️ 제안하는 리팩토링
`@main` struct DevaultApp: App { + private let store = Store(initialState: AppFeature.State()) { + AppFeature() + } + var body: some Scene { WindowGroup { AppView( - store: Store(initialState: AppFeature.State()) { - AppFeature() - } + store: store ) } } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Projects/Devault/Sources/DevaultApp.swift` around lines 9 - 14, `DevaultApp`의 `body` 안에서 `AppView`에 전달하는 `Store(initialState: AppFeature.State()) { AppFeature() }`를 inline 생성하지 말고, `DevaultApp`의 저장 프로퍼티로 분리하세요. `body`가 다시 평가될 때마다 새 `Store`가 만들어져 상태가 초기화될 수 있으므로, `DevaultApp` 타입에 `Store<AppFeature>`를 한 번만 생성해 보관한 뒤 `WindowGroup`의 `AppView`에서는 그 저장 프로퍼티를 전달하도록 수정하세요.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@Projects/Devault/Sources/DevaultApp.swift`:
- Around line 9-14: `DevaultApp`의 `body` 안에서 `AppView`에 전달하는
`Store(initialState: AppFeature.State()) { AppFeature() }`를 inline 생성하지 말고,
`DevaultApp`의 저장 프로퍼티로 분리하세요. `body`가 다시 평가될 때마다 새 `Store`가 만들어져 상태가 초기화될 수
있으므로, `DevaultApp` 타입에 `Store<AppFeature>`를 한 번만 생성해 보관한 뒤 `WindowGroup`의
`AppView`에서는 그 저장 프로퍼티를 전달하도록 수정하세요.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5c0ab8dc-b0b8-40d1-bd02-2418f424f43a
📒 Files selected for processing (9)
Projects/DVPresentation/Project.swiftProjects/DVPresentation/Sources/Features/.gitkeepProjects/DVPresentation/Sources/Features/AppFeature.swiftProjects/DVPresentation/Sources/Features/AppView.swiftProjects/Devault/Project.swiftProjects/Devault/Sources/Composition/.gitkeepProjects/Devault/Sources/DevaultApp.swiftTuist/Package.swiftTuist/ProjectDescriptionHelpers/TargetDependency+External.swift
✨ What's this PR?
📌 관련 이슈 (Related Issue)
🧶 주요 변경 내용 (Summary)
swift-composable-architecture1.26.0 도입.TargetDependency+External에.tca()축약 헬퍼 추가. DVPresentation·Devault 두 Project.swift에.tca()배선DVPresentation/Sources/Features/,DVPresentation/Sources/Dependencies/신설Devault/Sources/Composition/,Devault/Sources/Dependencies/신설AppFeature(@Reducer, @ObservableState) +AppView(@bindable Store) 최소 skeleton을 DVPresentation에 추가. 향후 자식 Feature 라우팅 hook 지점LocalStorage초기화·성공/실패 분기 제거. ComposableArchitectureStore로AppFeature를 호스팅하도록 교체🧪 테스트 / 검증 내역
tuist generate실행 성공 (SourceKit "No such module 'ComposableArchitecture'" 경고 해소 확인)Text("Devault")placeholder 정상 표시AppView#Preview렌더링 확인💬 기타 공유 사항
AppInfrastructure+AppFeature.State로 재도입 예정ContentView.swift,StorageUnavailableView.swift가 이제 참조되지 않는 dead code로 남음 → 후속 PR에서 정리SecretManagementClient)로 가는 것을 이번 논의에서 확정. 실제 Client는 첫 진짜 Feature 도입 시점부터 배선 예정docs/TCA_GUIDELINES.md는 아직 1.25.0으로 표기 → 후속 문서 갱신 필요🙇🏻♀️ 리뷰 가이드
Tuist/ProjectDescriptionHelpers/TargetDependency+External.swift—.tca()헬퍼 신설 위치·명명 컨벤션Projects/DVPresentation/Project.swift,Projects/Devault/Project.swift—.tca()배선 지점 및 internal / 3rd-party 그룹 코멘트Projects/DVPresentation/Sources/Features/AppFeature.swift,AppView.swift—public접근제어 범위와 skeleton 구조 (앞으로 자식 Feature 추가 시 hook 지점)Projects/Devault/Sources/DevaultApp.swift— Storage 초기화 로직 제거의 임시성 확인Summary by CodeRabbit
New Features
Bug Fixes
Chores