[3팀 장루빈] Chapter 2-1. 클린코드와 리팩토링 #59
Open
JangRuBin2 wants to merge 17 commits intohanghae-plus:mainfrom
Open
Conversation
- 이벤트 스토어를 통한 중앙화된 이벤트 관리 - DOM 요소 생성과 이벤트 등록 분리 - 전역 변수 sum 제거 및 함수화 - DOM 요소 접근을 위한 헬퍼 함수들 생성 - 재고 계산 함수를 reduce로 개선 - 안전한 DOM 접근을 위한 null 체크 추가 Closes: #이벤트_관리_개선
- GitHub Actions 워크플로우 생성 (.github/workflows/deploy.yml) - Vite 설정 수정 (base path, build 설정) - package.json에 배포 스크립트 추가 - README.md에 배포 정보 추가 - gh-pages 의존성 설치 배포 URL: - 메인: https://jangrubin2.github.io/front_6th_chapter2-1/ - Basic: https://jangrubin2.github.io/front_6th_chapter2-1/index.basic.html - Advanced: https://jangrubin2.github.io/front_6th_chapter2-1/index.advanced.html
- index.html에서 main.original.js 대신 main.basic.js 참조 - 리팩토링된 코드가 메인 페이지에서 실행되도록 수정
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/hanghae-plus/front_6th_chapter2-1
과제 체크포인트
기본과제
심화과제
과제 셀프회고
과제를 하면서 내가 제일 신경 쓴 부분은 무엇인가요?
AI가 다해줬다는 사람들이 있길래 정말 다해주는지 확인하기 위해 모든 것을 한 번에 AI에게 맡겨서 처리하도록 해봤다.
결과는 당연히 꽝이었다.
✅ 하나씩 단계적으로 진행했을 때는 문제가 없었다.
핵심 원칙: "기존 기능이 깨지면 리팩토링이 아니다"
❌ 과도한 추상화: 모든 것을 완벽하게 분리
✅ 실용적 접근: 필요한 만큼만 분리
DOM 요소 접근 안전성
과제를 다시 해보면 더 잘 할 수 있었겠다 아쉬운 점이 있다면 무엇인가요?
일괄적 변경은 안됨
모든 전역 변수를 한 번에 스토어로 변경 혹은 모든 DOM요소 랜더링 후 이벤트 리스너를 만들었는데 테스트코드를 통과하지 못했다.
직접 방향성을 제시해줄 때는 AI가 참 편리하게 일을 대신해줬다.
Git 작업의 복잡성
중간에 detached HEAD상태인지도 모르고 커밋을 했다가 모든 작업 내용을 날릴 뻔 했다.
cursor와 vsCode를 연결하는 과정에서 문제가 생긴듯한데 원인은 정확하게 찾지 못했다.
앞으로는 작업중에도 git 상태를 확인하는 습관을 들여야할 듯 함
체계적인 계획 부족
아쉬운 점: 처음부터 전체 아키텍처를 설계하지 않음
개선 방안: 리팩토링 전 전체 구조도를 그려보기
문서화 부족
README를 작성하는 습관을 들여야하는데 아직도 익숙하지 않은듯 함
리뷰 받고 싶은 내용이나 궁금한 것에 대한 질문 편하게 남겨주세요 :)