Skip to content

fix(drive): defer recording renderer initialization - #50

Merged
kitlangton merged 2 commits into
mainfrom
lazy-recording-fonts
Jul 31, 2026
Merged

fix(drive): defer recording renderer initialization#50
kitlangton merged 2 commits into
mainfrom
lazy-recording-fonts

Conversation

@kitlangton

@kitlangton kitlangton commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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 finalizeRecording actually exports a completed recording. Non-recording scripts do not load the renderer.

How

  • src/recording/finalize.ts dynamically imports the exporter after validating the completed timeline.
  • test/fixtures/source-script.ts and the CLI integration suite cover source-checkout script startup.
  • A patch changeset records the startup fix.

Scope

This does not change recording output, frame rendering, font selection, manual scripts, or the script API.

Testing

  • bun run check
  • bun run test: 204 Effect tests and 58 CLI integration tests passed

Flow

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
Loading

@kitlangton
kitlangton merged commit a24a09d into main Jul 31, 2026
1 check passed
@kitlangton
kitlangton deleted the lazy-recording-fonts branch July 31, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant