π₯ Make videos programmatically with React
docs(studio): explain discovery of unmounted components
JonnyBurgere9c20e162310
diff --git a/packages/docs/docs/studio/showing-unmounted-components.mdx b/packages/docs/docs/studio/showing-unmounted-components.mdxnew file mode 100644index 0000000000..be5b8bbeb0--- /dev/null+++ b/packages/docs/docs/studio/showing-unmounted-components.mdx@@ -0,0 +1,73 @@+---+image: /generated/articles-docs-studio-showing-unmounted-components.png+title: Showing unmounted components+crumb: 'Remotion Studio'+---++# Showing unmounted components<AvailableFrom v="4.0.536" />++By design, Remotion renders only the current frame.+This keeps previews fast even when a video is long.++In the [Remotion Studio](/docs/studio), Remotion also evaluates [components](/docs/components) outside their active time range to better visualize the timeline:++- Items that are not visible at the current frame can still be shown.+- The timeline stays stable as you scroll and seek through the video and doesn't jump.++This discovery only runs in Studio, if you use React 19.2 or later.++## Keeping discovery fast++Remotion reduces the cost of evaluating these components:++- Actual content such as videos and audio is disabled where possible and only metadata is being registered.+- Components are wrapped in React's [`<Activity>`](https://react.dev/reference/react/Activity) with `mode="hidden"`, which keeps their content invisible in the DOM.+- React Effects do not run while the components are hidden inside `<Activity>`.+- The components' frame stays fixed during discovery, avoiding updates on every playback frame.++Your component's render function still runs.+Expensive calculations during rendering can therefore slow down discovery.++## Setting a maximum number of components to discover++Open Settings β Studio β Timeline and change "Visualize unmounted components".+The default is unlimited discovery.++Set a lower number if discovering all components makes a large composition slow.+Remotion prioritizes components closest to the current time.++You can also set the limit in your [config file](/docs/config#setsequenceactivitylimit):++```ts twoslash title="remotion.config.ts"+import {Config} from '@remotion/cli/config';+Config.setSequenceActivityLimit(20);+```++Or use the [`--sequence-activity-limit`](/docs/options/sequence-activity-limit) CLI flag:++```bash title="Terminal"+bunx remotion studio --sequence-activity-limit=20+```++## Disabling the discovery of unmounted components++Set "Visualize unmounted components" to `0` in Settings β Studio β Timeline.++To disable discovery in your config file:++```ts twoslash title="remotion.config.ts"+import {Config} from '@remotion/cli/config';+Config.setSequenceActivityLimit(0);+```++Or pass the CLI flag:++```bash title="Terminal"+bunx remotion studio --sequence-activity-limit=0+```++## See also++- [Premounting](/docs/player/premounting)+- [Components](/docs/components)+- [Sequence Activity limit](/docs/options/sequence-activity-limit)diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.tsindex 0e17dbf9a1..d49c152831 100644--- a/packages/docs/sidebars.ts+++ b/packages/docs/sidebars.ts@@ -1453,6 +1453,7 @@ const sidebars: SidebarsConfig = {'studio/open-in-editor','studio/shortcuts','studio/quick-switcher',+ 'studio/showing-unmounted-components','studio/interactivity','studio/interactivity-best-practices','studio/make-component-interactive',diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.tsindex 3dd39b32cc..ad009ab339 100644--- a/packages/docs/src/data/articles.ts+++ b/packages/docs/src/data/articles.ts@@ -8914,6 +8914,15 @@ export const articles = [noAi: false,slug: 'studio/shortcuts',},+ {+ id: 'studio/showing-unmounted-components',+ title: 'Showing unmounted components',+ relativePath: 'docs/studio/showing-unmounted-components.mdx',+ compId: 'articles-docs-studio-showing-unmounted-components',+ crumb: 'Remotion Studio',+ noAi: false,+ slug: 'studio/showing-unmounted-components',+ },{id: 'studio/shut-down-studio',title: 'shutDownStudio()',diff --git a/packages/docs/static/generated/articles-docs-studio-showing-unmounted-components.png b/packages/docs/static/generated/articles-docs-studio-showing-unmounted-components.pngnew file mode 100644index 0000000000..ba1cdbba67Binary files /dev/null and b/packages/docs/static/generated/articles-docs-studio-showing-unmounted-components.png differdiff --git a/packages/studio/src/components/RenderingSettings.tsx b/packages/studio/src/components/RenderingSettings.tsxindex f38549d406..cde080bde9 100644--- a/packages/studio/src/components/RenderingSettings.tsx+++ b/packages/studio/src/components/RenderingSettings.tsx@@ -568,11 +568,11 @@ export const RenderingSettings: React.FC = () => {/><p style={sectionTitle}>Notifications</p><label style={optionRow}>- <div style={label}>Beep on finish</div>+ <div style={label}>Beep when render finishes</div><div style={rightRow}><Checkboxchecked={beepOnFinish}- name="Beep on finish"+ name="Beep when render finishes"onChange={(event) => {setBeepOnFinish(event.target.checked);markEdited('setBeepOnFinish');diff --git a/packages/studio/src/components/StudioSettings.tsx b/packages/studio/src/components/StudioSettings.tsxindex a3bc9c39d0..e6a2ad8031 100644--- a/packages/studio/src/components/StudioSettings.tsx+++ b/packages/studio/src/components/StudioSettings.tsx@@ -459,7 +459,20 @@ export const StudioSettings: React.FC = () => {}}>The maximum number of components which may be evaluated for better- timeline visualization.+ timeline visualization. See:{' '}+ <a+ href="https://www.remotion.dev/docs/studio/showing-unmounted-components"+ target="_blank"+ rel="noopener noreferrer"+ style={{+ color: BLUE,+ fontSize: INFO_TOOLTIP_FONT_SIZE,+ lineHeight: 1.5,+ textDecoration: 'none',+ }}+ >+ Showing unmounted components+ </a></div></InfoBubble></div>@@ -660,9 +673,27 @@ export const StudioSettings: React.FC = () => {}}>Isolates Studio from other websites to enable shared memory and- multithreading. Required for @remotion/whisper-web and can speed- up ProRes decoding. Media from other websites that requires- cookies or authentication may not load. Disabled by default.+ multithreading. Required for{' '}+ <code style={{fontFamily: 'monospace'}}>+ @remotion/whisper-web+ </code>{' '}+ and for faster{' '}+ <code style={{fontFamily: 'monospace'}}>@mediabunny/prores</code>{' '}+ decoding. The tradeoff is that media from other websites may not+ load. See:{' '}+ <a+ href="https://www.remotion.dev/docs/miscellaneous/cross-origin-isolation"+ target="_blank"+ rel="noopener noreferrer"+ style={{+ color: BLUE,+ fontSize: INFO_TOOLTIP_FONT_SIZE,+ lineHeight: 1.5,+ textDecoration: 'none',+ }}+ >+ Cross-origin isolation+ </a></div></InfoBubble></div>@@ -682,7 +713,7 @@ export const StudioSettings: React.FC = () => {</div><ConfigSelect<LogLevel>defaultLabel="Info"- description={null}+ description="Controls how much detail Remotion writes to the console. Use Info for normal output, Warn or Error for fewer messages, and Verbose or Trace for debugging."name="Log level"onChange={(value) => changeSetting('logLevel', 'setLogLevel', value)}options={BrowserSafeApis.logLevels.map((value) => ({