Skip to content

Release#39

Closed
GyeongHoKim wants to merge 18 commits intomainfrom
develop
Closed

Release#39
GyeongHoKim wants to merge 18 commits intomainfrom
develop

Conversation

@GyeongHoKim
Copy link
Owner

@GyeongHoKim GyeongHoKim commented Mar 17, 2025

User description

Resolves #8, #32, #36


PR Type

Bug fix, Enhancement, Tests


Description

  • Fix ShadowDOM issue with Kakao APIs

  • Add kakao-map component with extensive properties

  • Add map context for component communication

  • Implement semantic-release CI workflow


Changes walkthrough 📝

Relevant files
Enhancement
10 files
map.ts
Add main kakao-map web component                                                 
+444/-0 
errors.ts
Add error types for Kakao map components                                 
+77/-0   
guards.ts
Add type guards for LatLng and Point types                             
+21/-0   
map-context.ts
Add map context for component communication                           
+4/-0     
latlng.d.ts
Add LatLng type definition                                                             
+8/-0     
point.d.ts
Add Point type definition                                                               
+8/-0     
index.ts
Export map component in package index                                       
+1/-0     
index.ts
Add index file for map component exports                                 
+1/-0     
index.ts
Add index file for context exports                                             
+1/-0     
component-index.html
Update component test HTML with proper styling                     
+13/-1   
Tests
2 files
map.component.ts
Add tests for kakao-map component                                               
+291/-0 
api-loader.component.ts
Update tests for api-loader without shadowDOM                       
+16/-14 
Bug fix
1 files
api-loader.ts
Remove shadow DOM to fix Kakao API issue                                 
+13/-12 
Configuration changes
2 files
release.config.js
Add semantic-release configuration                                             
+46/-0   
release.yaml
Update GitHub workflow to use semantic-release                     
+13/-48 
Dependencies
2 files
package.json
Add dependencies and update version for semantic-release 
+10/-1   
package.json
Add npm-run-all dev dependency                                                     
+1/-0     
Additional files
3 files
LICENSE +0/-21   
LICENSE +0/-21   
pnpm-lock.yaml +1997/-5

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • …find it
    
     - remove slots(cannot use without shadowDOM)
      - open shadowDOM
    …piLoader
    
    - @State() 데코레이터를 @Property()로 변경하고 reflect를 넣어 외부에서 Loading과 Error 상태 확인 가능하도록 수정
    - error 속성에 대한 변환기 추가로 에러 이벤트 처리 방식 수정
    - kakao-api-loader 컴포넌트에 대한 테스트 추가
    - shadowRoot 속성이 null인지 확인하는 테스트 케이스 구현
    - @lit/context 라이브러리 의존성 추가
    - 카카오 맵 컨텍스트 생성을 위한 map-context.ts 파일 구현
    - 컨텍스트 관련 인덱스 파일 생성
    - 카카오 맵 생성 시 map-created 이벤트가 발생하는지 확인하는 테스트 케이스 구현
    - component-index.html 파일에 스타일 추가 및 데이터 속성 수정
    - 카카오 맵 컴포넌트를 위한 map.ts 파일 구현
    - 맵 관련 속성과 이벤트 처리 로직 추가
    - LatLng 및 Point 타입 정의 추가
    - map-context.ts에 MapContext 타입 추가
    - index.ts에서 맵 컴포넌트와 관련된 모듈 내보내기
    … to .gitignore
    
    - package.json에 Cypress 테스트 스크립트 추가
    - .gitignore에 스크린샷 디렉토리 추가
    - 카카오 맵 컴포넌트의 다양한 이벤트(위치 이동, 줌, 클릭 등)에 대한 테스트 케이스 추가
    - 드래그 가능 및 줌 가능 속성에 대한 테스트 구현
    - 맵 타입 ID 속성 처리 테스트 추가
    - mapTypeId 속성을 문자열에서 숫자로 변경하고, 속성 변환 로직 추가
    - kakao.maps.MapTypeId에 대한 변환 기능 구현
    - 카카오맵 컴포넌트에 에러 처리 메서드 추가
    - KakaoMapError, KakaoMapAPIError, KakaoMapContainerError, KakaoMapOptionsError 클래스 구현
    - LatLng 및 Point 타입을 확인하는 타입 가드 함수 추가
    - 에러 발생 시 'kakao-map-error' 이벤트 전파 기능 추가
    - GitHub Actions의 릴리스 워크플로우를 수정하여 태그 대신 main 브랜치에 푸시 시 릴리스가 이루어지도록 변경
    - semantic-release 관련 패키지 추가 및 설정 파일 생성
    - semantic-release 관련 의존성 추가
    - 불필요한 버전 추출 및 검증 단계 제거
    @GyeongHoKim GyeongHoKim self-assigned this Mar 17, 2025
    @GyeongHoKim GyeongHoKim added enhancement New feature or request feature I added new feature, please review my code labels Mar 17, 2025
    @github-actions
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🎫 Ticket compliance analysis ✅

    32 - Fully compliant

    Compliant requirements:

    • Fix issue with Kakao Map inside kakao-api-loader component
    • Address issue where Kakao map can't render markers and polylines properly inside shadowRoot
    • Fix the problem where Kakao map uses document.querySelector to render elements

    8 - Fully compliant

    Compliant requirements:

    • Create kakao-map component

    36 - Fully compliant

    Compliant requirements:

    • Apply semantic-release CI workflow
    • Automate version management and npm releasing
    • Focus on commit messages rather than debugging versions

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Error Exposure

    The error property is converted and reflected to attributes which might expose error details in the DOM. Consider if error details should be externally visible.

    @property({
      type: Object,
      reflect: true,
      converter: {
        toAttribute: (value: ErrorEvent | undefined) => value ? '' : null,
        fromAttribute: (value: string | null) => value !== null ? new ErrorEvent('error') : undefined
      }
    })
    error: ErrorEvent | undefined;
    Error Handling

    In the connectedCallback method, there's nested error handling that might lead to confusing behavior. The outer catch might swallow important errors from the inner catch block.

    try {
      super.connectedCallback();
      this._container = document.createElement('div');
      this._container.id = `${SIGNATURE}_Map_Container`;
      this._container.style.width = '100%';
      this._container.style.height = '100%';
      this.appendChild(this._container);
    
      if (window.kakao && window.kakao.maps) {
        this._initializeMap();
      } else {
        const apiLoader = this.closest('kakao-api-loader');
        if (apiLoader) {
          apiLoader.addEventListener('kakao-api-loaded', () => {
            try {
              if (window.kakao && window.kakao.maps) {
                this._initializeMap();
              }
            } catch (error) {
              this._handleError(error instanceof Error ? new KakaoMapError(error.message) : new KakaoMapError('Unknown error occurred'));
            }
          }, { once: true });
        } else {
          throw new KakaoMapAPIError();
        }
      }
    } catch (error) {
      this._handleError(error instanceof KakaoMapError ? error : new KakaoMapError('Unknown error occurred'));
    }
    Resource Cleanup

    The disconnectedCallback doesn't fully clean up all resources. Event listeners might not be properly removed if the _map is undefined but was previously set.

    disconnectedCallback() {
      super.disconnectedCallback();
      this._removeEventListeners();
    
      if (this._loadCallback) {
        Loader.removeLoadEventLisnter(this._loadCallback);
        this._loadCallback = null;
      }
    
      if (this._container) {
        this._container.innerHTML = '';
        if (this._container.parentNode === this) {
          this.removeChild(this._container);
        }
        this._container = null;
      }
    
      this._map = undefined;

    @github-actions
    Copy link

    PR Code Suggestions ✨

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    enhancement New feature or request feature I added new feature, please review my code Review effort 4/5

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    Component: kakao-map

    1 participant