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

chore: [app-router-migration 8.6] reorganize future pages file structure #12988

Merged

Conversation

DmytroHryshyn
Copy link
Contributor

@DmytroHryshyn DmytroHryshyn commented Jan 2, 2024

What does this PR do?

  • removes Route Groups. This is workaround for the issue where unnecessary chunks are included to the page. See document1
    document2

  • adds WithLayout HOC. Replace a lot of copy-paste code in layout files with a single HOC that accepts getLayout, getData and LegacyPage.

Requirement/Documentation

document1
document2

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)
  • Tests (Unit/Integration/E2E or any other test)
  • This change requires a documentation update

How should this be tested?

  • Navigate to the page that previously included extra layout chunk (for instance future/video/no-meeting-found). Verify that only 1 layout chunk is included. Verify that SettingsLayout is not present in the bundle.

Mandatory Tasks

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

Copy link

vercel bot commented Jan 2, 2024

@DmytroHryshyn is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

github-actions bot commented Jan 2, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

Copy link
Contributor

github-actions bot commented Jan 2, 2024

📦 Next.js Bundle Analysis for @calcom/web

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

One Hundred Ten 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 94.55 KB 258.83 KB 73.95% (🟢 -0.19%)
/500 89.07 KB 253.34 KB 72.38% (🟢 -0.28%)
/[user] 92.9 KB 257.18 KB 73.48% (🟢 -0.28%)
/[user]/[type] 259.02 KB 423.3 KB 120.94% (🟢 -0.26%)
/[user]/[type]/embed 259.05 KB 423.33 KB 120.95% (🟢 -0.26%)
/[user]/embed 92.93 KB 257.21 KB 73.49% (🟢 -0.28%)
/apps 267.52 KB 431.8 KB 123.37% (🟢 -0.72%)
/apps/[slug] 285.64 KB 449.92 KB 128.55% (🟢 -0.37%)
/apps/[slug]/[...pages] 544.65 KB 708.92 KB 202.55% (🟢 -0.71%)
/apps/[slug]/setup 85.18 KB 249.46 KB 71.27% (🟢 -0.28%)
/apps/categories 245.44 KB 409.72 KB 117.06% (🟢 -0.50%)
/apps/categories/[category] 250.1 KB 414.38 KB 118.39% (🟢 -0.37%)
/apps/installed/[category] 269.56 KB 433.84 KB 123.95% (🟢 -0.64%)
/auth/error 98.74 KB 263.02 KB 75.15% (🟢 -0.29%)
/auth/forgot-password 100.94 KB 265.21 KB 75.78% (🟢 -0.29%)
/auth/forgot-password/[id] 105.27 KB 269.55 KB 77.01% (🟢 -0.28%)
/auth/login 118.08 KB 282.35 KB 80.67% (🟢 -0.28%)
/auth/logout 85.94 KB 250.22 KB 71.49% (🟢 -0.28%)
/auth/oauth2/authorize 116.37 KB 280.65 KB 80.18% (🟢 -0.28%)
/auth/saml-idp 83.39 KB 247.67 KB 70.76% (🟢 -0.28%)
/auth/setup 149.25 KB 313.53 KB 89.58% (🟢 -0.33%)
/auth/signin 83.48 KB 247.75 KB 70.79% (🟢 -0.29%)
/auth/sso/[provider] 83.51 KB 247.79 KB 70.80% (🟢 -0.29%)
/auth/sso/direct 83.44 KB 247.72 KB 70.78% (🟢 -0.29%)
/auth/verify 142.08 KB 306.36 KB 87.53% (🟢 -0.28%)
/auth/verify-email 88.98 KB 253.25 KB 72.36% (🟢 -0.29%)
/availability 421.26 KB 585.54 KB 167.30% (🟢 -0.88%)
/availability/[schedule] 348.97 KB 513.25 KB 146.64% (🟢 -0.70%)
/availability/troubleshoot 270.75 KB 435.03 KB 124.29% (🟢 -0.40%)
/booking/[uid] 188.79 KB 353.07 KB 100.88% (🟢 -0.18%)
/booking/[uid]/embed 188.86 KB 353.13 KB 100.90% (🟢 -0.18%)
/bookings/[status] 312.95 KB 477.23 KB 136.35% (🟢 -0.71%)
/connect-and-join 85.59 KB 249.86 KB 71.39% (🟢 -0.32%)
/d/[link]/[slug] 258.86 KB 423.14 KB 120.90% (🟢 -0.26%)
/enterprise 245.9 KB 410.18 KB 117.19% (🟢 -0.50%)
/event-types 542.55 KB 706.83 KB 201.95% (🟢 -0.85%)
/event-types/[type] 418.91 KB 583.18 KB 166.62% (🟢 -0.83%)
/getting-started/[[...step]] 401.75 KB 566.03 KB 161.72% (🟢 -0.61%)
/insights 471.5 KB 635.78 KB 181.65% (🟢 -0.52%)
/maintenance 83.62 KB 247.9 KB 70.83% (🟢 -0.29%)
/more 245.08 KB 409.35 KB 116.96% (🟢 -0.50%)
/org/[orgSlug] 227.04 KB 391.32 KB 111.81% (🟢 -0.31%)
/org/[orgSlug]/[user] 233.54 KB 397.81 KB 113.66% (🟢 -0.30%)
/org/[orgSlug]/[user]/[type] 259.26 KB 423.54 KB 121.01% (🟢 -0.26%)
/org/[orgSlug]/[user]/[type]/embed 259.28 KB 423.56 KB 121.02% (🟢 -0.26%)
/org/[orgSlug]/[user]/embed 233.56 KB 397.84 KB 113.67% (🟢 -0.31%)
/org/[orgSlug]/embed 227.06 KB 391.33 KB 111.81% (🟢 -0.31%)
/org/[orgSlug]/instant-meeting/team/[slug]/[type] 258.88 KB 423.15 KB 120.90% (🟢 -0.26%)
/org/[orgSlug]/team/[slug] 227.05 KB 391.33 KB 111.81% (🟢 -0.31%)
/org/[orgSlug]/team/[slug]/[type] 258.91 KB 423.18 KB 120.91% (🟢 -0.26%)
/payment/[uid] 115.58 KB 279.86 KB 79.96% (🟢 -0.28%)
/settings/admin 251.72 KB 415.99 KB 118.86% (🟢 -0.51%)
/settings/admin/apps 264.88 KB 429.15 KB 122.62% (🟢 -0.64%)
/settings/admin/apps/[category] 264.86 KB 429.14 KB 122.61% (🟢 -0.64%)
/settings/admin/flags 255.48 KB 419.75 KB 119.93% (🟢 -0.50%)
/settings/admin/impersonation 251.98 KB 416.26 KB 118.93% (🟢 -0.50%)
/settings/admin/oAuth 263.73 KB 428 KB 122.29% (🟢 -0.51%)
/settings/admin/organizations 253.73 KB 418 KB 119.43% (🟢 -0.50%)
/settings/admin/organizations/[id]/edit 252.24 KB 416.52 KB 119.00% (🟢 -0.50%)
/settings/admin/users 253.94 KB 418.21 KB 119.49% (🟢 -0.50%)
/settings/admin/users/[id]/edit 353.68 KB 517.96 KB 147.99% (🟢 -0.53%)
/settings/admin/users/add 353.41 KB 517.69 KB 147.91% (🟢 -0.52%)
/settings/billing 251.93 KB 416.2 KB 118.92% (🟢 -0.51%)
/settings/developer/api-keys 256.34 KB 420.62 KB 120.18% (🟢 -0.51%)
/settings/developer/webhooks 256.24 KB 420.51 KB 120.15% (🟢 -0.51%)
/settings/developer/webhooks/[id] 257.81 KB 422.08 KB 120.60% (🟢 -0.36%)
/settings/developer/webhooks/new 257.87 KB 422.14 KB 120.61% (🟢 -0.35%)
/settings/my-account/appearance 275.2 KB 439.48 KB 125.57% (🟢 -0.76%)
/settings/my-account/calendars 263.53 KB 427.81 KB 122.23% (🟢 -0.54%)
/settings/my-account/conferencing 263.84 KB 428.12 KB 122.32% (🟢 -0.52%)
/settings/my-account/general 340.04 KB 504.31 KB 144.09% (🟢 -0.73%)
/settings/my-account/profile 388.98 KB 553.26 KB 158.07% (🟢 -0.50%)
/settings/organizations/[id]/about 151.35 KB 315.63 KB 90.18% (🟢 -0.52%)
/settings/organizations/[id]/add-teams 151.39 KB 315.67 KB 90.19% (🟢 -0.52%)
/settings/organizations/[id]/onboard-admins 151.41 KB 315.69 KB 90.20% (🟢 -0.52%)
/settings/organizations/[id]/set-password 151.35 KB 315.63 KB 90.18% (🟢 -0.52%)
/settings/organizations/appearance 275.28 KB 439.56 KB 125.59% (🟢 -0.74%)
/settings/organizations/billing 251.96 KB 416.24 KB 118.93% (🟢 -0.51%)
/settings/organizations/general 332.58 KB 496.86 KB 141.96% (🟢 -0.50%)
/settings/organizations/members 419.01 KB 583.29 KB 166.65% (🟢 -0.54%)
/settings/organizations/new 151.36 KB 315.64 KB 90.18% (🟢 -0.52%)
/settings/organizations/profile 386.02 KB 550.3 KB 157.23% (🟢 -0.50%)
/settings/organizations/teams/other 252.79 KB 417.07 KB 119.16% (🟢 -0.50%)
/settings/organizations/teams/other/[id]/appearance 264.33 KB 428.61 KB 122.46% (🟢 -0.74%)
/settings/organizations/teams/other/[id]/members 258.84 KB 423.12 KB 120.89% (🟢 -0.72%)
/settings/organizations/teams/other/[id]/profile 457.86 KB 622.14 KB 177.75% (🟢 -0.49%)
/settings/security/impersonation 257.01 KB 421.29 KB 120.37% (🟢 -0.73%)
/settings/security/password 265.76 KB 430.04 KB 122.87% (🟢 -0.75%)
/settings/security/sso 262.01 KB 426.29 KB 121.80% (🟢 -0.51%)
/settings/security/two-factor-auth 260.84 KB 425.12 KB 121.46% (🟢 -0.63%)
/settings/teams 251.46 KB 415.74 KB 118.78% (🟢 -0.50%)
/settings/teams/[id]/appearance 264.32 KB 428.6 KB 122.46% (🟢 -0.74%)
/settings/teams/[id]/billing 251.96 KB 416.24 KB 118.93% (🟢 -0.51%)
/settings/teams/[id]/members 377.54 KB 541.81 KB 154.80% (🟢 -0.74%)
/settings/teams/[id]/onboard-members 154.89 KB 319.17 KB 91.19% (🟢 -0.59%)
/settings/teams/[id]/profile 458.68 KB 622.96 KB 177.99% (🟢 -0.50%)
/settings/teams/[id]/sso 262.53 KB 426.8 KB 121.94% (🟢 -0.50%)
/settings/teams/new 188.35 KB 352.63 KB 100.75% (🟢 -0.40%)
/signup 145.15 KB 309.42 KB 88.41% (🟢 -0.37%)
/team/[slug] 227 KB 391.28 KB 111.79% (🟢 -0.30%)
/team/[slug]/[type] 258.88 KB 423.15 KB 120.90% (🟢 -0.26%)
/team/[slug]/[type]/embed 258.91 KB 423.18 KB 120.91% (🟢 -0.26%)
/team/[slug]/embed 227.04 KB 391.32 KB 111.81% (🟢 -0.31%)
/teams 245.35 KB 409.63 KB 117.04% (🟢 -0.50%)
/video/[uid] 232.32 KB 396.6 KB 113.31% (🟢 -0.28%)
/video/meeting-ended/[uid] 92.87 KB 257.15 KB 73.47% (🟢 -0.28%)
/video/meeting-not-started/[uid] 92.52 KB 256.79 KB 73.37% (🟢 -0.28%)
/video/no-meeting-found 84.72 KB 249 KB 71.14% (🟢 -0.28%)
/workflows 283.46 KB 447.74 KB 127.93% (🟢 -0.74%)
/workflows/[workflow] 397.35 KB 561.63 KB 160.47% (🟢 -0.52%)
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.

@DmytroHryshyn DmytroHryshyn changed the title chore/reorganize-future-pages-file-structure chore: reorganize future pages file structure Jan 2, 2024
@DmytroHryshyn DmytroHryshyn marked this pull request as ready for review January 2, 2024 18:17
@DmytroHryshyn DmytroHryshyn changed the title chore: reorganize future pages file structure chore: [app-router-migration 8.6] reorganize future pages file structure Jan 4, 2024
@PeerRich PeerRich added High priority Created by Linear-GitHub Sync ci area: CI, DX, pipeline, github actions labels Jan 4, 2024
@PeerRich PeerRich requested a review from a team January 4, 2024 17:08
Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

@DmytroHryshyn can we make those documents public for historical purposes?

Copy link
Member

@zomars zomars left a comment

Choose a reason for hiding this comment

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

LGTM!

@zomars zomars merged commit ecb693c into calcom:main Jan 4, 2024
17 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci area: CI, DX, pipeline, github actions High priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants