Skip to content

perf: Remove non booker apps from booker page#10905

Merged
zomars merged 1 commit intomainfrom
perf/booking-bundle-only-booker-apps
Aug 24, 2023
Merged

perf: Remove non booker apps from booker page#10905
zomars merged 1 commit intomainfrom
perf/booking-bundle-only-booker-apps

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara commented Aug 23, 2023

What does this PR do?

Creates a separate bookerApps.metadata.generated.ts module to load only those app's config that we need on booker page.
It reduces bundle size(though not that significant improvemen. But more importantly, it ensures that any new app's config won't be added to booker bundle unless it's needed there

Fixes #7276

Type of change

  • Performance Improvement

How should this be tested?

  • Do some bookings with different type of conferencing apps(Static, Dynamic)
  • Test an analytics app GTM App

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 24, 2023 7:49am
cal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 24, 2023 7:49am
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 24, 2023 7:49am
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 24, 2023 7:49am
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Aug 24, 2023 7:49am
qa ⬜️ Ignored (Inspect) Visit Preview Aug 24, 2023 7:49am

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 23, 2023

Thank you for following the naming conventions! 🙏

@zomars zomars added the core area: core, team members only label Aug 23, 2023
@hariombalhara hariombalhara force-pushed the perf/booking-bundle-only-booker-apps branch 2 times, most recently from 404d95b to 716cfd3 Compare August 23, 2023 14:10
});

function forEachAppDir(callback: (arg: App) => void) {
function forEachAppDir(callback: (arg: App) => void, filter: (arg: App) => boolean = () => true) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

filter support to allow us to do things for apps statisfying a certain condition

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 23, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 154.78 KB (🟢 -554 B)
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-seven 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)
/[user]/[type] 228.71 KB 383.49 KB 109.57% (🟢 -1.42%)
/[user]/[type]/embed 228.74 KB 383.52 KB 109.58% (🟢 -1.42%)
/apps 282.01 KB 436.79 KB 124.80% (🟡 +0.21%)
/apps/[slug] 300.03 KB 454.8 KB 129.94% (🟡 +0.22%)
/apps/[slug]/[...pages] 519.8 KB 674.58 KB 192.74% (🟢 -5.07%)
/apps/categories 243.64 KB 398.42 KB 113.83% (🟡 +0.22%)
/apps/categories/[category] 264.85 KB 419.62 KB 119.89% (🟡 +0.21%)
/apps/installed/[category] 263.05 KB 417.83 KB 119.38% (🟡 +0.35%)
/availability 279.12 KB 433.9 KB 123.97% (🟡 +0.15%)
/availability/[schedule] 344.28 KB 499.06 KB 142.59% (🟡 +0.20%)
/availability/troubleshoot 244.31 KB 399.09 KB 114.03% (🟡 +0.21%)
/booking/[uid] 180.53 KB 335.31 KB 95.80% (🟢 -1.26%)
/d/[link]/[slug] 228.7 KB 383.48 KB 109.57% (🟢 -1.42%)
/event-types 520.32 KB 675.09 KB 192.88% (🟡 +0.24%)
/event-types/[type] 373.6 KB 528.38 KB 150.97% (🟡 +0.66%)
/insights 462.6 KB 617.38 KB 176.39% (🟡 +0.21%)
/more 243.27 KB 398.04 KB 113.73% (🟡 +0.21%)
/org/[orgSlug]/[user]/[type] 228.87 KB 383.65 KB 109.61% (🟢 -1.42%)
/org/[orgSlug]/[user]/[type]/embed 228.9 KB 383.67 KB 109.62% (🟢 -1.42%)
/org/[orgSlug]/team/[slug]/[type] 228.74 KB 383.51 KB 109.57% (🟢 -1.42%)
/payment/[uid] 107.53 KB 262.31 KB 74.95% (🟢 -1.28%)
/settings/admin 249.6 KB 404.38 KB 115.54% (🟡 +0.21%)
/settings/admin/apps 261.8 KB 416.58 KB 119.02% (🟡 +0.21%)
/settings/admin/apps/[category] 261.76 KB 416.53 KB 119.01% (🟡 +0.21%)
/settings/admin/flags 253.15 KB 407.93 KB 116.55% (🟡 +0.21%)
/settings/admin/impersonation 249.87 KB 404.65 KB 115.61% (🟡 +0.22%)
/settings/admin/kycVerification 250.05 KB 404.83 KB 115.67% (🟡 +0.21%)
/settings/admin/organizations 250.65 KB 405.43 KB 115.84% (🟡 +0.15%)
/settings/admin/users 251.64 KB 406.42 KB 116.12% (🟡 +0.21%)
/settings/admin/users/[id]/edit 340.01 KB 494.79 KB 141.37% (🟡 +0.27%)
/settings/admin/users/add 339.71 KB 494.49 KB 141.28% (🟡 +0.27%)
/settings/billing 249.74 KB 404.51 KB 115.57% (🟡 +0.22%)
/settings/developer/api-keys 254.28 KB 409.06 KB 116.87% (🟡 +0.22%)
/settings/developer/webhooks 253.85 KB 408.62 KB 116.75% (🟡 +0.21%)
/settings/developer/webhooks/[id] 254.57 KB 409.34 KB 116.95% (🟡 +0.22%)
/settings/developer/webhooks/new 254.52 KB 409.3 KB 116.94% (🟡 +0.22%)
/settings/my-account/appearance 268.31 KB 423.09 KB 120.88% (🟡 +0.21%)
/settings/my-account/calendars 256.16 KB 410.94 KB 117.41% (🟡 +0.21%)
/settings/my-account/conferencing 255.66 KB 410.44 KB 117.27% (🟡 +0.35%)
/settings/my-account/general 337.22 KB 492 KB 140.57% (🟡 +0.27%)
/settings/my-account/profile 373.23 KB 528 KB 150.86% (🟡 +0.21%)
/settings/organizations/appearance 256.38 KB 411.16 KB 117.47% (🟡 +0.22%)
/settings/organizations/billing 249.58 KB 404.35 KB 115.53% (🟡 +0.21%)
/settings/organizations/general 329.65 KB 484.43 KB 138.41% (🟡 +0.21%)
/settings/organizations/members 364.94 KB 519.71 KB 148.49% (🟡 +0.21%)
/settings/organizations/profile 370.7 KB 525.47 KB 150.14% (🟡 +0.21%)
/settings/organizations/teams/other 250.72 KB 405.5 KB 115.86% (🟡 +0.21%)
/settings/organizations/teams/other/[id]/appearance 259.12 KB 413.89 KB 118.26% (🟡 +0.21%)
/settings/organizations/teams/other/[id]/members 253.29 KB 408.07 KB 116.59% (🟡 +0.21%)
/settings/organizations/teams/other/[id]/profile 440.28 KB 595.06 KB 170.02% (🟡 +0.19%)
/settings/security/impersonation 252.25 KB 407.03 KB 116.29% (🟡 +0.22%)
/settings/security/password 261.77 KB 416.55 KB 119.01% (🟡 +0.21%)
/settings/security/sso 258.49 KB 413.26 KB 118.08% (🟡 +0.19%)
/settings/security/two-factor-auth 254.89 KB 409.66 KB 117.05% (🟡 +0.21%)
/settings/teams 249.34 KB 404.12 KB 115.46% (🟡 +0.22%)
/settings/teams/[id]/appearance 259.1 KB 413.88 KB 118.25% (🟡 +0.21%)
/settings/teams/[id]/billing 249.58 KB 404.36 KB 115.53% (🟡 +0.21%)
/settings/teams/[id]/members 371.24 KB 526.01 KB 150.29% (🟡 +0.20%)
/settings/teams/[id]/onboard-members 151.42 KB 306.2 KB 87.49% (🟢 -0.26%)
/settings/teams/[id]/profile 440.67 KB 595.44 KB 170.13% (🟡 +0.19%)
/settings/teams/[id]/sso 258.59 KB 413.37 KB 118.11% (🟡 +0.19%)
/settings/teams/new 186.56 KB 341.34 KB 97.53% (🟢 -0.21%)
/team/[slug]/[type] 228.7 KB 383.48 KB 109.57% (🟢 -1.42%)
/team/[slug]/[type]/embed 228.73 KB 383.51 KB 109.57% (🟢 -1.42%)
/teams 243.52 KB 398.29 KB 113.80% (🟡 +0.21%)
/workflows 277.04 KB 431.81 KB 123.38% (🟡 +0.20%)
/workflows/[workflow] 390.45 KB 545.23 KB 155.78% (🟡 +0.20%)
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 "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Aug 23, 2023

Current Playwright Test Results Summary

✅ 120 Passing - ⚠️ 1 Flaky

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

(Last updated on 08/24/2023 07:54:03am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: fcf3e9e

Started: 08/24/2023 07:51:05am UTC

⚠️ Flakes

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 1Initial Attempt
2.49% (6) 6 / 241 runs
failed over last 7 days
97.10% (234) 234 / 241 runs
flaked over last 7 days

View Detailed Build Results


@hariombalhara hariombalhara force-pushed the perf/booking-bundle-only-booker-apps branch from 8add9bb to fcf3e9e Compare August 24, 2023 07:43
@hariombalhara hariombalhara marked this pull request as ready for review August 24, 2023 07:46
@hariombalhara hariombalhara requested a review from a team August 24, 2023 07:46
app = JSON.parse(fs.readFileSync(configPath).toString());
} else if (fs.existsSync(metadataPath)) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
app = require(metadataPath).metadata;
Copy link
Copy Markdown
Member Author

@hariombalhara hariombalhara Aug 24, 2023

Choose a reason for hiding this comment

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

Earlier we weren't reading old _metadata files for app details. It wasn't needed but it is needed now(Zoom is such an app and we need to have appData.location set on it) and it makes more sense to do it.

@zomars zomars merged commit e8370ef into main Aug 24, 2023
@zomars zomars deleted the perf/booking-bundle-only-booker-apps branch August 24, 2023 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAL-1134] Booking Pages Performance Improvement - Only the apps used by BookingPage should be in the payload

2 participants