mcpField
S
studio-perf

studio-perf

github.com/remotion-devDevelopment68.6k343 installsUpdated today
Repository

About studio-perf

A skill with React Studio performance guidance for Remotion, focused on limiting frame subscriptions and keeping stable component boundaries memoized. It helps developers avoid unnecessary renders as the timeline frame changes.

Key features

  1. 01Keep frame subscriptions low in the tree
  2. 02Use imperative frame reads for on-demand logic
  3. 03Isolate frame-reactive leaf components
  4. 04Memoize stable components with React.memo()
  5. 05Keep memoized props referentially stable

Use cases

  1. 01Reducing rerenders during timeline playback
  2. 02Refactoring a parent that passes frame state to children
  3. 03Choosing between frame subscriptions and imperative reads

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/remotion-dev/remotion --skill studio-perf

After installing, type/studio-perfin Claude Code to confirm it loaded.

Bundled filesagents/openai.yaml

Details

From the project README

Studio Performance

Minimize frame subscriptions

Keep dependencies on the current frame as low in the component tree as possible. Prefer imperative timeline state reads such as getCurrentFrame() over Internals.Timeline.useTimelinePosition() for event handlers and other on-demand logic.

Use useTimelinePosition() only in the smallest leaf component whose rendered output must change with the frame. If a parent reads the frame only to pass it to a child, extract a frame-subscribing child so the parent and its other descendants stay stable.

Memoize stable boundaries

Wrap components in React.memo() when they can safely skip parent-driven renders. Confirm that their props remain referentially stable across frame updates: newly created objects, callbacks, styles, or React nodes defeat shallow memoization. Stabilize those props only where it is natural; avoid custom comparators that ignore behaviorally relevant changes.

Context subscribers continue to update through memoized ancestors. Prefer a memoized stable parent with a small frame-subscribing leaf over making the whole subtree reactive to the current frame.

Comments

Markdown supported