Skip to content

🎥 Make videos programmatically with React

record

Jonny Burgerd7915272b8b3
diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.ts
index 1ba75944bf..6bdb9432e4 100644
--- a/packages/cli/src/benchmark.ts
+++ b/packages/cli/src/benchmark.ts
@@ -16,6 +16,7 @@ import {bundleOnCliOrTakeServeUrl} from './setup-cache';
import {shouldUseNonOverlayingLogger} from './should-use-non-overlaying-logger';
import {showMultiCompositionsPicker} from './show-compositions-picker';
import {truthy} from './truthy';
+import {Internals} from 'remotion';
const DEFAULT_RUNS = 3;
@@ -213,7 +214,11 @@ export const benchmarkCommand = async (
const comps = await RenderInternals.internalGetCompositions({
serveUrlOrWebpackUrl: bundleLocation,
- serializedInputPropsWithCustomSchema: JSON.stringify(inputProps),
+ serializedInputPropsWithCustomSchema: Internals.serializeJSONWithDate({
+ data: inputProps ?? {},
+ indent: undefined,
+ staticBase: null,
+ }).serializedString,
envVariables,
chromiumOptions,
timeoutInMilliseconds: puppeteerTimeout,
diff --git a/packages/cli/src/editor/components/RenderModal/DataEditor.tsx b/packages/cli/src/editor/components/RenderModal/DataEditor.tsx
index 26d3f21820..e32d126fc3 100644
--- a/packages/cli/src/editor/components/RenderModal/DataEditor.tsx
+++ b/packages/cli/src/editor/components/RenderModal/DataEditor.tsx
@@ -300,7 +300,9 @@ export const DataEditor: React.FC<{
}, [fastRefreshes]);
const onSave = useCallback(
- (updater: (oldState: unknown) => unknown) => {
+ (
+ updater: (oldState: Record<string, unknown>) => Record<string, unknown>
+ ) => {
if (schema === 'no-zod' || schema === 'no-schema' || z === null) {
sendErrorNotification('Cannot update default props: No Zod schema');
return;
@@ -309,7 +311,7 @@ export const DataEditor: React.FC<{
setSaving(true);
updateDefaultProps(
unresolvedComposition.id,
- updater(unresolvedComposition.defaultProps),
+ updater(unresolvedComposition.defaultProps ?? {}),
extractEnumJsonPaths(schema, z, [])
)
.then((response) => {
diff --git a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaEditor.tsx b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaEditor.tsx
index c07537255f..1a8d5cd5c9 100644
--- a/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaEditor.tsx
+++ b/packages/cli/src/editor/components/RenderModal/SchemaEditor/SchemaEditor.tsx
@@ -21,7 +21,9 @@ export const SchemaEditor: React.FC<{
setValue: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
zodValidationResult: z.SafeParseReturnType<unknown, unknown>;
defaultProps: Record<string, unknown>;
- onSave: (updater: (oldState: unknown) => unknown) => void;
+ onSave: (
+ updater: (oldState: Record<string, unknown>) => Record<string, unknown>
+ ) => void;
showSaveButton: boolean;
saving: boolean;
saveDisabledByParent: boolean;
diff --git a/packages/cli/src/editor/components/RenderQueue/actions.ts b/packages/cli/src/editor/components/RenderQueue/actions.ts
index b35d2d93ac..6372529274 100644
--- a/packages/cli/src/editor/components/RenderQueue/actions.ts
+++ b/packages/cli/src/editor/components/RenderQueue/actions.ts
@@ -230,7 +230,7 @@ export const updateAvailable = (signal: AbortSignal) => {
export const updateDefaultProps = (
compositionId: string,
- defaultProps: unknown,
+ defaultProps: Record<string, unknown>,
enumPaths: EnumPath[]
) => {
return callApi('/api/update-default-props', {
diff --git a/packages/compositor-darwin-arm64/compositor b/packages/compositor-darwin-arm64/compositor
index 7c6369b4fa..0540314062 100755
Binary files a/packages/compositor-darwin-arm64/compositor and b/packages/compositor-darwin-arm64/compositor differ
diff --git a/packages/core/src/input-props-serialization.ts b/packages/core/src/input-props-serialization.ts
index 399ce8a4fa..d1fe6ffa82 100644
--- a/packages/core/src/input-props-serialization.ts
+++ b/packages/core/src/input-props-serialization.ts
@@ -16,9 +16,9 @@ export const serializeJSONWithDate = ({
indent,
staticBase,
}: {
- data: unknown;
+ data: Record<string, unknown>;
indent: number | undefined;
- staticBase: string;
+ staticBase: string | null;
}): SerializedJSONWithCustomFields => {
let customDateUsed = false;
let customFileUsed = false;
@@ -44,7 +44,11 @@ export const serializeJSONWithDate = ({
return value;
}
- if (typeof item === 'string' && item.startsWith(staticBase)) {
+ if (
+ typeof item === 'string' &&
+ staticBase !== null &&
+ item.startsWith(staticBase)
+ ) {
customFileUsed = true;
return `${FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
}