Skip to content
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: do not import from @calcom/lib/server barrel file #19579

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hbjORbj
Copy link
Contributor

@hbjORbj hbjORbj commented Feb 26, 2025

What does this PR do?

Context: I loaded a route that had import { getServerErrorFromUnknown } from "@calcom/lib/server". This loaded getLuckyUser (which is exported from "@calcom/lib/server"), which was pulling in Calendar Manager, etc:

../../packages/lib/server/index.ts
../../packages/lib/server/getLuckyUser.ts
../../packages/core/CalendarManager.ts
../../packages/app-store/_utils/getCalendar.ts
../../packages/app-store/index.ts
../../packages/app-store/exchange***endar/index.ts
../../packages/app-store/exchange***endar/lib/index.ts
../../packages/app-store/exchange***endar/lib/CalendarService.ts
../../node_modules/@ewsjs/xhr/dist/index.js
../../node_modules/@ewsjs/ntlm-client/lib/index.js

This poses 2 problems: (1) it prevents us from using Edge config for running routes or apis because these unnecessarily pulled dependencies usually depend on other deps that run on Node only (2) unnecessary load of irrelevant packages

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 February 26, 2025 15:55
@hbjORbj hbjORbj marked this pull request as draft February 26, 2025 15:55
@graphite-app graphite-app bot requested a review from a team February 26, 2025 15:55
@keithwillcode keithwillcode added consumer core area: core, team members only labels Feb 26, 2025
@hbjORbj hbjORbj changed the title perf: do not import from barrel perf: do not import from `@calcom/lib/server" barrel file Feb 26, 2025
@hbjORbj hbjORbj changed the title perf: do not import from `@calcom/lib/server" barrel file perf: do not import from @calcom/lib/server barrel file Feb 26, 2025
@dosubot dosubot bot added the performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive label Feb 26, 2025
Copy link

vercel bot commented Feb 26, 2025

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Feb 26, 2025 3:58pm
calcom-web-canary ⬜️ Ignored (Inspect) Feb 26, 2025 3:58pm

Copy link

graphite-app bot commented Feb 26, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (02/26/25)

1 reviewer was added to this PR based on Keith Williams's automation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consumer core area: core, team members only performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants