-
Notifications
You must be signed in to change notification settings - Fork 1
[25.03.10 / TASK-141] 트래커 제거 및 폴더 구조 정리 #24
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
Conversation
Walkthrough본 PR은 코드 리팩토링 작업의 일환으로, 테스트 파일과 여러 컴포넌트의 import 경로를 단순화하고, 불필요한 이벤트 트래킹 관련 코드와 관련 import들을 제거하였습니다. 또한, 일부 컴포넌트의 metadata 포맷을 단일 라인으로 변환하고, 레이아웃 컴포넌트와 관련된 import 순서 및 구조를 개선하였습니다. 더불어, 재수출용 인덱스 파일과 사용자 추적 기능이 포함된 파일이 삭제되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as 사용자
participant Layout as RootLayout
participant EB as ErrorBoundary
participant Suspense as Suspense Wrapper
participant Child as 자식 컴포넌트
Client->>Layout: 앱 요청
Layout->>EB: ErrorBoundary 적용
EB->>Suspense: Suspense로 자식 감싸기
Suspense->>Child: 자식 컴포넌트 렌더링
sequenceDiagram
participant User as 사용자
participant Login as Login 컴포넌트
participant API as 인증 API
User->>Login: 로그인 정보 입력
Login->>API: 인증 요청 (useMutation)
API-->>Login: 응답 수신
Login->>Login: onSuccess 처리 후 replace 호출
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/app/(auth-required)/main/Content.tsx (1)
6-7
: 컴포넌트 임포트 경로가 개선되었습니다.공용 컴포넌트는 '@/components'에서 가져오고 페이지별 컴포넌트는 './components'에서 가져오도록 변경되었습니다. 이는 폴더 구조 정리 목적에 부합합니다.
다만, ESLint에서 임포트 순서 관련 경고가 있습니다. './components' 임포트가 '@/types' 임포트 이후에 와야 합니다.
-import { Button, Dropdown, Check } from '@/components'; -import { Section, Summary } from './components'; +import { Button, Dropdown, Check } from '@/components'; import { postList, postSummary } from '@/apis'; import { PATHS, SORT_TYPE } from '@/constants'; import { useSearchParam } from '@/hooks/useSearchParam'; import { SortKey, SortValue } from '@/types'; +import { Section, Summary } from './components';🧰 Tools
🪛 ESLint
[error] 7-7:
./components
import should occur after import of@/types
(import/order)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (6)
src/components/Icon/icons/Analytics.svg
is excluded by!**/*.svg
src/components/Icon/icons/Arrow.svg
is excluded by!**/*.svg
src/components/Icon/icons/Compare.svg
is excluded by!**/*.svg
src/components/Icon/icons/Leaderboards.svg
is excluded by!**/*.svg
src/components/Icon/icons/Like.svg
is excluded by!**/*.svg
src/components/Icon/icons/Shortcut.svg
is excluded by!**/*.svg
📒 Files selected for processing (21)
src/__test__/login.test.tsx
(1 hunks)src/__test__/main.test.tsx
(1 hunks)src/app/(auth-required)/compare/page.tsx
(1 hunks)src/app/(auth-required)/components/header/Section.tsx
(0 hunks)src/app/(auth-required)/components/header/index.tsx
(2 hunks)src/app/(auth-required)/layout.tsx
(2 hunks)src/app/(auth-required)/leaderboards/Content.tsx
(2 hunks)src/app/(auth-required)/leaderboards/components/Rank.tsx
(1 hunks)src/app/(auth-required)/main/Content.tsx
(3 hunks)src/app/(auth-required)/main/components/Section/index.tsx
(1 hunks)src/app/(auth-required)/main/components/Summary/index.tsx
(1 hunks)src/app/(login)/Content.tsx
(1 hunks)src/app/(login)/page.tsx
(1 hunks)src/app/(with-tracker)/layout.tsx
(0 hunks)src/app/layout.tsx
(3 hunks)src/components/Input.tsx
(1 hunks)src/components/Providers/index.ts
(1 hunks)src/components/auth-required/index.ts
(0 hunks)src/components/common/index.ts
(0 hunks)src/components/index.ts
(1 hunks)src/utils/trackUtil.tsx
(0 hunks)
💤 Files with no reviewable changes (5)
- src/app/(auth-required)/components/header/Section.tsx
- src/components/common/index.ts
- src/components/auth-required/index.ts
- src/utils/trackUtil.tsx
- src/app/(with-tracker)/layout.tsx
🧰 Additional context used
🪛 ESLint
src/app/(auth-required)/main/Content.tsx
[error] 7-7: ./components
import should occur after import of @/types
(import/order)
🔇 Additional comments (29)
src/app/(auth-required)/leaderboards/components/Rank.tsx (2)
1-1
: 수정된 Import 경로 확인변경된 import 경로(
../../../../components/auth-required/leaderboards/Ranker
)가 의도한 모듈 위치를 정확히 가리키는지 확인해주세요. 폴더 구조 재조직에 따른 변경으로 보이며, 다른 관련 파일에서도 동일한 패턴의 경로 사용 및 일관성이 유지되는지 점검해볼 필요가 있습니다.
3-18
: Rank 컴포넌트 검토컴포넌트 내부의 JSX와 로직은 문제없이 잘 구성되어 있습니다. 다만, 스타일 클래스 네이밍과 관련된 부분이 조직의 UI 가이드라인과 부합하는지 추가로 확인해보면 좋겠습니다.
src/components/Providers/index.ts (1)
1-2
: Provider 컴포넌트 재사출 구현 완료이 변경사항을 통해
ChannelTalkProvider
와QueryProvider
를 중앙에서 재사출하는 구조가 잘 구현되었습니다. 이는 폴더 구조 정리 목표에 부합하며, 컴포넌트 접근성을 향상시킵니다.src/app/(auth-required)/main/components/Section/index.tsx (1)
24-24
: 트래커 기능 성공적으로 제거이전에 존재했던 트래킹 기능을 제거하고 상태 변경 로직만 남겨 코드가 간결해졌습니다. PR 목표인 트래커 제거 작업이 성공적으로 이루어졌습니다.
src/app/(auth-required)/main/components/Summary/index.tsx (1)
39-39
: 트래커 호출 코드 제거 완료요약 정보 섹션의 클릭 이벤트에서 트래킹 관련 코드가 제거되어 더 간결하고 명확한 상태 관리 로직만 남았습니다. PR 목표에 맞게 트래커 제거가 잘 적용되었습니다.
src/app/(login)/page.tsx (1)
4-4
: 메타데이터 포맷 개선여러 줄로 선언되어 있던 메타데이터를 한 줄로 변경하여 코드의 일관성을 유지하였습니다. 작은 변화지만 전체 코드베이스의 통일성 측면에서 좋은 개선입니다.
src/app/(auth-required)/compare/page.tsx (1)
4-4
: Metadata 선언부 개선됨코드 포맷팅이 개선되어 가독성이 향상되었습니다. 메타데이터 선언을 단일 라인으로 변경한 것은 코드베이스 전체의 일관성을 유지하는 데 도움이 됩니다.
src/components/Input.tsx (1)
18-18
: 타입 정의 간소화 적용됨불필요한
| undefined
표현이 제거되었습니다. 선택적 매개변수(?
)가 이미 undefined 가능성을 내포하고 있으므로, 이 변경은 타입 정의를 더 간결하게 만듭니다.src/__test__/login.test.tsx (1)
6-6
: 트래커 경로 제거 완료
(with-tracker)
세그먼트가 import 경로에서 제거되었습니다. 이는 PR 목표인 트래커 제거 및 폴더 구조 정리와 일치합니다. 테스트가 정상적으로 작동하는지 확인해 주세요.src/__test__/main.test.tsx (1)
3-3
: 트래커 경로 제거 완료
(with-tracker)
세그먼트가 import 경로에서 제거되었습니다. 이는 PR 목표인 트래커 제거 및 폴더 구조 정리와 일치합니다. 경로 변경 후 테스트가 정상적으로 작동하는지 확인하세요.src/app/(auth-required)/main/Content.tsx (2)
63-65
: 이벤트 추적 코드가 제거되었습니다.새로고침 버튼의 클릭 이벤트 추적 기능이 제거되었습니다. 이는 PR 목적인 '트래커 제거'에 부합합니다.
87-89
: 정렬 이벤트 추적 코드가 제거되었습니다.드롭다운 변경 시 추적 기능이 제거되었습니다. 이는 PR 목적인 '트래커 제거'에 부합합니다.
src/app/(auth-required)/layout.tsx (2)
2-6
: 임포트 구조가 개선되었습니다.임포트 순서가 재배열되고 Header 컴포넌트의 임포트 경로가 명확해졌습니다. 이는 폴더 구조 정리 목적에 부합합니다.
15-15
: prefetchQuery 메서드 호출이 한 줄로 간소화되었습니다.여러 줄로 작성되었던 prefetchQuery 메서드 호출이 한 줄로 간소화되어 가독성이 향상되었습니다.
src/app/(auth-required)/components/header/index.tsx (2)
3-7
: 임포트 순서가 재배열되었습니다.React 관련 임포트와 내부 유틸리티 함수 임포트의 순서가 재배열되었습니다. 이는 폴더 구조 정리 목적에 부합합니다.
122-122
: 로그아웃 버튼의 이벤트 추적 코드가 제거되었습니다.로그아웃 버튼 클릭 시 호출되던 추적 이벤트가 제거되었습니다. 이는 PR 목적인 '트래커 제거'에 부합합니다.
src/app/(login)/Content.tsx (2)
3-9
: 임포트 순서가 개선되었습니다.useMutation과 LoginVo 임포트의 위치가 재조정되었습니다. 이는 일관된 코드 구조를 위한 변경으로 보입니다.
23-25
: 로그인 성공 시 이벤트 추적 코드가 제거되었습니다.onSuccess 함수에서 이벤트 추적 코드가 제거되었습니다. 이는 PR 목적인 '트래커 제거'에 부합합니다.
src/components/index.ts (1)
1-7
: 컴포넌트 export 구조 개선폴더 구조 정리 작업에 맞게 컴포넌트 export 구조가 단순화되었습니다. 이전의 집합적 export (
auth-required
,common
)에서 각 컴포넌트를 직접 export하는 방식으로 변경되어 컴포넌트의 임포트 경로가 더 명확해졌습니다.src/app/(auth-required)/leaderboards/Content.tsx (3)
3-4
: 불필요한 import 정리import 문이 깔끔하게 정리되었습니다.
7-7
: 컴포넌트 import 경로 변경폴더 구조 정리 작업의 일환으로
Ranker
와Rank
컴포넌트를 로컬./components
디렉토리에서 임포트하도록 변경되었습니다. 이는 컴포넌트 접근성을 향상시키고 관련 컴포넌트를 더 논리적으로 그룹화하는 데 도움이 됩니다.
29-29
: 트래커 제거이벤트 추적 코드(
trackUserEvent(MessageEnum.SORT_INTERACT_BOARD)
)가 제거되어 onChange 함수가 간결해졌습니다. PR의 목표인 트래커 제거 작업이 잘 수행되었습니다.src/app/layout.tsx (7)
1-1
: import 순서 정리GoogleAnalytics import가 최상단으로 이동되었습니다.
5-6
: import 최적화 및 Suspense 추가Sentry import를 네임스페이스 import에서 명시적 import로 변경하고, React의 Suspense 컴포넌트를 추가했습니다. 이는 코드의 가독성을 높이고 비동기 렌더링을 더 효과적으로 처리할 수 있게 해줍니다.
10-10
: 글로벌 CSS import 위치 변경글로벌 CSS import 위치가 적절하게 조정되었습니다.
19-19
: 메타데이터 포맷 개선
alternates
속성이 단일 라인으로 단순화되어 코드의 일관성과 가독성이 향상되었습니다.
38-38
: ErrorBoundary 사용 간소화네임스페이스를 통한 접근 대신 직접
ErrorBoundary
컴포넌트를 사용하여 코드가 더 간결해졌습니다.
42-42
: Suspense로 children 래핑children을 Suspense로 래핑하여 비동기 컴포넌트 로딩을 지원합니다. 이는 성능 최적화와 로딩 상태 관리에 도움이 됩니다.
45-45
: 닫는 태그 정리ErrorBoundary 닫는 태그가 올바르게 정렬되었습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋았던 점
- 폴더 정리가 이번 PR의 이벤트인 것 같아 다른 의견은 없습니다!
PS. 확실히 폴더 정리가 눈이 조금이나마 편해지는 지름길인 것 같아요!🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋㅋ이야... 이건 리펙토링이라 어떻게 피드백이 어렵네요. 대부분이 삭제라 :0
API 쪽도 똑같이 대응 개발 한 뒤에 배포해야 할 것 같은데!
대응 개발이라기엔 어차피 지금까지 트래커를 활성화한 적이 없어서, 천천히 제거하셔도 괜찮을 듯 합니다~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 이번 PR은 미사용하던 기능 정리에 대한거라 이견 없습니다~
이전에 자체제작한 트래커를 제거하고, 눈을 여러 번 옮겨야 했던 폴더 구조를 변경하였습니다.
(페이지 폴더 내부에 해당 페이지에만 쓰이는 컴포넌트 추가)
Summary by CodeRabbit
Refactor
Chore