Skip to content

refactor: eliminate all @calcom/trpc/react imports and tRPC hooks from @calcom/features#27728

Merged
hbjORbj merged 58 commits intomainfrom
refactor/migrate-trpc-stuff-from-features-to-web-2
Feb 9, 2026
Merged

refactor: eliminate all @calcom/trpc/react imports and tRPC hooks from @calcom/features#27728
hbjORbj merged 58 commits intomainfrom
refactor/migrate-trpc-stuff-from-features-to-web-2

Conversation

@hbjORbj
Copy link
Copy Markdown
Contributor

@hbjORbj hbjORbj commented Feb 7, 2026

What does this PR do?

Removes every @calcom/trpc/react import and every tRPC hook call from packages/features/, fully decoupling the shared features package from tRPC client-side code. @calcom/trpc/server imports are the only remaining trpc imports in /features package now.

Impact

@calcom/trpc imports removed from packages/features/ — 7 total, 0 remaining

Removed import File Action
import { trpc } from "@calcom/trpc/react" apps/hooks/useApp.ts deleted
import { trpc } from "@calcom/trpc/react" bookings/Booker/utils/event.ts moved to apps/web/
import { trpc } from "@calcom/trpc/react" components/phone-input/PhoneInput.tsx moved to apps/web/
import type { RouterOutputs } from "@calcom/trpc/react" bookings/types.ts replaced with direct type
import type { RouterOutputs, RouterInputs } from "@calcom/trpc/react" eventtypes/lib/types.ts types moved from trpc pkg
import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery" pbac/client/context/PermissionProvider.tsx deleted (dead code)
import type { TIsAvailableOutputSchema } from "@calcom/trpc/server/..." bookings/Booker/types.ts removed

tRPC hook calls eliminated from @calcom/features — 4 removed, 0 remaining

Hook call What happened
trpc.viewer.apps.appById.useQuery useApp hook deleted; OmniInstallAppButton refactored to accept app data as prop
trpc.viewer.public.event.useQuery useEvent hook moved to apps/web/modules/bookings/hooks/
trpc.viewer.public.countryCode.useQuery PhoneInput moved to apps/web/components/phone-input/
useMeQuery dead PermissionProvider deleted

Files moved from packages/features/apps/web/

From To
features/bookings/Booker/utils/event.ts apps/web/modules/bookings/hooks/useEvent.ts
features/components/phone-input/PhoneInput.tsx apps/web/components/phone-input/PhoneInput.tsx
features/components/phone-input/index.ts apps/web/components/phone-input/index.ts
features/eventtypes/components/locations/LocationInput.tsx apps/web/modules/event-types/components/LocationInput.tsx

Dead code removed

  • packages/features/apps/hooks/useApp.ts — deleted; consumers refactored to pass app data as props
  • packages/features/pbac/client/context/PermissionProvider.tsx — deleted (unused)
  • 4 stale type imports removed from bookings/Booker/types.ts

Types relocated (~242 lines)

packages/trpc/server/routers/viewer/eventTypes/types.tspackages/features/eventtypes/lib/types.ts

Event-type form types now live next to the feature they belong to, not inside the tRPC router.

Result

packages/features/ has zero @calcom/trpc/react imports — no tRPC client or hook usage remains in the shared features package.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A — no docs changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Build verification only — no functional changes. Confirm the booker, embed, and booking form views render correctly.


Link to Devin run: https://app.devin.ai/sessions/d2e8db2ab39840bfadb633ed8be49800
Requested by: @hbjORbj

@paragon-review
Copy link
Copy Markdown

paragon-review bot commented Feb 7, 2026

Paragon Review Unavailable

Hi @hbjORbj! You are not toggled active by your team. Reach out to your admin.

@graphite-app graphite-app bot added foundation core area: core, team members only labels Feb 7, 2026
@graphite-app graphite-app bot requested a review from a team February 7, 2026 09:00
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Refactor/migrate trpc stuff from features to web 2". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@hbjORbj hbjORbj marked this pull request as draft February 7, 2026 09:00
@devin-ai-integration devin-ai-integration bot changed the title Refactor/migrate trpc stuff from features to web 2 refactor: remove 2 @calcom/trpc imports from packages/features (useEvent) Feb 7, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 8 files

@calcom-bot calcom-bot changed the title refactor: remove 2 @calcom/trpc imports from packages/features (useEvent) refactor: eliminate all @calcom/trpc/react imports and tRPC hooks from @calcom/features Feb 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 7, 2026

E2E results are ready!

Comment on lines -24 to -52
// ============================================================================
// EXPLICIT TYPE DEFINITIONS
// ============================================================================
// These explicit types prevent TypeScript from having to infer complex types
// through chains of .extend(), .partial(), .merge() etc. This significantly
// reduces type-checking time by giving TypeScript the answer directly.
// ============================================================================

type HashedLinkInput = {
link: string;
expiresAt?: Date | null;
maxUsageCount?: number | null;
usageCount?: number | null;
};

type AiPhoneCallConfig = {
generalPrompt: string;
enabled: boolean;
beginMessage: string | null;
yourPhoneNumber: string;
numberToCall: string;
guestName?: string | null;
guestEmail?: string | null;
guestCompany?: string | null;
templateType: TemplateType;
};

type CalVideoSettings = {
disableRecordingForGuests?: boolean | null;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

all these types are moved to packages/features/eventtypes/lib/types.ts

) : (
<OmniInstallAppButton
className="ml-auto flex items-center"
appId={app.slug}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no longer needed as we are using app prop as it is

* This avoids redundant API calls and prevents the app-store package from depending on the features package.
*/
export default function OmniInstallAppButton({
appId,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no longer needed as we are using app prop as it is

Comment on lines -1 to -5
import type { useScheduleForEventReturnType } from "@calcom/features/bookings/Booker/utils/event";
import type { BookerEventQuery } from "@calcom/features/bookings/types";
import type { IntlSupportedTimeZones } from "@calcom/lib/timeZones";
import type { EventBusyDate } from "@calcom/types/Calendar";
import type { TIsAvailableOutputSchema } from "@calcom/trpc/server/routers/viewer/slots/isAvailable.schema";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

unused imports

@@ -1,20 +0,0 @@
export function PermissionProvider({ children }: { children: React.ReactNode }) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

dead code

Comment on lines -1 to -4
// TODO: FormBuilder makes more sense in @calcom/ui but it has an additional thing that other components don't have
// It has zod schema associated with it and I currently can't import zod in there.
// Move it later there maybe? @sean
export { FormBuilderField } from "./FormBuilderField";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removing barrel file. FormBuilderField is moved to /apps/web

import { defaultDayRange as DEFAULT_DAY_RANGE } from "@calcom/lib/availability";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { weekdayNames } from "@calcom/lib/weekday";
import useMeQuery from "@calcom/trpc/react/hooks/useMeQuery";
Copy link
Copy Markdown
Contributor Author

@hbjORbj hbjORbj Feb 7, 2026

Choose a reason for hiding this comment

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

unused import

@hbjORbj hbjORbj marked this pull request as ready for review February 7, 2026 17:13
@hbjORbj hbjORbj requested a review from keithwillcode February 7, 2026 17:15
@hbjORbj hbjORbj enabled auto-merge (squash) February 7, 2026 17:15
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 33 files

@keithwillcode keithwillcode added this to the v6.2 milestone Feb 9, 2026
@hbjORbj hbjORbj merged commit eba0635 into main Feb 9, 2026
87 of 90 checks passed
@hbjORbj hbjORbj deleted the refactor/migrate-trpc-stuff-from-features-to-web-2 branch February 9, 2026 11:39
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 ready-for-e2e size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants