[Feat] Image의 placeholder를 활용한 홈 화면 행성 이미지 렌더링 최적화 #159
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.
연관 이슈
close #155
개요
Image의 placeholder를 활용한 홈 화면 행성 이미지 렌더링 최적화
✅ 작업 내용
/planet페이지 로딩 컴포넌트 상단 흰 여백 제거🖥 구현 결과
default.mp4
placeholder.mp4
리뷰 요구사항
📝 기타 사항
고속 4G혹은저속 4G로 확인하면 행성 이미지가 보이기 전에 블러 처리되어 행성 없이 행성명만 둥둥 뜨지 않게 했습니다! 저번에MS Clarity로 사용자 화면 분석해보니 메인 행성에서 이미지가 늦게 나오는 경우들이 있더라구요.. 짧은 순간이어도 좀 크리티컬 한 것 같아서 수정해보았습니다. 동적으로 blurDataUrl을 만들어오는 방법도 있는 것 같은데 왜인지 자꾸 안 되어서 (일반적인 url이 아닌, public 경로에 있는 로컬 데이터를 동적으로 받아오기 때문이 아닐지..) 각 이미지 경로별로 base64 데이터를 추출해서constant로 관리하는 방법으로 구현했습니다. (따라서,src/constants/planetBlur.ts데이터가 좀.. 아니 매우 길어요!!)LCP가 오히려 조금 늦어지는 것 같기도 한데, 좀 더 좋은 방식이 있는지 보고 추후 유저 경험도 살펴보면서 어떤 걸 우선적으로 고려할지 결정해 그에 따라 바꿔도 좋을 거 같아요!