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

chore: App Router Migration - Ensure `isBookingPage` is correctly flagged before being passed to `PageWrapper`

Open hbjORbj opened this issue 1 year ago • 3 comments

What does this PR do?

  • For routes under /[user] route group, isBookingPage is not correctly flagged in App Router. By modifying WithLayout function that is widely used in routes in /future, ensure that isBookingPage is correctly flagged
  • Refactor so that isBookingPage is done in /module, not in /pages (p.s. not every page exists in /module, so this effort should continue as I extract pages from /pages into `/module)
  • Fixes CAL-4169

Mandatory Tasks (DO NOT REMOVE)

  • [x] I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • [ ] I have added a Docs issue here if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • [ ] I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Manually navigate to the relevant pages in both Pages Router and App Router

hbjORbj avatar Aug 26 '24 16:08 hbjORbj

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Aug 29, 2024 5:44pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Aug 29, 2024 5:44pm

vercel[bot] avatar Aug 26 '24 23:08 vercel[bot]

E2E results are ready!

github-actions[bot] avatar Aug 26 '24 23:08 github-actions[bot]

@joeauyeung Hey Joe, thanks for the review. Good point, both /d/[link]/[slug] and /team/[slug] use isBookingPage flag. But for these pages, app router imports directly from /pages module, so there should be no problem. The error should've persisted only for the app router pages that import its client components from /modules while isBookingPage is flagged in /pages.

For /d/[link]/[slug] and /team/[slug] and other pages whose client components still exist in /pages, we can handle this isBookingPage flag issue as we migrate them into /modules (which should happen in separate PRs)

hbjORbj avatar Aug 29 '24 05:08 hbjORbj