v5-breaking-changes

Implement Remotion 5 breaking changes behind a compile-time flag.

57.9k|4.4k|Updated Jun 23, 2020
One-click install
npx skills add https://github.com/remotion-dev/remotion --skill v5-breaking-changes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: v5-breaking-changes
Source: https://github.com/remotion-dev/remotion/tree/main/.agents/skills/v5-breaking-changes
Command: npx skills add https://github.com/remotion-dev/remotion --skill v5-breaking-changes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Maintaining a single codebase that supports both Remotion v4 and v5 release lines requires a mechanism to switch runtime behavior and public TypeScript APIs without forking the repository. This Skill defines the central compile-time flag pattern that gates v5 changes while keeping v4 fully compatible on the shared main branch.

Core Features & Use Cases

  • Central Flag Management: Use the literal ENABLE_V5_BREAKING_CHANGES constant in packages/core/src/v5-flag.ts as the single switch for all v5 transitions.
  • Runtime Gating: Branch defaults and behavior on the flag while preserving explicit user values and v4 fallback paths.
  • Public Type Gating: Select incompatible TypeScript signatures using conditional types tied to the flag's literal type.
  • Migration Documentation: Update packages/docs/docs/5-0-migration.mdx with every user-facing break, including v4 behavior, v5 change, and migration steps.
  • Use Case: When introducing a new required option in the renderer package, gate the option behind the flag, expose a conditional V5Options type, and document the migration so flipping one constant activates both the runtime and type changes.

Quick Start

Review the proposed Remotion 5 breaking change, gate its runtime behavior and public TypeScript API behind the central ENABLE_V5_BREAKING_CHANGES flag, and add a migration entry to the v5 migration guide.

Frequently Asked Questions about v5-breaking-changes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement a Remotion 5 breaking change on the v4 main branch?

Gate the change behind the literal `ENABLE_V5_BREAKING_CHANGES` constant in `packages/core/src/v5-flag.ts`. Branch runtime defaults and use conditional TypeScript types so flipping the flag activates both the new behavior and the new public API together.

What is the central v5 flag in Remotion?

It is the `ENABLE_V5_BREAKING_CHANGES` constant exported from `packages/core/src/v5-flag.ts` as `false as const`. Other packages access it via `NoReactInternals.ENABLE_V5_BREAKING_CHANGES` from `remotion/no-react`.

Can I use an environment variable instead of the v5 flag?

No. The flag must remain a literal `false as const` so its literal type selects the public TypeScript API. Converting it to a runtime boolean or environment variable breaks the conditional type selection.

Why does my v5 conditional type not activate when the flag is true?

Conditional types like `typeof NoReactInternals.ENABLE_V5_BREAKING_CHANGES extends true ? V5Options : V4Options` only narrow correctly when the flag is a literal boolean. Ensure the import path resolves to the same constant and the flag is not widened to `boolean`.

When should v4 compatibility branches be removed?

Remove the compatibility branches after the v5 release line no longer shares its implementation with v4. Until then, keep both v4 and v5 paths intact and verified by focused tests.