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

[Refactor] 배럴 파일 삭제 작업 #324

Merged
merged 3 commits into from
Mar 3, 2025

Conversation

KIMGEONHWI
Copy link
Member

📌 Related Issues

  • close #

✅ 체크 리스트

  • PR 제목의 형식을 잘 작성했나요? e.g. [Feat] PR 템플릿 작성
  • 빌드가 성공했나요? (pnpm build)
  • 컨벤션을 지켰나요?
  • 이슈는 등록했나요?
  • 리뷰어와 라벨을 지정했나요?

📄 Tasks

배럴 파일 삭제(이미지, svg)

현재 svg컴포넌트를 배럴 파일(index.ts)을 사용해서 여러 컴포넌트를 한 곳에서 export함으로써 편리성을 제공한다.(+깔끔한 import문), 그러나 빌드 시점에 배럴 파일이 이미 번들에 포함되기 때문에 svg컴포넌트에 lazy를 적용해도 적용되지 않는 문제가 발생한다.

assets하위에 존재하던 이미지 파일 모두 public으로 옮기기

  • 이미지가 번들링 프로세스에 포함되지 않아 빌드 시간이 단축되고, 번들 파일 크기가 줄어들어 전체 애플리케이션 성능이 향상됨. 대쉬 웹은 초기 로딩 성능이 좋지 않기 때문에 public 폴더에 있는 파일은 빌드 시 번들에 포함되지 않고, 서버가 그대로 정적으로 제공하므로 로드 시간에 유리함.
  • public 폴더의 정적 파일은 브라우저 캐시나 CDN을 통해 효율적으로 캐싱할 수 있음

모든 페이지에 적용되어있던 lazy 삭제

  • 무분별하게 모든 페이지에 lazy를 적용하게 되면, 오히려 성능 저하를 발생시킴. 그렇기 때문에 lazy가 꼭 필요한 페이지에만 선택적으로 사용되어야함.

⭐ PR Point (To Reviewer)

📷 Screenshot

🔔 ETC

@KIMGEONHWI KIMGEONHWI added 🪄 Refactor 개발 환경 세팅 건휘 Pull it back, that siren labels Feb 27, 2025
@KIMGEONHWI KIMGEONHWI self-assigned this Feb 27, 2025
@KIMGEONHWI KIMGEONHWI linked an issue Feb 27, 2025 that may be closed by this pull request
1 task
Copy link

✅ 빌드 성공적으로 완료되었지롱롱 🛠️

Copy link
Collaborator

@heesunee heesunee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다! 역시 최적화의 달인 ㅎ

Copy link
Collaborator

@constantly-dev constantly-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SVG 파일 많아서 변경하기 힘들었을텐데 수고하셨습니다!
lazy로 코드 스플리팅을 하기 위해 배럴 파일을 삭제하게 되었는데 import문이 지저분해진다는 단점 외에도 혹시 이렇게 변경했을 때 단점이 또 있을까요?

Copy link
Collaborator

@hansoojeongsj hansoojeongsj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다 ! 덕분에 Barrel 파일도 성능최적화도, 웹에 대해 새롭게 많이 알아가는 것 같습니다:) 👍

Copy link
Collaborator

@rtttr1 rtttr1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~~ 대쉬 최적화 시작~~!!

@KIMGEONHWI
Copy link
Member Author

SVG 파일 많아서 변경하기 힘들었을텐데 수고하셨습니다! lazy로 코드 스플리팅을 하기 위해 배럴 파일을 삭제하게 되었는데 import문이 지저분해진다는 단점 외에도 혹시 이렇게 변경했을 때 단점이 또 있을까요?

없습니다!!

@KIMGEONHWI KIMGEONHWI merged commit fdc50c2 into develop Mar 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
건휘 Pull it back, that siren 🪄 Refactor 개발 환경 세팅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor] 배럴 파일 삭제 작업
5 participants