perf: optimize video adapter imports to avoid loading entire app store#23435
Merged
keithwillcode merged 7 commits intomainfrom Aug 29, 2025
Merged
perf: optimize video adapter imports to avoid loading entire app store#23435keithwillcode merged 7 commits intomainfrom
keithwillcode merged 7 commits intomainfrom
Conversation
- Creates VideoApiAdapterMap with lazy imports for 12 video services - Updates getVideoAdapters function to use VideoApiAdapterMap instead of dynamic app store imports - Preserves zoom app name parsing logic (zoom_video → zoomvideo) - Follows same optimization pattern as calendar, analytics, and payment services - Reduces bundle size by avoiding import of 100+ apps when only video functionality needed Affected files: - packages/app-store-cli/src/build.ts: Added video service generation logic - packages/lib/videoClient.ts: Updated to use VideoApiAdapterMap - packages/features/bookings/lib/handleCancelBooking.ts: Updated FAKE_DAILY_CREDENTIAL import - packages/lib/EventManager.ts: Updated FAKE_DAILY_CREDENTIAL import - packages/trpc/server/routers/viewer/calVideo/getMeetingInformation.handler.ts: Updated to use VideoApiAdapterMap - apps/web/lib/video/[uid]/getServerSideProps.ts: Updated daily video function imports - packages/app-store/video.services.generated.ts: Generated video adapter map with re-exports Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Updates build.ts to include FAKE_DAILY_CREDENTIAL and other daily video function re-exports - Fixes type errors in EventManager.ts and other files importing from video.services.generated - Ensures video adapter refactoring maintains all existing functionality Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
- Creates global mockVideoAdapterRegistry for dynamic video adapter mocks - Uses Proxy in vi.mock for VideoApiAdapterMap to return registered mocks - Updates mockVideoApp and mockErrorOnVideoMeetingCreation to register mocks - Fixes unit test failures in booking scenario tests - Ensures video meeting operations (createMeeting, updateMeeting, deleteMeeting) work correctly Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
keithwillcode
commented
Aug 29, 2025
Contributor
E2E results are ready! |
…ports - Remove re-export block from video.services.generated.ts as requested - Revert imports back to pull directly from dailyvideo/lib/VideoApiAdapter - Update build.ts to not generate the re-exports - Maintains all existing functionality while addressing GitHub feedback Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
keithwillcode
commented
Aug 29, 2025
keithwillcode
commented
Aug 29, 2025
- Updates build.ts to generate video.adapters.generated.ts instead of video.services.generated.ts - Updates all import statements to use new filename - Removes unnecessary mock exports from bookingScenario.ts (FAKE_DAILY_CREDENTIAL, etc.) - Addresses GitHub comments from @keithwillcode on PR #23435 The terminology change from 'services map' to 'adapters map' better reflects the actual content (video adapters, not services) and maintains consistency with the established refactoring pattern. Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
keithwillcode
commented
Aug 29, 2025
keithwillcode
commented
Aug 29, 2025
…tatement - Rename variable from videoServices to videoAdapters for consistency - Remove unnecessary const variable and return directly in same line - Addresses GitHub comments from @keithwillcode on PR #23435 Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
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
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.
What does this PR do?
This PR refactors video adapters to use a dedicated
VideoApiAdapterMapinstead of dynamically importing from the entire app store, following the same pattern established for calendar and payment services in PRs #22450, #23372, and #23408.Key Changes:
packages/app-store/video.adapters.generated.tswith aVideoApiAdapterMapcontaining all video adapterspackages/lib/videoClient.tsto use the new map instead of dynamic app store importspackages/trpc/server/routers/viewer/calVideo/getMeetingInformation.handler.tsto use the mappackages/app-store-cli/src/build.tsto generate the video services mapbookingScenario.tsto work with the new import structureMotivation: This change improves performance by replacing dynamic imports with static imports and provides better type safety and consistency across the codebase.
Link to Devin run: https://app.devin.ai/sessions/179257529a2248ea95efc8258d8d3875
Requested by: @keithwillcode
How should this be tested?
Critical Test Cases:
zoom_videocorrectly transforms tozoomvideoEnvironment Setup:
Test Commands:
Mandatory Tasks (DO NOT REMOVE)
Human Reviewer Checklist
zoom_video→zoomvideotransformation still works correctly ingetVideoAdapters()VideoApiAdapterMapbookingScenario.tsaccurately simulates the new import behaviorStandard Review Items:
NEXT_PUBLIC_IS_E2E)