-
Notifications
You must be signed in to change notification settings - Fork 11k
perf: rename eventTypes.heavy to eventTypesHeavy #24630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: rename eventTypes.heavy to eventTypesHeavy #24630
Conversation
| eventTypes: mergeRouters( | ||
| eventTypesRouter, | ||
| router({ | ||
| heavy: heavyEventTypesRouter, | ||
| }) | ||
| ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MergeRouter kills our types when looking at a trace - easier to do this instead
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
apps/web/app/_trpc/trpc-client.ts
Outdated
| // - viewer.me - 2 segment paths like this are for logged in requests | ||
| // - viewer.public.i18n - 3 segments paths can be public or authed | ||
| // - viewer.eventTypes.heavy.create - 4 segments paths for heavy sub-router | ||
| // - viewer.eventTypesHeavy.create - 3 segment paths for flattened heavy router |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line. The line above is for 3 segments already
apps/web/app/_trpc/trpc-client.ts
Outdated
| if (parts.length == 2) { | ||
| endpoint = parts[0] as keyof typeof links; | ||
| path = parts[1]; | ||
| } else if (parts.length >= 3 && parts[2] === "heavy") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this if. No longer needed
packages/trpc/react/trpc.ts
Outdated
| // - viewer.me - 2 segment paths like this are for logged in requests | ||
| // - viewer.public.i18n - 3 segments paths can be public or authed | ||
| // - viewer.eventTypes.heavy.create - 4 segments paths for heavy sub-router | ||
| // - viewer.eventTypesHeavy.create - 3 segment paths for flattened heavy router |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line as the 3 segment description above works
There was a problem hiding this 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 10 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/trpc/react/trpc.ts">
<violation number="1" location="packages/trpc/react/trpc.ts:30">
The heavy router guard was removed, but ENDPOINTS still exposes only "eventTypes/heavy", so viewer.eventTypesHeavy.* now resolves to links["eventTypesHeavy"] === undefined and these tRPC calls will fail at runtime.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
There was a problem hiding this 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 10 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="apps/web/app/_trpc/trpc-client.ts">
<violation number="1" location="apps/web/app/_trpc/trpc-client.ts:26">
Heavy router calls now get sent to the generic eventTypes endpoint instead of /eventTypes/heavy, so operations like viewer.eventTypesHeavy.update will fail.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
keithwillcode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sean-brydon Since this is going to now hit /api/trpc/eventTypesHeavy, you need to move that [trpc].ts file in app/web/pages/api/trpc/eventTypes/heavy/[trpc].ts
E2E results are ready! |
There was a problem hiding this 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 22 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E2E is failing, and it looks like we are missing that.
The WorkflowType enum should be imported from @calcom/prisma/enums rather than @calcom/prisma/client. This was causing integration tests to fail with 'Cannot read properties of undefined (reading EVENT_TYPE)' because the enum wasn't being properly exported from the client. This fixes the remaining integration test failures after the Prisma 6.16 upgrade. Co-Authored-By: [email protected] <[email protected]>
anikdhabal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good
There was a problem hiding this 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 23 files
* Rename eventTypes.heavy to eventTypesHeavy * Update eventTypes lib types * Remove trpc and trpc client heavy resolve endpoint * Update shared file * Fix comments * Rename path * Fix wait for URL path * Fix API endpoint in event-types.e2e.ts test * fix: Import WorkflowType from enums instead of client The WorkflowType enum should be imported from @calcom/prisma/enums rather than @calcom/prisma/client. This was causing integration tests to fail with 'Cannot read properties of undefined (reading EVENT_TYPE)' because the enum wasn't being properly exported from the client. This fixes the remaining integration test failures after the Prisma 6.16 upgrade. Co-Authored-By: [email protected] <[email protected]> --------- Co-authored-by: Keith Williams <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]>
remove the mergeRotuer which after running a tsc trace - appears to be generating some nasty types. In favour of using a seperate router for this