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] lottie-react 재도입 및 patch를 이용한 번들 사이즈 감소 #466

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

eonseok-jeon
Copy link
Member

@eonseok-jeon eonseok-jeon commented Oct 11, 2024

Related Issue : Closes #459


🧑‍🎤 Summary

  • lottie-react 재도입
  • patch를 이용하여 번들 사이즈 줄이기

🧑‍🎤 Screenshot

[수정 전 전체 번들사이즈]
스크린샷 2024-10-10 오후 7 37 44

[수정 후 전체 번들사이즈]
스크린샷 2024-10-11 오전 9 06 02

[수정 전 lottie 번들사이즈]
스크린샷 2024-10-10 오후 7 38 56

[수정 후 lottie 번들사이즈]
스크린샷 2024-10-11 오전 9 06 15

🧑‍🎤 Comment

lottie-web/light 버전을 이용하기 위해 lottie-react에서 lottie-web으로 migration을 해줬는데요
그럴 필요 없이 patch를 이용해서 library를 수정할 수 있더라고요
yarn v2 이상에선 yarn patch를 이용해주면 되었지만
yarn v1를 사용하고 있었기에 patch-package를 이용해줬어요

node_modules/lottie-react 에 있는 파일을 수정해준 뒤
yarn patch-package lottie-react를 통해 patch 해주었어요

똑같이 300KB 정도 세이브 해줄 수 있었습니다 :)

Copy link

height bot commented Oct 11, 2024

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link

@wuzoo wuzoo 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

cloudflare-workers-and-pages bot commented Oct 11, 2024

Deploying sopt-recruiting-frontend-test with  Cloudflare Pages  Cloudflare Pages

Latest commit: de4fdb6
Status: ✅  Deploy successful!
Preview URL: https://b2a0849b.sopt-recruiting-frontend-test.pages.dev
Branch Preview URL: https://refactor--459-lottie-react.sopt-recruiting-frontend-test.pages.dev

View logs

Copy link
Member

@lydiacho lydiacho left a comment

Choose a reason for hiding this comment

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

오 patch package 처음 알게되었는데 해당 라브 설치에 쓰이는 비용보다 이를 통해 라브 최적화한 효과가 더 큰 경우 너무 요긴한 방법이네요!! 덕분에 또 배워갑니다
이거 한번 설치했으니 앞으로 다른 라이브러리 번들 사이즈도 이 친구 통해서 최적화 시키기 좋겠네요

고생하셨습니다! 👍 👍

@eonseok-jeon eonseok-jeon merged commit 3846ef0 into develop Oct 15, 2024
1 check passed
@eonseok-jeon eonseok-jeon deleted the refactor/#459_lottie-react branch October 15, 2024 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Refactor] lottie-react 재도입 및 patch를 이용한 번들 사이즈 감소
3 participants