Skip to content

refactor: Enabling typescript 5.3.3 in @calcom/trpc#19394

Merged
emrysal merged 4 commits intomainfrom
refactor/trpc-package-typescript-5.3.3-support
Feb 21, 2025
Merged

refactor: Enabling typescript 5.3.3 in @calcom/trpc#19394
emrysal merged 4 commits intomainfrom
refactor/trpc-package-typescript-5.3.3-support

Conversation

@emrysal
Copy link
Copy Markdown
Contributor

@emrysal emrysal commented Feb 20, 2025

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cal-com-ui-playground ❌ Failed (Inspect) Feb 20, 2025 1:34pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Feb 20, 2025 1:34pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 20, 2025 1:34pm

@github-actions
Copy link
Copy Markdown
Contributor

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 "Refactors related to enabling typescript 5.3.3 in @calcom/trpc". 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

@keithwillcode keithwillcode added core area: core, team members only foundation labels Feb 20, 2025
@emrysal emrysal changed the title Refactors related to enabling typescript 5.3.3 in @calcom/trpc refactor: Enabling typescript 5.3.3 in @calcom/trpc Feb 20, 2025
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Feb 20, 2025

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

View full report↗︎

Comment thread apps/web/package.json
"dompurify": "^3.1.7",
"dotenv-cli": "^6.0.0",
"entities": "^4.4.0",
"eslint-config-next": "^13.2.1",
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.

Dependency conflict, having eslint-config-next here causes a version mismatch with calcom/config

"@calcom/eslint/deprecated-imports-next-router": "off",
},
},
{
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.

@hbjORbj undid this

@@ -1,6 +1,6 @@
import { z } from "zod";
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.

@eunjae-lee heavy refactor of this file to improve TS performance

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. I love that you put satisfies so that we won't accidentally break it in the future. If z.infer causes bad performance, maybe we could have an eslint warning rule?

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.

That would warn our entire codebase, z.infer is heavy on TS but it was uniquely heavy here because it was inferring deeply (z.infer<z.infer<z.infer<..)

@@ -1,80 +0,0 @@
import type {
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.

Long since deprecated but now removed in favour of Suspense

},
"devDependencies": {
"typescript": "^4.9.4"
"typescript": "^5.3.3"
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.

⬆️

getScenarioData,
} from "@calcom/web/test/utils/bookingScenario/bookingScenario";
import { getZoomAppCredential } from "@calcom/web/test/utils/bookingScenario/bookingScenario";
import { expectSuccesfulLocationChangeEmails } from "@calcom/web/test/utils/bookingScenario/expects";
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.

This caused a huge amount of issues and in fact makes this entire test invalid, needless to say trpc should not depend on calcom/web

@emrysal emrysal marked this pull request as ready for review February 20, 2025 00:16
@emrysal emrysal requested a review from a team as a code owner February 20, 2025 00:16
@emrysal emrysal requested a review from a team February 20, 2025 00:16
zomars
zomars previously approved these changes Feb 20, 2025
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { QueryCell } from "@calcom/trpc/components/QueryCell";
import { trpc } from "@calcom/trpc/react";
import { Button } from "@calcom/ui/components/button";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to understand the purpose, is this import instead of "@calcom/ui" because of TS perf issue? or is there any other reason?

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.

This is not strictly necessary, but it does improve performance, when you include a file like "@calcom/ui" ts evaluates all files referenced within that file, rather than just in Button. so if you're more specific, performance improves.

eunjae-lee
eunjae-lee previously approved these changes Feb 20, 2025
Copy link
Copy Markdown
Contributor

@eunjae-lee eunjae-lee left a comment

Choose a reason for hiding this comment

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

Thanks for the hard work!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 20, 2025

E2E results are ready!

@emrysal emrysal merged commit 07accf7 into main Feb 21, 2025
@emrysal emrysal deleted the refactor/trpc-package-typescript-5.3.3-support branch February 21, 2025 13:22
MuhammadAimanSulaiman pushed a commit to hit-pay/cal.com that referenced this pull request Feb 25, 2025
* Refactors related to enabling typescript 5.3.3 in @calcom/trpc

* Also skip respective tests (obviously logic is broken)

* This causes problems for some reason, revert

* Bring back QueryCell as it's used by atoms
itsalam pushed a commit to itsalam/cal.com that referenced this pull request Mar 6, 2025
* Refactors related to enabling typescript 5.3.3 in @calcom/trpc

* Also skip respective tests (obviously logic is broken)

* This causes problems for some reason, revert

* Bring back QueryCell as it's used by atoms
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.

5 participants