Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEAV-80] MVI 구조 적용 #27

Merged
merged 4 commits into from
Oct 8, 2024
Merged

[WEAV-80] MVI 구조 적용 #27

merged 4 commits into from
Oct 8, 2024

Conversation

jisu15-kim
Copy link
Member

@jisu15-kim jisu15-kim commented Oct 8, 2024

구현사항

  • MVI 구조 적용
  • 기존에 존재하는 뷰 들을 MVI 로 변경함
  • Xcode Template 생성하여 간편하게 적용하도록 구성

구조

image

  • 참고1
  • 참고2
  • 해당 레포의 코드를 기반으로 일부 수정하여 적용했다.

고민사항

사이드이펙트

  • AOS 진영에서는 Side-Effect 를 별도로 관리한다고 하는데, 나는 state 에 error 를 넣어서 관리하는 방식으로 적용했음
  • 그런데 error 를 state 라고 볼 수 있을까?
  • observable 같은 형태에서 방출하고, 일회성으로 방출된 데이터를 사용하는 것이 좋아보이는데, 그것을 SwiftUI 에서 어떻게 구현할 수 있을까?
  • 글로벌로 빼서 처리해야 하나 ?? (Alert, Toast)

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 인증 과정에서 전화번호 입력 및 검증을 위한 새로운 뷰 및 모델 추가.
    • 성별 입력을 위한 새로운 뷰 및 모델 추가.
    • 사용자 입력 상태를 관리하는 MVI 아키텍처 구현.
    • 로딩 및 오류 상태를 처리하는 새로운 뷰 수정자 추가.
  • 버그 수정

    • 전화번호 검증 로직 개선.
    • 사용자 인터페이스의 상태 관리 및 반응성 향상.
  • 문서화

    • MVI 아키텍처에 대한 템플릿 및 메타데이터 추가.

@jisu15-kim jisu15-kim added refactor 리팩토링 Infra labels Oct 8, 2024
@jisu15-kim jisu15-kim self-assigned this Oct 8, 2024
Copy link
Contributor

coderabbitai bot commented Oct 8, 2024

Warning

Rate limit exceeded

@jisu15-kim has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 0 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Files that changed from the base of the PR and between e3af915 and fd1aa6f.

Walkthrough

이 풀 리퀘스트는 SwiftUI 애플리케이션의 다양한 구성 요소를 업데이트하고 새로운 기능을 추가합니다. AppCoordinator 클래스의 changeRootView 메서드가 수정되어 내비게이션 스택의 요소를 제거하는 방식이 변경되었습니다. 새로운 파일들이 추가되어 NavigationViewModifier, ErrorModel, MVIContainer 등 다양한 기능을 구현합니다. 또한, 여러 뷰가 모델-뷰-의도(MVI) 아키텍처를 채택하여 상태 관리와 사용자 상호작용을 개선했습니다.

Changes

파일 경로 변경 요약
Projects/Core/CommonKit/Sources/AppCoordinator.swift changeRootView 메서드에서 navigationStack의 첫 번째 요소를 제거하는 로직이 변경되어 마지막 요소를 제외한 모든 요소가 제거됨.
Projects/Core/CommonKit/Sources/Navigation+Ext.swift NavigationViewModifier 구조체 추가 및 setNavigationWithPop() 메서드 추가.
Projects/Core/CoreKit/Sources/ErrorModel.swift ErrorModel 구조체 추가, 오류 정보를 캡슐화하는 두 개의 선택적 문자열 속성 포함.
Projects/Core/CoreKit/Sources/MVIContainer.swift MVIContainer 클래스 추가, 모델과 의도를 관리하는 구조체로, SwiftUI에서 사용됨.
Projects/DesignSystem/DesignCore/Sources/ErrorView.swift ErrorViewModifier 추가 및 setErrorViewIfNeeded(error: Error?) 메서드 추가.
Projects/DesignSystem/DesignCore/Sources/LoadingView.swift FullScreenLoadingOverlayLoadingViewModifier 추가, 로딩 상태를 관리하는 메서드 추가.
Projects/DesignSystem/DesignCore/Sources/VerifyCodeInput/VerifyCodeInputView.swift AuthPhoneVerifyView에서 VerifyCodeInputView로 이름 변경 및 초기화 매개변수 수정.
Projects/Features/SignUp/Sources/AuthAgreement/AuthAgreementView.swift AuthAgreementView 파일 제거.
Projects/Features/SignUp/Sources/AuthSignUp/AuthAgreement/AuthAgreementIntent.swift AuthAgreementIntent 클래스 추가, 사용자 상호작용 관리.
Projects/Features/SignUp/Sources/AuthSignUp/AuthAgreement/AuthAgreementModel.swift AuthAgreementModel 클래스 추가, 상태 관리 및 오류 처리.
Projects/Features/SignUp/Sources/AuthSignUp/AuthAgreement/AuthAgreementView.swift AuthAgreementView 추가, MVI 아키텍처 사용.
Projects/Features/SignUp/Sources/AuthSignUp/AuthPhoneInput/AuthPhoneInputModel.swift AuthPhoneInputModel 클래스 추가, 전화번호 입력 상태 관리.
Projects/Features/SignUp/Sources/AuthSignUp/AuthPhoneInput/AuthPhoneInputView.swift AuthPhoneInputView의 상태 관리 로직 수정, MVIContainer 사용.
Projects/Features/SignUp/Sources/AuthSignUp/AuthPhoneInput/AuthPhoneIntent.swift AuthPhoneInputIntent 클래스 추가, 전화 입력 관련 상호작용 관리.
Projects/Features/SignUp/Sources/AuthSignUp/AuthPhoneVerify/AuthPhoneVerifyIntent.swift AuthPhoneVerifyIntent 클래스 추가, 전화 인증 관련 상호작용 관리.
Projects/Features/SignUp/Sources/AuthSignUp/AuthPhoneVerify/AuthPhoneVerifyModel.swift AuthPhoneVerifyModel 클래스 추가, 인증 상태 관리.
Projects/Features/SignUp/Sources/AuthSignUp/AuthPhoneVerify/AuthPhoneVerifyView.swift AuthPhoneVerifyView 추가, 전화번호 인증 UI 구현.
Projects/Features/SignUp/Sources/ProfileInput/AuthGreeting/AuthGreetingIntent.swift AuthGreetingIntent 클래스 추가, 인사 화면 상호작용 관리.
Projects/Features/SignUp/Sources/ProfileInput/AuthGreeting/AuthGreetingModel.swift AuthGreetingModel 클래스 추가, 상태 관리.
Projects/Features/SignUp/Sources/ProfileInput/AuthGreeting/AuthGreetingView.swift AuthGreetingView 수정, MVI 아키텍처 사용.
Projects/Features/SignUp/Sources/ProfileInput/AuthName/AuthNameInputIntent.swift AuthNameInputIntent 클래스 추가, 이름 입력 관련 상호작용 관리.
Projects/Features/SignUp/Sources/ProfileInput/AuthName/AuthNameInputModel.swift AuthNameInputModel 클래스 추가, 이름 입력 상태 관리.
Projects/Features/SignUp/Sources/ProfileInput/AuthName/AuthNameInputView.swift AuthNameInputView 수정, 상태 관리 로직 변경.
Projects/Features/SignUp/Sources/ProfileInput/AuthProfileAge/AuthProfileAgeInputIntent.swift AuthProfileAgeInputIntent 클래스 추가, 나이 입력 관련 상호작용 관리.
Projects/Features/SignUp/Sources/ProfileInput/AuthProfileAge/AuthProfileAgeInputModel.swift AuthProfileAgeInputModel 클래스 추가, 나이 입력 상태 관리.
Projects/Features/SignUp/Sources/ProfileInput/AuthProfileAge/AuthProfileAgeInputView.swift AuthProfileAgeInputView 수정, 상태 관리 로직 변경.
Projects/Features/SignUp/Sources/ProfileInput/AuthProfileGenderInput/AuthProfileGenderInputIntent.swift AuthProfileGenderInputIntent 클래스 추가, 성별 입력 관련 상호작용 관리.
Projects/Features/SignUp/Sources/ProfileInput/AuthProfileGenderInput/AuthProfileGenderInputModel.swift AuthProfileGenderInputModel 클래스 추가, 성별 입력 상태 관리.
Projects/Features/SignUp/Sources/ProfileInput/AuthProfileGenderInput/AuthProfileGenderInputView.swift AuthProfileGenderInputView 수정, 상태 관리 로직 변경.
Projects/Features/SignUp/Sources/ProfileInput/AuthProfileGenderInput/GenderType.swift GenderType 열거형 추가, 성별 선택 관련 이미지 관리.
XcodeTemplate/SwiftUI MVI.xctemplate/TemplateInfo.plist SwiftUI MVI 템플릿 메타데이터 추가.
XcodeTemplate/SwiftUI MVI.xctemplate/___FILEBASENAME___Intent.swift 새로운 의도 클래스 및 프로토콜 추가.
XcodeTemplate/SwiftUI MVI.xctemplate/___FILEBASENAME___Model.swift 새로운 모델 클래스 및 프로토콜 추가.
XcodeTemplate/SwiftUI MVI.xctemplate/___FILEBASENAME___View.swift 새로운 뷰 클래스 추가, MVI 아키텍처 사용.

Possibly related PRs

Suggested labels

Feature, Design

🐰 변화의 바람이 불어와,
새로운 길로 나아가네.
코드가 춤추고, 뷰가 빛나,
함께하는 여정, 즐거운 날!
모두가 함께 손잡고,
더 나은 세상으로 뛰어가네! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jisu15-kim jisu15-kim merged commit ffbacdc into develop Oct 8, 2024
1 of 2 checks passed
@jisu15-kim jisu15-kim deleted the feature/WEAV-80 branch October 8, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infra refactor 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant