Skip to content

Conversation

@keithwillcode
Copy link
Contributor

What does this PR do?

This PR configures API v2 (NestJS) to use SWC (Speedy Web Compiler) instead of the default TypeScript compiler for faster build times. SWC is a Rust-based compiler that is ~20x faster than tsc and is officially supported by NestJS.

Changes:

  • Added @swc/cli and @swc/core as dev dependencies
  • Created .swcrc configuration with decoratorMetadata: true (required for NestJS dependency injection)
  • Updated nest-cli.json to use "builder": "swc" with "typeCheck": true to ensure the swagger plugin continues to work

This is Phase 1 of a potential migration away from the current Vite-based bundling setup for platform libraries.

Link to Devin run: https://app.devin.ai/sessions/33c4374e933d4f1c840016c6d1102a24
Requested by: keith@cal.com (@keithwillcode)

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 documentation 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?

  1. Run cd apps/api/v2 && yarn nest build to verify SWC compilation works
  2. Start the API v2 server and verify it boots without errors
  3. Test a few API endpoints to ensure decorator-based dependency injection works correctly
  4. Verify swagger documentation is still generated correctly at /api/v2/docs

Note: There are pre-existing type errors in @calcom/trpc package that cause the build to fail with typeCheck: true. These errors exist on the main branch as well and are unrelated to this PR. CI may need these fixed first, or typeCheck could be temporarily set to false.

Human Review Checklist

  • Verify .swcrc configuration is correct for NestJS (especially decoratorMetadata: true)
  • Test that API v2 starts and runs correctly with SWC-compiled code
  • Verify swagger plugin still generates API documentation
  • Confirm no runtime issues with dependency injection

Checklist

  • I have read the contributing guide
  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link

vercel bot commented Dec 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Review Updated (UTC)
cal Ignored Ignored Dec 24, 2025 2:26pm
cal-companion Ignored Ignored Preview Dec 24, 2025 2:26pm
cal-eu Ignored Ignored Dec 24, 2025 2:26pm

@github-actions
Copy link
Contributor

E2E results are ready!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants