forked from calcom/cal.com
-
Notifications
You must be signed in to change notification settings - Fork 0
[Eval f0lhdb08jy] perf: optimize payment app imports to avoid loading entire app store #1
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
Open
cubic-dev-local
wants to merge
9
commits into
f0lhdb08jy-target
Choose a base branch
from
f0lhdb08jy-violation
base: f0lhdb08jy-target
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add PaymentServiceMap generation to app-store-cli build process - Generate payment.services.generated.ts with lazy imports for 6 payment services - Update handlePayment.ts, deletePayment.ts, handlePaymentRefund.ts to use PaymentServiceMap - Update getConnectedApps.ts and tRPC payment routers to use PaymentServiceMap - Follow same pattern as analytics optimization in PR calcom#23372 - Reduces bundle size by avoiding import of 100+ apps when only payment functionality needed Co-Authored-By: [email protected] <[email protected]>
- Remove obsolete appStoreMock line from bookingScenario.ts since handlePayment now uses PaymentServiceMap - Update setupVitest.ts to import prismaMock from correct PrismockClient instance - Add PaymentServiceMap mock following PR calcom#22450 pattern for calendar services - Ensure MockPaymentService uses consistent externalId across test files - Fix webhook handler to return 200 status by ensuring payment records are found correctly Co-Authored-By: [email protected] <[email protected]>
…vi.spyOn() calls - Remove global prismaMock import from setupVitest.ts that was causing 'is not a spy' errors - Update MockPaymentService to import prismaMock locally to maintain payment test functionality - Fixes organization and outOfOffice tests while preserving payment service optimization Co-Authored-By: [email protected] <[email protected]>
- Payment services map now always includes all payment apps regardless of E2E environment - Ensures payment functionality is consistently available across all environments - Addresses CI failures caused by conditional payment service loading Co-Authored-By: [email protected] <[email protected]>
- Update app-store-cli to import directly from lib/PaymentService.ts files - Modify all payment handlers to access PaymentService directly - Update test mocks to match new direct import structure - Remove .lib property access pattern across payment system - Maintain backward compatibility while improving import efficiency Co-Authored-By: [email protected] <[email protected]>
- Remove booking.id parameter from chargeCard calls in chargeCard.handler.ts and payments.tsx - Addresses GitHub feedback to investigate chargeCard signature changes in separate PR - Keeps all other direct PaymentService import refactor changes intact Co-Authored-By: [email protected] <[email protected]>
|
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: |
|
This PR is being marked as stale due to inactivity. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Evaluation Test Case - Full PR Replication
This PR is a complete replication of PR calcom#23408 from calcom/cal.com for AI code review evaluation.
Test Details:
Original PR Description:
What does this PR do?
This PR optimizes payment app imports by creating a dedicated
PaymentServiceMapthat only loads payment apps with PaymentService implementations, avoiding the need to load the entire app store when only payment functionality is needed. This follows the same optimization pattern established in PR calcom#23372 for analytics services.Key changes:
PaymentServiceMapgeneration to the app-store-cli build processpayment.services.generated.tswith lazy imports for 6 payment services (alby, btcpayserver, hitpay, mock-payment-app, paypal, stripepayment)PaymentServiceMapinstead of importing the fullappStorePerformance benefits:
How should this be tested?
Critical testing areas:
PaymentServiceMaplogicyarn app-store:buildgeneratespayment.services.generated.tscorrectlyTest configuration:
Expected behavior:
Checklist
Link to Devin run: https://app.devin.ai/sessions/6ff5d1bb0e98478180209c3a930013c2
Requested by: @keithwillcode
chargeCardmethod signature was updated to includebooking.id- confirm this matches all PaymentService implementationsPaymentServiceMapcontains all expected payment services after runningyarn app-store:buildThis PR is automatically generated to test if our AI review system can consistently detect issues across the entire changeset.
Summary by cubic
Optimizes payment imports by generating a lazy‑loaded PaymentServiceMap and updating payment flows to use it instead of loading the entire app store. Reduces bundle size and loads only the needed payment providers.