perf: optimize payment app imports to avoid loading entire app store #2
  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.
  
    
  
    
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
This PR changes how payment services are imported at runtime - please verify all payment flows work correctly
The
chargeCardmethod signature was updated to includebooking.id- confirm this matches all PaymentService implementationsTest that the generated
PaymentServiceMapcontains all expected payment services after runningyarn app-store:buildBased on: perf: optimize payment app imports to avoid loading entire app store calcom/cal.com#23408
Summary by cubic
Optimizes payment app imports by generating a PaymentServiceMap and lazy‑loading only payment providers instead of the full app store. This reduces bundle size and speeds up payment flows with no public API changes.
Performance
Refactors