Skip to content

refactor: Remove trpc/server dependency from @calcom/atoms#26717

Merged
hbjORbj merged 23 commits intomainfrom
refactor/move-trpc-dependency-from-atoms-2
Jan 12, 2026
Merged

refactor: Remove trpc/server dependency from @calcom/atoms#26717
hbjORbj merged 23 commits intomainfrom
refactor/move-trpc-dependency-from-atoms-2

Conversation

@hbjORbj
Copy link
Contributor

@hbjORbj hbjORbj commented Jan 11, 2026

What does this PR do?

  • Decouples the atoms package from trpc/server

Impact

Screenshot 2026-01-12 at 4 04 37 AM

Summary of Changes

Type Migrations:

  • Moved Slot type to @calcom/atoms/booker/types (removed from trpc/server)
  • Added GetAvailableSlotsResponse type with SlotInfo to booker/types.ts
  • Created local types in hooks/schedules/types.ts:
    • Schedule (with userId for create/duplicate handlers)
    • CreateScheduleHandlerReturn, DuplicateScheduleHandlerReturn, GetAvailabilityListHandlerReturn
    • CreateScheduleInput

Import Updates:

  • Updated useAtomCreateSchedule, useAtomDuplicateSchedule, useAtomGetAllSchedules to use local types
  • Updated useAvailableSlots.ts to use local GetAvailableSlotsResponse

Config Changes:

  • Updated Biome rule to block ALL @calcom/trpc imports (not just @calcom/trpc/react)
  • Removed trpc paths from atoms tsconfig.json
  • Updated package.json exports

Updates since last revision

  • Fixed TypeScript operator precedence issue in GetAvailabilityListHandlerReturn type: wrapped intersection type in parentheses so [] creates an array of the intersection type rather than an intersection with an array type (addresses Cubic AI review feedback)

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - I have updated the developer docs in /docs 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.

@hbjORbj hbjORbj requested review from a team as code owners January 11, 2026 10:53
@graphite-app graphite-app bot added foundation core area: core, team members only labels Jan 11, 2026
@hbjORbj hbjORbj changed the title refactor: move trpc dependency from atoms 2 refactor: Remove trpc/server dependency from @calcom/atoms Jan 11, 2026
@hbjORbj hbjORbj marked this pull request as draft January 11, 2026 10:54
Copy link
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 10 files

devin-ai-integration bot and others added 4 commits January 11, 2026 11:07
- Create local types for schedule handlers (CreateScheduleHandlerReturn, DuplicateScheduleHandlerReturn, GetAvailabilityListHandlerReturn, CreateScheduleInput)
- Create local GetAvailableSlotsResponse type for slots hook
- Update imports in useAtomCreateSchedule, useAtomDuplicateSchedule, useAtomGetAllSchedules, and useAvailableSlots

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
…om-atoms-2' into refactor/move-trpc-dependency-from-atoms-2
},
"./add-members-switch/AddMembersWithSwitchPlatformWrapper": "./add-members-switch/AddMembersWithSwitchPlatformWrapper.tsx",
"./availability/AvailabilitySettings": "./availability/AvailabilitySettings.tsx",
"./booker": "./booker/index.ts",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

index.ts file doesn't exist in /booker directory

devin-ai-integration bot and others added 4 commits January 11, 2026 11:35
- Schedule type now includes userId for create/duplicate handlers
- Created ScheduleForList type for list handler (uses select without userId)

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
"Either slotUtcStartDate, slotUtcEndDate or eventTypeId should be filled in."
);

export type Slot = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to atoms/booker/types

@hbjORbj hbjORbj requested a review from keithwillcode January 11, 2026 19:18
@hbjORbj hbjORbj marked this pull request as ready for review January 11, 2026 19:18
@hbjORbj hbjORbj enabled auto-merge (squash) January 11, 2026 19:19
@hbjORbj hbjORbj removed the request for review from keithwillcode January 11, 2026 19:19
@hbjORbj hbjORbj marked this pull request as draft January 11, 2026 19:19
auto-merge was automatically disabled January 11, 2026 19:19

Pull request was converted to draft

Copy link
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 11 files

devin-ai-integration bot and others added 2 commits January 12, 2026 07:44
- fromUser: { id, displayName } (matches IFromUser)
- toUser: { id, username, displayName } (matches IToUser)

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>
@github-actions
Copy link
Contributor

E2E results are ready!

@hbjORbj hbjORbj marked this pull request as ready for review January 12, 2026 07:57
@hbjORbj hbjORbj requested a review from keithwillcode January 12, 2026 07:57
@hbjORbj hbjORbj enabled auto-merge (squash) January 12, 2026 07:58
Copy link
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.

1 issue found across 11 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/platform/atoms/hooks/schedules/types.ts">

<violation number="1" location="packages/platform/atoms/hooks/schedules/types.ts:17">
P1: TypeScript operator precedence issue: `[]` binds tighter than `&`, so this creates an intersection of `Omit<Schedule, "userId">` with an array type, not an array of the intersection. Wrap the intersection in parentheses to get the intended array type.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

…dlerReturn type

Wrap intersection type in parentheses so that [] creates an array of the
intersection type rather than an intersection with an array type.

Addresses Cubic AI review feedback.

Co-Authored-By: unknown <>
Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

Lovely!

@hbjORbj hbjORbj merged commit fc0a2b5 into main Jan 12, 2026
46 of 47 checks passed
@hbjORbj hbjORbj deleted the refactor/move-trpc-dependency-from-atoms-2 branch January 12, 2026 10:06
Anshumancanrock pushed a commit to Anshumancanrock/cal.com that referenced this pull request Jan 12, 2026
)

* mv useTeamMembersWithSegment

* remove

* fix ts error

* remove

* remove

* remove

* biome rule

* wip

* refactor: remove remaining @calcom/trpc/server imports from atoms

- Create local types for schedule handlers (CreateScheduleHandlerReturn, DuplicateScheduleHandlerReturn, GetAvailabilityListHandlerReturn, CreateScheduleInput)
- Create local GetAvailableSlotsResponse type for slots hook
- Update imports in useAtomCreateSchedule, useAtomDuplicateSchedule, useAtomGetAllSchedules, and useAvailableSlots

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>

* fix

* fix: add userId to Schedule type and create ScheduleForList type

- Schedule type now includes userId for create/duplicate handlers
- Created ScheduleForList type for list handler (uses select without userId)

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>

* fix

* fix

* fix

* fix

* fix: correct fromUser/toUser types in GetAvailableSlotsResponse

- fromUser: { id, displayName } (matches IFromUser)
- toUser: { id, username, displayName } (matches IToUser)

Co-Authored-By: benny@cal.com <sldisek783@gmail.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@vercel vercel bot temporarily deployed to Preview – cal-companion January 13, 2026 08:36 Inactive
@vercel vercel bot temporarily deployed to Preview – dev January 13, 2026 08:36 Inactive
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