fix(drive): defer recording renderer initialization - #50
Merged
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
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
Avoid initializing the recording renderer when a script does not export a recording.
Before / After
Before: Loading a script directly from the Drive source checkout could bundle another copy of the recording renderer. The renderer registered capture fonts during module evaluation, even when the run did not record, and startup failed against an artifact-relative font path.
After: Recording export and font initialization happen only when
finalizeRecordingactually exports a completed recording. Non-recording scripts do not load the renderer.How
src/recording/finalize.tsdynamically imports the exporter after validating the completed timeline.test/fixtures/source-script.tsand the CLI integration suite cover source-checkout script startup.Scope
This does not change recording output, frame rendering, font selection, manual scripts, or the script API.
Testing
bun run checkbun run test: 204 Effect tests and 58 CLI integration tests passedFlow
sequenceDiagram participant Script participant Drive participant Recorder Script->>Drive: load and run alt no recording to export Drive-->>Script: complete without loading renderer else recording completed Drive->>Recorder: finalize timeline Recorder->>Recorder: load exporter and register fonts Recorder-->>Drive: video path end