Skip to content

@remotion/studio: Reload config changes in Studio#9024

Merged
JonnyBurger merged 15 commits into
mainfrom
codex/studio-config-reload-watch
Jul 20, 2026
Merged

@remotion/studio: Reload config changes in Studio#9024
JonnyBurger merged 15 commits into
mainfrom
codex/studio-config-reload-watch

Conversation

@JonnyBurger

Copy link
Copy Markdown
Member

Summary

  • Watch the loaded Remotion config file from Studio.
  • Reset config option state before reloading the config file.
  • Trigger a Studio page reload after config reload and add reset coverage.

Stack

Test plan

  • bunx turbo run make --filter='@remotion/renderer' --filter='@remotion/studio-shared' --filter='@remotion/studio' --filter='@remotion/studio-server' --filter='@remotion/cli'
  • bunx turbo run formatting --filter='@remotion/renderer' --filter='@remotion/studio-shared' --filter='@remotion/studio' --filter='@remotion/studio-server' --filter='@remotion/cli'
  • bunx turbo run lint --filter='@remotion/renderer' --filter='@remotion/studio-shared' --filter='@remotion/studio' --filter='@remotion/studio-server' --filter='@remotion/cli'
  • bun test packages/cli/src/test/config-reset.test.ts

Closes #9011

Public dir hot-reload remains tracked separately in #9015.

@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Jul 20, 2026 10:34am
remotion Ready Ready Preview, Comment Jul 20, 2026 10:34am

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test body

Pullfrog  | Fix it ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review body test

Pullfrog  | Fix it ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@pullfrog

pullfrog Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Important

Two issues to address before merging: the reset defaults are duplicated from each option module and will drift, and a failed config reload currently resets live state before failing.

Reviewed changes — Adds a file watcher for the loaded Remotion config file, resets all mutable config options to defaults before re-evaluating the config, and triggers a Studio page reload via a new config-file-changed event.

  • Reset helpers for CLI-only option stores plus a reset() method on the four override options.
  • Centralized config reset in ConfigInternals.resetConfigOptions() that restores every BrowserSafeApis.options value to its default before reloading.
  • Watcher wiring in studioCommand that listens to the resolved config path and re-runs loadConfig on change.
  • Studio client reload by adding config-file-changed to the EventSourceEvent union.
  • Test coverage in packages/cli/src/test/config-reset.test.ts.

⚠️ Hardcoded reset defaults will drift

packages/cli/src/config/index.ts:155-230resetBrowserSafeConfigOptions() maintains a second copy of every option default. Future options or default changes can drift, leaving stale config across reloads.

Consider adding a defaultValue or reset() to RemotionOption and using it from each option module, or add a test asserting every BrowserSafeApis.options entry is covered.

⚠️ Reset happens before the reloaded config is known to be valid

packages/cli/src/studio.ts:98-100resetConfigOptions() runs before await loadConfig(remotionRoot). If loadConfig fails, Studio is left in a half-reset state. Also, loadConfigFile calls process.exit(1) for esbuild / missing-tsconfig / missing-output errors, so a typo in remotion.config.ts can terminate the long-running Studio process.

Consider snapshotting option state before resetting and restoring on failure, or validating/bundling the config first and only resetting once it is known to be evaluable.

Pullfrog  | View workflow run | via Pullfrog | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

…eload-watch

# Conflicts:
#	packages/browser-studio/src/BrowserStudio.tsx
#	packages/bundler/src/bundle.ts
#	packages/cli/src/studio.ts
#	packages/studio-server/src/test/file-source-route.test.ts
#	packages/studio-shared/src/studio-runtime-config.ts
#	packages/studio/src/components/GlobalKeybindings.tsx
#	packages/studio/src/helpers/show-browser-rendering.ts
#	packages/studio/src/helpers/studio-runtime-config.ts
#	packages/studio/src/helpers/use-menu-structure.tsx
@JonnyBurger
JonnyBurger merged commit 30537af into main Jul 20, 2026
18 checks passed
@JonnyBurger
JonnyBurger deleted the codex/studio-config-reload-watch branch July 20, 2026 10:34
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.

Config file changes should reload

1 participant