-
Notifications
You must be signed in to change notification settings - Fork 2
[Refactor] sprinkles 제거 #668
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
base: develop
Are you sure you want to change the base?
Conversation
|
✅ Storybook 배포 완료! 🔗 https://67e4fd1fd2c7078dceec04a4-lfqhgxbyyb.chromatic.com/ |
constantly-dev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hansoojeongsj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐⭐⭐⭐⭐
| export const snsLinksStyle = style({ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| gap: '0.4rem', | ||
| }); | ||
|
|
||
| export const snsLinkStyle = style({ | ||
| display: 'flex', | ||
| gap: '0.4rem', | ||
| alignItems: 'center', | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
두개당
| @@ -1,6 +1,5 @@ | |||
| import * as styles from '@/pages/reservation/components/ApplicantInfo/applicantInfo.css'; | |||
| import { bookerComponentStyle, textLabelStyle, rowStyle } from '@/pages/reservation/components/ApplicantInfo/applicantInfo.css'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style을 * as로 가져오지 않기로 한 것도 전부 지켜 주셨네요 짱짱

📌 Related Issues
✅ 체크 리스트
📄 Tasks
pnpm analyze로 번들 분석 가능⭐ PR Point
배포를 대비해 번들을 좀 분석해 최적화를 해보고자 해요.
초기에 받아오는 번들인데요, 딱봐도 거대해서 뭔가 문제가 많아 보여요.
특히 가장 먼저 눈에 띈 부분은 sprinkles.css가 아래와 같이 무려
5.57%의 번들을 잡아먹고 있다는 점이에요.제가 옛날에 추가한 이 sprinkles가 사실 상당히 잘못된 방법인거죠.
이 12개의 속성들에 1~375 까지의 값을 다 넣어주었으니 12 * 375 = 4500 개의 css class를 만들어야해요.
그로 인해 위와 같이 매우 큰 용량의 덩어리가 생긴거에요.
이에 저는 과거의 저의 과오를 씻고자 열심히 sprinkles를 지워주었답니다. (물론 cursor가 슥삭 해주긴 했어요)
제거를 해주었더니 정확히 sprinkles.css 크기인 289.6kb 만큼 초기 번들 크기가 줄어들게 되었어요.
이로 인해 최종적으로 production, 모바일 환경에서 LCP 지수가 무려 1초나 개선되었어요.
📷 Screenshot
🔔 ETC