cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Tree shake icons

Open zomars opened this issue 2 years ago β€’ 2 comments

What does this PR do?

Adds tree shaking support four our UI icons. Taken from here.

https://react-icons.github.io/react-icons/

Environment: Staging(main branch) / Production

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] Chore (refactoring code, technical debt, workflow improvements)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How should this be tested?

  • [ ] Test A
  • [ ] Test B

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't performed a self-review of my own code and corrected any misspellings
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my PR needs changes to the documentation
  • I haven't checked if my changes generate no new warnings
  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

zomars avatar Feb 11 '23 01:02 zomars

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated
cal βœ… Ready (Inspect) Visit Preview πŸ’¬ Add your feedback Mar 2, 2023 at 8:00PM (UTC)
ui βœ… Ready (Inspect) Visit Preview πŸ’¬ Add your feedback Mar 2, 2023 at 8:00PM (UTC)

vercel[bot] avatar Feb 11 '23 01:02 vercel[bot]

Very nice @zomars! I did test for the previous setup if unused icons where in the bundle, and that wasn’t the case anymore. So I think they where already tree shaken properly. However, I think your change is even better since now we also can’t mess up the tree shaking by accident πŸ”₯

I’m only wondering if we still need to have the icons file in our repo, since we directly map this to npm now? Although I can imagine that typescript would get confused if we’d import from a file that doens’t exist.

Apart from that a great change! Let me know when it’s out of draft.

JeroenReumkens avatar Feb 11 '23 07:02 JeroenReumkens

Have had a look at the comment @JeroenReumkens left; if what he's seeing is correct and tree shaking is already happening, I would argue this PR needlessly complicates the setup.

emrysal avatar Feb 13 '23 11:02 emrysal

isnt this ready to merge? seems pretty good to me + approved by two people @zomars

PeerRich avatar Feb 23 '23 14:02 PeerRich

Waiting on bundle analyzer to give us the final veredict

zomars avatar Mar 02 '23 19:03 zomars

πŸ“¦ Next.js Bundle Analysis

This analysis was generated by the next.js bundle analysis action πŸ€–

πŸŽ‰ Global Bundle Size Decreased

Page Size (compressed)
global 209.95 KB (🟒 -2.77 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Sixty-eight Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/404 8.34 KB 218.29 KB 62.37% (🟑 +0.09%)
/500 5.96 KB 215.91 KB 61.69% (🟑 +0.05%)
/[user] 110.84 KB 320.79 KB 91.66% (🟑 +0.05%)
/[user]/[type] 98.57 KB 308.52 KB 88.15% (🟑 +0.16%)
/[user]/[type]/embed 98.6 KB 308.55 KB 88.16% (🟑 +0.16%)
/[user]/book 187.63 KB 397.58 KB 113.59% (🟑 +0.60%)
/[user]/embed 110.91 KB 320.86 KB 91.67% (🟑 +0.06%)
/apps 169.69 KB 379.64 KB 108.47% (🟑 +0.85%)
/apps/[slug] 193.56 KB 403.51 KB 115.29% (🟑 +0.93%)
/apps/[slug]/[...pages] 392.6 KB 602.55 KB 172.16% (🟑 +1.10%)
/apps/categories 155.02 KB 364.97 KB 104.28% (🟑 +0.79%)
/apps/categories/[category] 158.29 KB 368.24 KB 105.21% (🟑 +0.80%)
/apps/installed/[category] 196.39 KB 406.34 KB 116.10% (🟑 +0.92%)
/auth/error 19.21 KB 229.16 KB 65.47% (🟑 +0.04%)
/auth/login 195.34 KB 405.29 KB 115.80% (🟑 +0.07%)
/auth/logout 7.54 KB 217.49 KB 62.14% (🟑 +0.04%)
/auth/setup 241.89 KB 451.84 KB 129.10% (🟑 +0.22%)
/availability 158.25 KB 368.2 KB 105.20% (🟑 +0.84%)
/availability/[schedule] 269.39 KB 479.34 KB 136.95% (🟑 +0.94%)
/availability/troubleshoot 155.71 KB 365.66 KB 104.47% (🟑 +0.80%)
/booking/[uid] 129.62 KB 339.57 KB 97.02% (🟑 +0.10%)
/bookings/[status] 265.88 KB 475.83 KB 135.95% (🟑 +1.05%)
/d/[link]/[slug] 98.23 KB 308.18 KB 88.05% (🟑 +0.17%)
/d/[link]/[slug]/embed 98.26 KB 308.21 KB 88.06% (🟑 +0.16%)
/d/[link]/book 187.28 KB 397.23 KB 113.49% (🟑 +0.60%)
/event-types 241.7 KB 451.65 KB 129.04% (🟒 -30.17%)
/event-types/[type] 275.49 KB 485.44 KB 138.70% (🟒 -29.79%)
/getting-started/[[...step]] 328.49 KB 538.44 KB 153.84% (🟒 -0.02%)
/more 154.64 KB 364.59 KB 104.17% (🟑 +0.79%)
/payment/[uid] 68.51 KB 278.46 KB 79.56% (🟑 +0.05%)
/settings/admin 160.07 KB 370.02 KB 105.72% (🟑 +0.96%)
/settings/admin/apps 192.96 KB 402.91 KB 115.12% (🟑 +1.00%)
/settings/admin/apps/[category] 192.94 KB 402.89 KB 115.11% (🟑 +1.00%)
/settings/admin/impersonation 160.35 KB 370.3 KB 105.80% (🟑 +0.96%)
/settings/billing 160.27 KB 370.22 KB 105.78% (🟑 +0.95%)
/settings/developer/api-keys 189.34 KB 399.29 KB 114.08% (🟑 +0.96%)
/settings/developer/webhooks 162.68 KB 372.63 KB 106.46% (🟑 +0.97%)
/settings/developer/webhooks/[id] 191.62 KB 401.57 KB 114.73% (🟑 +0.97%)
/settings/developer/webhooks/new 191.48 KB 401.43 KB 114.69% (🟑 +0.97%)
/settings/my-account/appearance 174.12 KB 384.07 KB 109.73% (🟑 +0.99%)
/settings/my-account/calendars 192.48 KB 402.43 KB 114.98% (🟑 +0.97%)
/settings/my-account/conferencing 164.53 KB 374.48 KB 106.99% (🟑 +0.98%)
/settings/my-account/general 264.9 KB 474.85 KB 135.67% (🟑 +0.97%)
/settings/my-account/profile 436.87 KB 646.82 KB 184.81% (🟑 +0.83%)
/settings/security/impersonation 162.22 KB 372.17 KB 106.34% (🟑 +0.95%)
/settings/security/password 331.51 KB 541.46 KB 154.70% (🟑 +0.96%)
/settings/security/sso 169.9 KB 379.85 KB 108.53% (🟑 +0.91%)
/settings/security/two-factor-auth 302.71 KB 512.66 KB 146.48% (🟑 +0.80%)
/settings/teams 159.82 KB 369.77 KB 105.65% (🟑 +0.96%)
/settings/teams/[id]/appearance 174.15 KB 384.1 KB 109.74% (🟑 +0.99%)
/settings/teams/[id]/billing 160.05 KB 370 KB 105.71% (🟑 +0.96%)
/settings/teams/[id]/members 295.87 KB 505.82 KB 144.52% (🟑 +1.02%)
/settings/teams/[id]/onboard-members 73.84 KB 283.79 KB 81.08% (🟑 +0.18%)
/settings/teams/[id]/profile 272.49 KB 482.44 KB 137.84% (🟑 +1.02%)
/settings/teams/[id]/sso 170 KB 379.95 KB 108.56% (🟑 +0.91%)
/settings/teams/new 113.06 KB 323.01 KB 92.29% (🟑 +0.28%)
/signup 25.2 KB 235.15 KB 67.18% (+/- <0.01%)
/team/[slug] 113.58 KB 323.53 KB 92.44% (🟑 +0.15%)
/team/[slug]/[type] 98.23 KB 308.18 KB 88.05% (🟑 +0.17%)
/team/[slug]/[type]/embed 98.26 KB 308.21 KB 88.06% (🟑 +0.16%)
/team/[slug]/book 187.28 KB 397.23 KB 113.49% (🟑 +0.60%)
/team/[slug]/embed 113.64 KB 323.59 KB 92.46% (🟑 +0.15%)
/teams 154.86 KB 364.81 KB 104.23% (🟑 +0.84%)
/video/meeting-ended/[uid] 22.75 KB 232.7 KB 66.48% (🟑 +0.09%)
/video/meeting-not-started/[uid] 22.79 KB 232.74 KB 66.50% (🟑 +0.08%)
/video/no-meeting-found 6.96 KB 216.91 KB 61.97% (🟑 +0.06%)
/workflows 167.75 KB 377.7 KB 107.92% (🟑 +0.91%)
/workflows/[workflow] 295.72 KB 505.67 KB 144.48% (🟑 +0.86%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/-

github-actions[bot] avatar Mar 02 '23 20:03 github-actions[bot]

I'll take this as a win

image image

zomars avatar Mar 02 '23 20:03 zomars

Current Playwright Test Results Summary

βœ… 53 Passing - ❌ 1 Failing

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 03/02/2023 08:15:55pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 6e0377ce350d175e5389003e0ce3e315ee3959a5

Started: 03/02/2023 08:11:18pm UTC

❌ Failures

πŸ“„ Β  apps/web/playwright/event-types.e2e.ts β€’ 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Event Types tests user can add multiple organizer address
Initial Attempt
Error: Test timeout of 60000ms exceeded.
Test timeout of 60000ms exceeded.
60% (3) 3 / 5 runs
failed over last 7 days
0% (0) 0 / 5 runs
flaked over last 7 days

View Detailed Build Results


deploysentinel[bot] avatar Mar 02 '23 20:03 deploysentinel[bot]