[4팀 이송이] Chapter 1-2. 프레임워크 없이 SPA 만들기 (2)#63
Open
2Estella wants to merge 6 commits into
Open
Conversation
- createVNode를 const 화살표 함수로 변경하여 최신 스타일 적용 - 자식 노드 평탄화 및 불필요한 값(null, undefined, false, true) 필터링 로직 추가 - type 유효성 검사로 예외 상황 방지 및 안정성 강화
- VNode를 재귀적으로 정규화하는 normalizeVNode 함수 구현 - 다양한 타입의 자식 노드를 처리하는 normalizeChildren 함수 추가 - null, undefined, boolean 값 처리 및 문자열, 숫자 변환 로직 포함
- 가상 노드(VNode)를 실제 DOM 엘리먼트로 변환하는 createElement 함수 구현 - DOM 엘리먼트의 속성과 프로퍼티를 업데이트하는 updateAttributes 함수 추가 - Boolean 속성, 클래스, 스타일, 데이터 속성 처리 로직 포함
- 이벤트 위임을 통해 이벤트를 처리하는 handleEvents 함수 구현 - root 요소에 이벤트 리스너를 설정하는 setupEventListeners 함수 추가 - 특정 요소에 이벤트 핸들러를 추가(addEvent) 및 제거(removeEvent)하는 기능 구현 - WeakMap을 사용하여 메모리 누수 방지 및 효율적인 이벤트 관리
- DOM 요소의 속성을 업데이트하는 updateAttributes 함수 구현 - 가상 DOM 노드를 실제 DOM에 반영하는 updateElement 함수 추가 - 속성 및 이벤트 핸들러 관리 로직 개선 - Boolean 속성 및 클래스 처리 로직 포함
- vNode를 컨테이너에 렌더링(업데이트)하는 renderElement 함수 구현 - 자식 노드가 존재할 경우 updateElement를 통해 업데이트, 없을 경우 createElement로 새 DOM 생성 - 항상 이전 vNode를 저장하여 상태 관리 - 이벤트 위임을 보장하기 위해 setupEventListeners 호출 추가
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.
과제 체크포인트
배포 링크
기본과제
가상돔을 기반으로 렌더링하기
이벤트 위임
심화 과제
Diff 알고리즘 구현
과제 셀프회고
오랜만에 과제해서 힘들었다. 휴!
4팀 공주님들 화이팅 😘
기술적 성장
코드 품질
학습 효과 분석
과제 피드백
리뷰 받고 싶은 내용