Skip to content

refactor: remove unused optional props and arguments in apps/web - #30023

Draft
JonasBa wants to merge 1 commit into
calcom:mainfrom
JonasBa:jonas/unused-props-cleanup
Draft

refactor: remove unused optional props and arguments in apps/web#30023
JonasBa wants to merge 1 commit into
calcom:mainfrom
JonasBa:jonas/unused-props-cleanup

Conversation

@JonasBa

@JonasBa JonasBa commented Aug 21, 2026

Copy link
Copy Markdown

Hey folks, I'm working on an experimental CLI which uses the tsgo toolchain to find optional component and function signatures that are in practice never passed. This is essentially dead code elimination, and a complementary workflow to run alongside a tool like knip.

The changeset in this PR has been done using the script as the reporting tool, and an agent validator loop walking through each reported line one by one to first inspect the report, analyze the call sites, removing them, and later re-running ts. If done correctly, the code that has been removed should have been effectively dead.

The reporting script heavily relies on type quality and only reports on types whos members are statically enumerable.

Scope notes:

  • Only apps/web is touched. Findings in shared packages/* were excluded because they can have consumers outside this project's typecheck graph (platform atoms, API apps, embeds).
  • Two components were deliberately left alone and may deserve maintainer attention instead: CalendarListContainer (its heading/fromOnboarding props are never passed, which means the component currently renders null on both of its call sites) and LimitedBadges (maxVisible is never passed, so the visible/hidden split degenerates).

I'm opening this PR in an effort to help you eliminate dead code, but also to gain feedback on the script and the detection mechanisms. There are always risks of false positive reports, and removal of code that is actually still required at runtime.

Some references of PRs opened to other repositories that have been merged or are still open:
Sentry (4k loc removed)
Sentry (followup 1k loc removed)
Tanstack
npmx
Signal Desktop

Would love to hear your feedback 🙏🏼

Made with Cursor

Generated with an experimental CLI that inspects every call site of a
component or function and flags optional props and arguments that are
never provided. Scoped to apps/web (a leaf consumer); shared packages
were excluded since they have consumers outside this project's
typecheck graph. Defaults are inlined so runtime behavior is unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @JonasBa! Thanks for opening this pull request.

A few things to keep in mind:

  • This is Cal.diy, not Cal.com. Cal.diy is a community-driven, fully open-source fork of Cal.com licensed under MIT. Your changes here will be part of Cal.diy — they will not be deployed to the Cal.com production app.
  • Please review our Contributing Guidelines if you haven't already.
  • Make sure your PR title follows the Conventional Commits format.

A maintainer will review your PR soon. Thanks for contributing!

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Jonas Badalic seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants