refactor: remove unused optional props and arguments in apps/web - #30023
Draft
JonasBa wants to merge 1 commit into
Draft
refactor: remove unused optional props and arguments in apps/web#30023JonasBa wants to merge 1 commit into
JonasBa wants to merge 1 commit into
Conversation
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>
Contributor
|
Welcome to Cal.diy, @JonasBa! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
apps/webis touched. Findings in sharedpackages/*were excluded because they can have consumers outside this project's typecheck graph (platform atoms, API apps, embeds).CalendarListContainer(itsheading/fromOnboardingprops are never passed, which means the component currently rendersnullon both of its call sites) andLimitedBadges(maxVisibleis 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