Skip to content

@remotion/studio: Request element install targets on demand#9025

Merged
JonnyBurger merged 3 commits into
mainfrom
codex/update-element-install-target-on-change
Jul 11, 2026
Merged

@remotion/studio: Request element install targets on demand#9025
JonnyBurger merged 3 commits into
mainfrom
codex/update-element-install-target-on-change

Conversation

@JonnyBurger

@JonnyBurger JonnyBurger commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Stop polling /api/update-element-install-target from Studio
  • Let /api/element-install-target request the current target from connected Studio clients over EventSource
  • Have Studio clients POST the target only in response to that request
  • Keep target replies request-scoped so concurrent probes do not reuse stale target data

Testing

  • bun test packages/studio-server/src/test/element-install-state.test.ts
  • bun run --cwd packages/studio-shared make
  • bun run --cwd packages/studio-server make
  • bun run --cwd packages/studio make
  • bun run build
  • bun run stylecheck
  • bun run --cwd packages/studio formatting
  • bun run --cwd packages/studio make

Closes #9023

@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 11, 2026 2:29pm
remotion Ready Ready Preview, Comment Jul 11, 2026 2:29pm

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.

✅ No new issues found.

Reviewed changes — the change replaces the fixed 2-second polling of /api/update-element-install-target with a change-only dispatch, and extends the server-side install-target max age from 5 seconds to 5 minutes to match the focused-window TTL.

  • packages/studio/src/components/Canvas.tsx — adds areElementInstallTargetsEqual and a lastSentElementInstallTargetRef so the API request is only issued when the payload actually changes; focus and pointerdown events trigger re-evaluation, and failed requests reset the ref so the next change resends.
  • packages/studio-server/src/preview-server/element-install-state.ts — raises ELEMENT_INSTALL_TARGET_MAX_AGE to 5 * 60 * 1000 so the server-state TTL aligns with the focus-based TTL used in packages/studio-server/src/routes.ts.

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

@JonnyBurger JonnyBurger changed the title @remotion/studio: Update element install target only on change @remotion/studio: Request element install targets on demand Jul 11, 2026
@JonnyBurger
JonnyBurger merged commit 84d8cae into main Jul 11, 2026
18 checks passed
@JonnyBurger
JonnyBurger deleted the codex/update-element-install-target-on-change branch July 11, 2026 14: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.

Console is being spammed with calls to /api/update-element-install-target

1 participant