Skip to content

🎥 Make videos programmatically with React

remove unnecessary option

Jonny Burger8a14879be121
diff --git a/packages/docs/docs/vercel/add-bundle-to-sandbox.mdx b/packages/docs/docs/vercel/add-bundle-to-sandbox.mdx
index e1a09cf88d..beb536b36e 100644
--- a/packages/docs/docs/vercel/add-bundle-to-sandbox.mdx
+++ b/packages/docs/docs/vercel/add-bundle-to-sandbox.mdx
@@ -21,7 +21,7 @@ const sandbox = await createSandbox();
await addBundleToSandbox({
sandbox,
- bundleDir: '.remotion',
+ bundleDir: '/path/to/bundle',
});
// ... use the sandbox
diff --git a/packages/docs/docs/vercel/create-sandbox.mdx b/packages/docs/docs/vercel/create-sandbox.mdx
index 30a6318753..0375299004 100644
--- a/packages/docs/docs/vercel/create-sandbox.mdx
+++ b/packages/docs/docs/vercel/create-sandbox.mdx
@@ -25,7 +25,7 @@ const sandbox = await createSandbox({
await addBundleToSandbox({
sandbox,
- bundleDir: '.remotion',
+ bundleDir: '/path/to/bundle',
});
// ... use the sandbox
diff --git a/packages/docs/docs/vercel/render-still-on-vercel.mdx b/packages/docs/docs/vercel/render-still-on-vercel.mdx
index 1783d6d17d..8fa4715f8e 100644
--- a/packages/docs/docs/vercel/render-still-on-vercel.mdx
+++ b/packages/docs/docs/vercel/render-still-on-vercel.mdx
@@ -17,7 +17,7 @@ The rendered file stays inside the sandbox. Use [`uploadToVercelBlob()`](/docs/v
// @target: es2022
import {renderStillOnVercel, addBundleToSandbox, createSandbox} from '@remotion/vercel';
const sandbox = await createSandbox();
-await addBundleToSandbox({sandbox, bundleDir: '.remotion'});
+await addBundleToSandbox({sandbox, bundleDir: '/path/to/bundle'});
// ---cut---
const {file} = await renderStillOnVercel({
sandbox,
@@ -115,10 +115,6 @@ Remotion license key. Default: `null`.
A callback that receives render progress updates. See [`renderVideoOnVercel()`](/docs/vercel/render-video-on-vercel#onprogress) for the type definition.
-### `bundleDir?`
-
-The bundle directory name in the sandbox. Default: `".remotion"`.
-
## Return value
An object containing:
diff --git a/packages/docs/docs/vercel/render-video-on-vercel.mdx b/packages/docs/docs/vercel/render-video-on-vercel.mdx
index f001abfe56..8a7e063284 100644
--- a/packages/docs/docs/vercel/render-video-on-vercel.mdx
+++ b/packages/docs/docs/vercel/render-video-on-vercel.mdx
@@ -17,7 +17,7 @@ The rendered file stays inside the sandbox. Use [`uploadToVercelBlob()`](/docs/v
// @target: es2022
import {renderVideoOnVercel, addBundleToSandbox, createSandbox} from '@remotion/vercel';
const sandbox = await createSandbox();
-await addBundleToSandbox({sandbox, bundleDir: '.remotion'});
+await addBundleToSandbox({sandbox, bundleDir: '/path/to/bundle'});
// ---cut---
const {file} = await renderVideoOnVercel({
sandbox,
@@ -229,10 +229,6 @@ type RenderOnVercelProgress =
| {type: 'done'; url: string; size: number};
```
-### `bundleDir?`
-
-The bundle directory name in the sandbox. Default: `".remotion"`.
-
## Return value
An object containing:
diff --git a/packages/docs/docs/vercel/restore-snapshot.mdx b/packages/docs/docs/vercel/restore-snapshot.mdx
index d8c02ae7ef..8ab3782bbc 100644
--- a/packages/docs/docs/vercel/restore-snapshot.mdx
+++ b/packages/docs/docs/vercel/restore-snapshot.mdx
@@ -22,7 +22,7 @@ const sandbox = process.env.VERCEL
: await createSandbox();
if (!process.env.VERCEL) {
- await addBundleToSandbox({sandbox, bundleDir: '.remotion'});
+ await addBundleToSandbox({sandbox, bundleDir: '/path/to/bundle'});
}
// ... use the sandbox
@@ -52,7 +52,7 @@ await using sandbox = process.env.VERCEL
: await createSandbox();
if (!process.env.VERCEL) {
- await addBundleToSandbox({sandbox, bundleDir: '.remotion'});
+ await addBundleToSandbox({sandbox, bundleDir: '/path/to/bundle'});
}
```
diff --git a/packages/docs/docs/vercel/save-snapshot.mdx b/packages/docs/docs/vercel/save-snapshot.mdx
index 3dd2e82566..df619d1aa9 100644
--- a/packages/docs/docs/vercel/save-snapshot.mdx
+++ b/packages/docs/docs/vercel/save-snapshot.mdx
@@ -17,7 +17,7 @@ Typically called during the build step (e.g. in `create-snapshot.ts`) to cache t
// @target: es2022
import {addBundleToSandbox, createSandbox, saveSnapshot} from '@remotion/vercel';
const sandbox = await createSandbox();
-await addBundleToSandbox({sandbox, bundleDir: '.remotion'});
+await addBundleToSandbox({sandbox, bundleDir: '/path/to/bundle'});
// ---cut---
const {snapshotId} = await saveSnapshot({sandbox});
console.log(`Snapshot saved: ${snapshotId}`);
diff --git a/packages/docs/docs/vercel/upload-to-vercel-blob.mdx b/packages/docs/docs/vercel/upload-to-vercel-blob.mdx
index 9774c0a95b..62293bbd65 100644
--- a/packages/docs/docs/vercel/upload-to-vercel-blob.mdx
+++ b/packages/docs/docs/vercel/upload-to-vercel-blob.mdx
@@ -15,7 +15,7 @@ Uploads a file from the sandbox to [Vercel Blob](https://vercel.com/docs/storage
// @target: es2022
import {uploadToVercelBlob, addBundleToSandbox, createSandbox} from '@remotion/vercel';
const sandbox = await createSandbox();
-await addBundleToSandbox({sandbox, bundleDir: '.remotion'});
+await addBundleToSandbox({sandbox, bundleDir: '/path/to/bundle'});
// ---cut---
const {url, size} = await uploadToVercelBlob({
sandbox,
diff --git a/packages/vercel/src/internals/add-bundle.ts b/packages/vercel/src/internals/add-bundle.ts
index 0c77a182a9..f0163e5164 100644
--- a/packages/vercel/src/internals/add-bundle.ts
+++ b/packages/vercel/src/internals/add-bundle.ts
@@ -4,6 +4,8 @@ import {existsSync} from 'fs';
import {readdir, readFile} from 'fs/promises';
import path from 'path';
+export const REMOTION_SANDBOX_BUNDLE_DIR = 'remotion-bundle';
+
function ensureLocalBundle(bundleDir: string): void {
if (process.env.VERCEL) {
return;
@@ -67,12 +69,12 @@ export const addBundleToSandbox = async ({
}
for (const dir of Array.from(dirs).sort()) {
- await sandbox.mkDir(bundleDir + '/' + dir);
+ await sandbox.mkDir(REMOTION_SANDBOX_BUNDLE_DIR + '/' + dir);
}
await sandbox.writeFiles(
bundleFiles.map((file) => ({
- path: bundleDir + '/' + file.path,
+ path: REMOTION_SANDBOX_BUNDLE_DIR + '/' + file.path,
content: file.content,
})),
);
diff --git a/packages/vercel/src/render-still-on-vercel.ts b/packages/vercel/src/render-still-on-vercel.ts
index f61454657f..f52320410e 100644
--- a/packages/vercel/src/render-still-on-vercel.ts
+++ b/packages/vercel/src/render-still-on-vercel.ts
@@ -1,5 +1,6 @@
import type {Sandbox} from '@vercel/sandbox';
import {script as renderStillScript} from './generated/render-still-script';
+import {REMOTION_SANDBOX_BUNDLE_DIR} from './internals/add-bundle';
import type {
ChromeMode,
ChromiumOptions,
@@ -13,7 +14,6 @@ export async function renderStillOnVercel({
compositionId,
inputProps,
onProgress,
- bundleDir = '.remotion',
outputFile = '/tmp/still.png',
frame = 0,
imageFormat = 'png',
@@ -36,7 +36,6 @@ export async function renderStillOnVercel({
compositionId: string;
inputProps: Record<string, unknown>;
onProgress?: (progress: RenderOnVercelProgress) => void;
- bundleDir?: string;
outputFile?: string;
frame?: number;
imageFormat?: StillImageFormat;
@@ -55,7 +54,7 @@ export async function renderStillOnVercel({
offthreadVideoThreads?: number | null;
licenseKey?: string | null;
}): Promise<{file: string}> {
- const serveUrl = `/vercel/sandbox/${bundleDir}`;
+ const serveUrl = `/vercel/sandbox/${REMOTION_SANDBOX_BUNDLE_DIR}`;
const renderConfig = {
serveUrl,
diff --git a/packages/vercel/src/render-video-on-vercel.ts b/packages/vercel/src/render-video-on-vercel.ts
index 789ac19af8..7becbe4fd7 100644
--- a/packages/vercel/src/render-video-on-vercel.ts
+++ b/packages/vercel/src/render-video-on-vercel.ts
@@ -1,5 +1,6 @@
import type {Sandbox} from '@vercel/sandbox';
import {script as renderVideoScript} from './generated/render-video-script';
+import {REMOTION_SANDBOX_BUNDLE_DIR} from './internals/add-bundle';
import type {
AudioCodec,
Bitrate,
@@ -22,7 +23,6 @@ export async function renderVideoOnVercel({
compositionId,
inputProps,
onProgress,
- bundleDir = '.remotion',
outputFile = '/tmp/video.mp4',
codec = 'h264',
crf,
@@ -68,7 +68,6 @@ export async function renderVideoOnVercel({
compositionId: string;
inputProps: Record<string, unknown>;
onProgress?: (progress: RenderOnVercelProgress) => void;
- bundleDir?: string;
outputFile?: string;
codec?: Codec;
crf?: number | null;
@@ -110,7 +109,7 @@ export async function renderVideoOnVercel({
offthreadVideoThreads?: number | null;
repro?: boolean;
}): Promise<{file: string}> {
- const serveUrl = `/vercel/sandbox/${bundleDir}`;
+ const serveUrl = `/vercel/sandbox/${REMOTION_SANDBOX_BUNDLE_DIR}`;
const renderConfig = {
serveUrl,