🎥 Make videos programmatically with React
make a page make sense
Jonny Burgerdc7dd5b5bdff
diff --git a/packages/docs/docs/vercel/create-sandbox.mdx b/packages/docs/docs/vercel/create-sandbox.mdxindex ae9e1bc6ba..30a6318753 100644--- a/packages/docs/docs/vercel/create-sandbox.mdx+++ b/packages/docs/docs/vercel/create-sandbox.mdx@@ -6,12 +6,9 @@ crumb: '@remotion/vercel'# createSandbox()<AvailableFrom v="4.0.426" />-Creates a new [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) with all Remotion dependencies installed, including system libraries, the compositor, and a browser.-+Creates a new [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) with all Remotion dependencies installed, including system libraries, the compositor, and a browser.After creating the sandbox, call [`addBundleToSandbox()`](/docs/vercel/add-bundle-to-sandbox) to copy your Remotion bundle into it.-Creates a sandbox from scratch. In production, prefer [`restoreSnapshot()`](/docs/vercel/restore-snapshot) to restore from a cached snapshot instead.-## Example```ts twoslash title="create-snapshot.ts"@@ -46,29 +43,49 @@ A callback that receives progress updates during sandbox creation.```ts twoslashimport type {CreateSandboxOnProgress} from '@remotion/vercel';-```--```ts-type CreateSandboxOnProgress = (update: {- progress: number; // 0 to 1- message: string; // Human-readable phase description-}) => void;+// ---cut---+const onProgress: CreateSandboxOnProgress = ({progress, message}) => {+ console.log(`${message} (${Math.round(progress * 100)}%)`);+};```## Return value-A `VercelSandbox` object (a [`Sandbox`](https://vercel.com/docs/vercel-sandbox/sdk-reference#sandbox-class) with `AsyncDisposable` support). Call `sandbox.stop()` when you are done with the sandbox.+A [`VercelSandbox`](/docs/vercel/vercel-types#vercelsandbox) object (a [`Sandbox`](https://vercel.com/docs/vercel-sandbox/sdk-reference#sandbox-class) with `AsyncDisposable` support).-## Using `await using`+## Stopping the sandbox-You can use `await using` to automatically clean up the sandbox when it goes out of scope:+When you are done with the sandbox, you need to stop it to free resources. There are two ways to do this:-```ts twoslash title="create-snapshot.ts"+### Using `sandbox.stop()`++Manually call `sandbox.stop()` when you are done:++```ts twoslash title="manual-cleanup.ts"+// @module: es2022+// @target: es2022+import {createSandbox} from '@remotion/vercel';+// ---cut---+const sandbox = await createSandbox();++// ... use the sandbox++await sandbox.stop();+```++### Using `await using`++Use `await using` to automatically stop the sandbox when it goes out of scope:++```ts twoslash title="auto-cleanup.ts"// @module: es2022// @target: es2022import {createSandbox} from '@remotion/vercel';// ---cut---await using sandbox = await createSandbox();++// ... use the sandbox+// sandbox.stop() is called automatically```## See alsodiff --git a/packages/docs/docs/vercel/index.mdx b/packages/docs/docs/vercel/index.mdxindex 95564689b3..2cc3e777ba 100644--- a/packages/docs/docs/vercel/index.mdx+++ b/packages/docs/docs/vercel/index.mdx@@ -9,15 +9,8 @@ import {TableOfContents} from './table-of-contents';# @remotion/vercel<AvailableFrom v="4.0.426" />-Render Remotion videos on [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox).--<Installation pkg="@remotion/vercel" />--This package requires `@vercel/sandbox` and `@vercel/blob` as peer dependencies:--```bash-npm i @vercel/sandbox @vercel/blob-```+Render Remotion videos on [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox).+This package requires `@vercel/sandbox` and `@vercel/blob` as peer dependencies.## APIsdiff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.tsindex 4d1ab55537..7ad5acba1a 100644--- a/packages/docs/sidebars.ts+++ b/packages/docs/sidebars.ts@@ -460,24 +460,6 @@ const sidebars: SidebarsConfig = {},items: ['light-leaks/light-leak'],},- {- type: 'category',- label: '@remotion/vercel',- link: {- type: 'doc',- id: 'vercel/vercel-api',- },- items: [- 'vercel/create-sandbox',- 'vercel/add-bundle-to-sandbox',- 'vercel/save-snapshot',- 'vercel/restore-snapshot',- 'vercel/render-video-on-vercel',- 'vercel/render-still-on-vercel',- 'vercel/upload-to-vercel-blob',- 'vercel/vercel-types',- ],- },{type: 'category',label: '@remotion/openai-whisper',@@ -735,6 +717,24 @@ const sidebars: SidebarsConfig = {],},+ {+ type: 'category',+ label: '@remotion/vercel',+ link: {+ type: 'doc',+ id: 'vercel/vercel-api',+ },+ items: [+ 'vercel/create-sandbox',+ 'vercel/add-bundle-to-sandbox',+ 'vercel/save-snapshot',+ 'vercel/restore-snapshot',+ 'vercel/render-video-on-vercel',+ 'vercel/render-still-on-vercel',+ 'vercel/upload-to-vercel-blob',+ 'vercel/vercel-types',+ ],+ },{type: 'category',label: '@remotion/web-renderer',