Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into rspack-bundler-option

Jonny Burger9ebb04bb2ab9
diff --cc packages/cli/src/benchmark.ts
index 7236667f1e,9c8d94b7a7..5d945c945e
--- a/packages/cli/src/benchmark.ts
+++ b/packages/cli/src/benchmark.ts
@@@ -267,7 -280,9 +281,10 @@@ export const benchmarkCommand = async
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsedCli,
}).value;
+ const rspack = rspackOption.getValue({commandLine: parsedCli}).value;
+ const shouldCache = bundleCacheOption.getValue({
+ commandLine: parsedCli,
+ }).value;
if (experimentalClientSideRenderingEnabled) {
Log.warn(
@@@ -340,7 -355,7 +357,8 @@@
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
});
registerCleanupJob(`Deleting bundle`, () => cleanupBundle());
diff --cc packages/cli/src/bundle.ts
index 680006c022,ff0e56b4a6..77cfc4b9b4
--- a/packages/cli/src/bundle.ts
+++ b/packages/cli/src/bundle.ts
@@@ -21,7 -21,8 +21,9 @@@ const
askAIOption,
experimentalClientSideRenderingOption,
keyboardShortcutsOption,
+ rspackOption,
+ outDirOption,
+ bundleCacheOption,
} = BrowserSafeApis.options;
export const bundleCommand = async (
@@@ -74,7 -75,9 +76,10 @@@
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsedCli,
}).value;
+ const rspack = rspackOption.getValue({commandLine: parsedCli}).value;
+ const shouldCache = bundleCacheOption.getValue({
+ commandLine: parsedCli,
+ }).value;
if (experimentalClientSideRenderingEnabled) {
Log.warn(
@@@ -162,7 -166,7 +168,8 @@@
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
});
Log.info(
diff --cc packages/cli/src/compositions.ts
index 0582043c41,0b6e60766c..4ce4de087f
--- a/packages/cli/src/compositions.ts
+++ b/packages/cli/src/compositions.ts
@@@ -136,7 -136,9 +137,10 @@@ export const listCompositionsCommand =
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsedCli,
}).value;
+ const rspack = rspackOption.getValue({commandLine: parsedCli}).value;
+ const shouldCache = bundleCacheOption.getValue({
+ commandLine: parsedCli,
+ }).value;
if (experimentalClientSideRenderingEnabled) {
Log.warn(
@@@ -170,7 -172,7 +174,8 @@@
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
});
registerCleanupJob(`Cleanup bundle`, () => cleanupBundle());
diff --cc packages/cli/src/config/index.ts
index 38dd2a05e0,9075b66ed2..55ddecf735
--- a/packages/cli/src/config/index.ts
+++ b/packages/cli/src/config/index.ts
@@@ -119,7 -112,13 +112,14 @@@ const
overrideWidthOption,
overrideFpsOption,
overrideDurationOption,
+ rspackOption,
+ outDirOption,
+ webpackPollOption,
+ imageSequenceOption,
+ bundleCacheOption,
+ envFileOption,
+ runsOption,
+ noOpenOption,
} = BrowserSafeApis.options;
declare global {
@@@ -659,13 -662,12 +669,13 @@@ export const Config: FlatConfig =
setKeyboardShortcutsEnabled: keyboardShortcutsOption.setConfig,
setExperimentalClientSideRenderingEnabled:
experimentalClientSideRenderingOption.setConfig,
+ setExperimentalRspackEnabled: rspackOption.setConfig,
setNumberOfSharedAudioTags: numberOfSharedAudioTagsOption.setConfig,
- setWebpackPollingInMilliseconds,
- setShouldOpenBrowser,
+ setWebpackPollingInMilliseconds: webpackPollOption.setConfig,
+ setShouldOpenBrowser: noOpenOption.setConfig,
setBufferStateDelayInMilliseconds,
overrideWebpackConfig,
- setCachingEnabled: setWebpackCaching,
+ setCachingEnabled: bundleCacheOption.setConfig,
setPort,
setStudioPort,
setRendererPort,
diff --cc packages/cli/src/render-flows/render.ts
index 868ce2ec52,995f2a8044..c63c7c3235
--- a/packages/cli/src/render-flows/render.ts
+++ b/packages/cli/src/render-flows/render.ts
@@@ -339,7 -345,7 +347,8 @@@ export const renderVideoFlow = async (
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
},
);
diff --cc packages/cli/src/render-flows/still.ts
index 948c44ac7d,d18a329800..e85fda2e2a
--- a/packages/cli/src/render-flows/still.ts
+++ b/packages/cli/src/render-flows/still.ts
@@@ -231,7 -231,7 +233,8 @@@ export const renderStillFlow = async (
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
},
);
diff --cc packages/cli/src/render-queue/process-still.ts
index 2a55d04b18,8a642d4b3e..72dd4c27e6
--- a/packages/cli/src/render-queue/process-still.ts
+++ b/packages/cli/src/render-queue/process-still.ts
@@@ -10,8 -10,8 +10,9 @@@ const
askAIOption,
experimentalClientSideRenderingOption,
keyboardShortcutsOption,
+ rspackOption,
browserExecutableOption,
+ bundleCacheOption,
} = BrowserSafeApis.options;
export const processStill = async ({
@@@ -46,6 -46,9 +47,10 @@@
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsedCli,
}).value;
+ const shouldCache = bundleCacheOption.getValue({
+ commandLine: parsedCli,
+ }).value;
++ const rspack = rspackOption.getValue({commandLine: parsedCli}).value;
const fullEntryPoint = convertEntryPointToServeUrl(entryPoint);
@@@ -89,6 -92,6 +94,7 @@@
askAIEnabled,
experimentalClientSideRenderingEnabled,
keyboardShortcutsEnabled,
- rspack: rspackOption.getValue({commandLine: parsedCli}).value,
++ rspack,
+ shouldCache,
});
};
diff --cc packages/cli/src/render-queue/process-video.ts
index b8001602c2,a6618ae9b1..48cd17f981
--- a/packages/cli/src/render-queue/process-video.ts
+++ b/packages/cli/src/render-queue/process-video.ts
@@@ -12,8 -12,8 +12,9 @@@ const
askAIOption,
experimentalClientSideRenderingOption,
keyboardShortcutsOption,
+ rspackOption,
browserExecutableOption,
+ bundleCacheOption,
} = BrowserSafeApis.options;
export const processVideoJob = async ({
@@@ -51,7 -54,7 +55,9 @@@
const browserExecutable = browserExecutableOption.getValue({
commandLine: parsedCli,
}).value;
++ const rspack = rspackOption.getValue({commandLine: parsedCli}).value;
const fullEntryPoint = convertEntryPointToServeUrl(entryPoint);
++
await renderVideoFlow({
remotionRoot,
browser: 'chrome',
@@@ -124,6 -127,6 +130,7 @@@
experimentalClientSideRenderingOption.getValue({commandLine: parsedCli})
.value,
keyboardShortcutsEnabled,
- rspack: rspackOption.getValue({commandLine: parsedCli}).value,
++ rspack,
+ shouldCache,
});
};
diff --cc packages/cli/src/render.tsx
index 0a6c9a48ac,bcdee69c71..1401959255
--- a/packages/cli/src/render.tsx
+++ b/packages/cli/src/render.tsx
@@@ -234,6 -247,9 +249,13 @@@ export const render = async
const mediaCacheSizeInBytes = mediaCacheSizeInBytesOption.getValue({
commandLine: parsedCli,
}).value;
+ const shouldCache = bundleCacheOption.getValue({
+ commandLine: parsedCli,
+ }).value;
++ const experimentalClientSideRenderingEnabled =
++ experimentalClientSideRenderingOption.getValue({
++ commandLine: parsedCli,
++ }).value;
await renderVideoFlow({
fullEntryPoint,
@@@ -305,10 -321,10 +327,9 @@@
audioLatencyHint,
imageSequencePattern,
askAIEnabled,
-- experimentalClientSideRenderingEnabled:
-- experimentalClientSideRenderingOption.getValue({commandLine: parsedCli})
-- .value,
++ experimentalClientSideRenderingEnabled,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
});
};
diff --cc packages/cli/src/setup-cache.ts
index 01b45469f1,517758fe31..136595ab08
--- a/packages/cli/src/setup-cache.ts
+++ b/packages/cli/src/setup-cache.ts
@@@ -35,7 -35,7 +35,8 @@@ export const bundleOnCliOrTakeServeUrl
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
}: {
fullPath: string;
remotionRoot: string;
@@@ -58,7 -58,7 +59,8 @@@
experimentalClientSideRenderingEnabled: boolean;
askAIEnabled: boolean;
keyboardShortcutsEnabled: boolean;
+ rspack: boolean;
+ shouldCache: boolean;
}): Promise<{
urlOrBundle: string;
cleanup: () => void;
@@@ -102,7 -102,7 +104,8 @@@
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
});
return {
@@@ -130,7 -130,7 +133,8 @@@ export const bundleOnCli = async (
experimentalClientSideRenderingEnabled,
askAIEnabled,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
}: {
fullPath: string;
remotionRoot: string;
@@@ -153,10 -153,8 +157,9 @@@
experimentalClientSideRenderingEnabled: boolean;
keyboardShortcutsEnabled: boolean;
askAIEnabled: boolean;
+ rspack: boolean;
+ shouldCache: boolean;
}) => {
- const shouldCache = ConfigInternals.getWebpackCaching();
-
const symlinkState: SymbolicLinksState = {
symlinks: [],
};
diff --cc packages/cli/src/still.ts
index 3cd247510f,3caf73681c..2d6390a8db
--- a/packages/cli/src/still.ts
+++ b/packages/cli/src/still.ts
@@@ -148,7 -155,9 +156,10 @@@ export const still = async
const keyboardShortcutsEnabled = keyboardShortcutsOption.getValue({
commandLine: parsedCli,
}).value;
+ const rspack = rspackOption.getValue({commandLine: parsedCli}).value;
+ const shouldCache = bundleCacheOption.getValue({
+ commandLine: parsedCli,
+ }).value;
const chromiumOptions: Required<ChromiumOptions> = {
disableWebSecurity,
@@@ -208,6 -217,6 +219,7 @@@
experimentalClientSideRenderingOption.getValue({commandLine: parsedCli})
.value,
keyboardShortcutsEnabled,
+ rspack,
+ shouldCache,
});
};
diff --cc packages/cli/src/studio.ts
index 7c5f7deca6,b658b9cd8b..9f9d706a85
--- a/packages/cli/src/studio.ts
+++ b/packages/cli/src/studio.ts
@@@ -42,7 -29,10 +29,11 @@@ const
numberOfSharedAudioTagsOption,
audioLatencyHintOption,
ipv4Option,
+ rspackOption,
+ webpackPollOption,
+ noOpenOption,
+ portOption,
+ browserOption,
} = BrowserSafeApis.options;
export const studioCommand = async (
diff --cc packages/docs/docs/cli/studio.mdx
index 0b47dd39d7,880e7b03bd..7411636eaa
--- a/packages/docs/docs/cli/studio.mdx
+++ b/packages/docs/docs/cli/studio.mdx
@@@ -56,16 -51,11 +51,15 @@@ Inline JSON string isn't supported on W
### `--enable-experimental-client-side-rendering`<AvailableFrom v="4.0.387" />
- [Enables experimental client-side rendering in the Studio](/docs/config#setexperimentalclientsiderenderingenabled). Default is `false`.
+ <Options id="enable-experimental-client-side-rendering" />
+### `--experimental-rspack`<AvailableFrom v="4.0.426" />
+
+<Options id="experimental-rspack" />
+
### `--webpack-poll`<AvailableFrom v="3.3.11" />
- [Enables Webpack polling](/docs/config#setwebpackpollinginmilliseconds) instead of the file system event listeners for hot reloading. This is useful if you are inside a virtual machine or have a remote file system.
- Pass a value in milliseconds, for example `--webpack-poll=1000`.
+ <Options id="webpack-poll" />
### `--no-open`<AvailableFrom v="3.3.19" />
diff --cc packages/docs/docs/config.mdx
index 50d6511046,2c05c27e0e..3a5c784a0b
--- a/packages/docs/docs/config.mdx
+++ b/packages/docs/docs/config.mdx
@@@ -151,22 -175,9 +175,21 @@@ Config.setExperimentalClientSideRenderi
The [command line flag](/docs/cli/studio#--enable-experimental-client-side-rendering) `--enable-experimental-client-side-rendering` will take precedence over this option.
+## `setExperimentalRspackEnabled()`<AvailableFrom v="4.0.426" />
+
+Use [Rspack](https://rspack.dev) instead of Webpack as the bundler for the Studio. Default `false`.
+
+```ts twoslash title="remotion.config.ts"
+import {Config} from '@remotion/cli/config';
+// ---cut---
+Config.setExperimentalRspackEnabled(true);
+```
+
+The [command line flag](/docs/cli/studio#--experimental-rspack) `--experimental-rspack` will take precedence over this option.
+
## `setWebpackPollingInMilliseconds()`<AvailableFrom v="3.3.11" />
- Enables Webpack polling instead of the file system event listeners for hot reloading.
- This is useful if you are inside a virtual machine or have a remote file system.
+ <Options id="webpack-poll" />
```ts twoslash title="remotion.config.ts"
import {Config} from '@remotion/cli/config';
diff --cc packages/renderer/src/options/index.tsx
index cf7fa62b44,2440e3f923..e313389434
--- a/packages/renderer/src/options/index.tsx
+++ b/packages/renderer/src/options/index.tsx
@@@ -57,9 -67,10 +67,11 @@@ import {publicDirOption} from './public
import {publicLicenseKeyOption} from './public-license-key';
import {publicPathOption} from './public-path';
import {reproOption} from './repro';
+import {rspackOption} from './rspack';
+ import {runsOption} from './runs';
import {scaleOption} from './scale';
import {separateAudioOption} from './separate-audio';
+ import {stillFrameOption} from './still-frame';
import {stillImageFormatOption} from './still-image-format';
import {throwIfSiteExistsOption} from './throw-if-site-exists';
import {delayRenderTimeoutInMillisecondsOption} from './timeout';
@@@ -142,7 -157,18 +158,19 @@@ export const allOptions =
overrideWidthOption,
overrideFpsOption,
overrideDurationOption,
+ rspackOption,
+ outDirOption,
+ packageManagerOption,
+ webpackPollOption,
+ stillFrameOption,
+ imageSequenceOption,
+ versionFlagOption,
+ bundleCacheOption,
+ envFileOption,
+ portOption,
+ propsOption,
+ configOption,
+ browserOption,
};
export type AvailableOptions = keyof typeof allOptions;