Skip to content

@remotion/studio-server: Migrate Studio API routes#7884

Merged
JonnyBurger merged 1 commit into
mainfrom
jonnyburger/route-migration-candidates
May 31, 2026
Merged

@remotion/studio-server: Migrate Studio API routes#7884
JonnyBurger merged 1 commit into
mainfrom
jonnyburger/route-migration-candidates

Conversation

@JonnyBurger
Copy link
Copy Markdown
Member

Summary

  • Move composition component info, open-in-editor, register-client-render, and unregister-client-render into the central Studio API route registry.
  • Add shared request/response types and update Studio clients to use callApi().
  • Keep same-origin validation for client render registration routes.

Verification

  • bun run build
  • bun run formatting

Closes #7876

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 31, 2026

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

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment May 31, 2026 5:37pm
remotion Ready Ready Preview, Comment May 31, 2026 5:37pm

Request Review

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

ℹ️ Route migration looks solid — one scope question below.

Reviewed changes — Migrated four ad-hoc Studio server routes (/api/composition-component-info, /api/open-in-editor, /api/register-client-render, /api/unregister-client-render) into the central allApiRoutes registry, switched clients from raw fetch to callApi(), and extracted shared request/response types into @remotion/studio-shared.

  • Add new route handlerscomposition-component-info.ts, open-in-editor.ts, register-client-render.ts, unregister-client-render.ts all correctly implement ApiHandler and preserve same-origin validation for render registration.
  • Register routes in allApiRoutes — New entries wired into the central registry; old manual handleRoutes branches removed cleanly.
  • Add shared types to studio-sharedOpenInEditorRequest, OpenInEditorResponse, CompositionComponentInfoRequest, CompositionComponentInfoResponse exported from the shared package.
  • Update client callerssave-render-output.ts, open-in-editor.ts, MenuBuildIndicator.tsx, use-menu-structure.tsx, and OpenInEditor.tsx all switched to callApi(), removing redundant .then(res => res.json()) chains.
  • Remove UV overlay code — ~500 lines of UV handle rendering, drag interaction, projective transform math, and associated tests deleted from SelectedOutlineOverlay.tsx.

ℹ️ UV handle code removal seems unrelated to route migration

This PR deletes all UV coordinate overlay handles, projective-transform math, bilinear interpolation, drag interaction, and the associated unit tests from SelectedOutlineOverlay.tsx. That code was just introduced in the parent commit (a4f2d3a, #7875). Since the PR description and title focus exclusively on API route migration, it's unclear whether this removal is intentional. If it is, a brief note in the description would help reviewers understand the scope.

Technical details
# UV handle code removal seems unrelated to route migration

## Affected sites
- `packages/studio/src/components/SelectedOutlineOverlay.tsx`~500 lines removed (UV handle types, `parseUvCoordinate`, `getUvHandlePosition`, `getUvCoordinateForPoint`, `SelectedUvHandleCircle`, drag handlers, projective/bilinear math)
- `packages/studio/src/test/timeline-selection.test.ts` — 4 test cases removed (`UV handles project semantic outline corners`, `UV handles use projective projection for perspective quads`, `UV handle pointer position maps back to UV coordinates`, `UV handles are requested for selected effect children`)

## Required outcome
- Clarify whether the UV overlay handle removal is intentional and permanent, or a temporary revert.
- If intentional, update the PR description to mention the removal.
- If unintentional, restore the deleted code before merging.

## Open questions for the human
- Was the UV overlay handle feature (#7875) meant to be reverted?
- If only the overlay handles are being removed, should `TimelineUvCoordinateField.tsx` also be removed or updated?

Pullfrog  | Fix it ➔View workflow run | Using Kimi K2𝕏

@JonnyBurger JonnyBurger merged commit 0ce1b93 into main May 31, 2026
19 checks passed
@JonnyBurger JonnyBurger deleted the jonnyburger/route-migration-candidates branch May 31, 2026 18:12
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.

Move all API routes to the same system

1 participant