V5 breaking changes

From remotion-dev/remotion · View interactive version

V5 breaking changes is an AI agent skill from the GitHub repository remotion-dev/remotion. Implement or review a Remotion 5 breaking change while the v4 and v5 release lines still share code. Use when v4 behavior and public types must remain compatible on main, but flipping the central v5 flag should activate a new runtime behavior, default, or TypeScript API.

How to use this skill

Skill file

Remotion 5 Breaking Changes

Use the central compile-time flag in packages/core/src/v5-flag.ts:

export const ENABLE_V5_BREAKING_CHANGES = false as const;

Preserve the compile-time flag

When the v5 release line is cut, changing this one constant to true as const must activate the v5 runtime behavior and public TypeScript API together.

Gate runtime behavior

Branch defaults and behavior on the central flag while preserving the existing v4 path:

const effectiveValue =
	value ??
	(NoReactInternals.ENABLE_V5_BREAKING_CHANGES ? v5Default : v4Default);

An explicit user value should continue to take precedence unless the v5 API intentionally removes that value. Keep runtime validation aligned with the selected public type so JavaScript callers and callers bypassing TypeScript get the v5 behavior too.

Gate public types

For a breaking signature or options change, select the entire incompatible part with a conditional type based on the literal flag:

type VersionedOptions =
	typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true
		? V5Options
		: V4Options;

The v4 branch must expose the compatible API. The v5 branch must expose only the intended v5 API; do not leave removed fields optional or union both versions together.

Use these existing implementations as references:

Document every user-facing break

Add or update the corresponding entry in packages/docs/docs/5-0-migration.mdx. State:

Verify the change

Before finishing, check that:

  1. With the flag left as false as const, v4 runtime behavior and public types remain compatible.
  2. Changing only the central flag to true as const selects both the v5 runtime path and v5 public types.
  3. Runtime validation agrees with the conditional TypeScript API.
  4. The migration guide includes the user-facing change.
  5. Focused builds, existing tests, linting, and formatting pass for every affected package.

Do not commit the flag flipped merely to test v5. Restore it to false as const on the shared v4/main line.

The compatibility branches may be removed after v5 no longer shares its implementation with v4.

Source: Remotion 5.0 masterplan implementation mechanism.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.