Skip to content

🎥 Make videos programmatically with React

Merge main into upgrade-zod

Jonny Burger6cec91867c0c
diff --cc bun.lock
index 43ee62cac7,4bd450663a..75a0ccd77c
--- a/bun.lock
+++ b/bun.lock
@@@ -10447,8 -10499,8 +10494,6 @@@
"template-prompt-to-motion-graphics/typescript-eslint": ["[email protected]", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.46.0", "@typescript-eslint/parser": "8.46.0", "@typescript-eslint/typescript-estree": "8.46.0", "@typescript-eslint/utils": "8.46.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-6+ZrB6y2bT2DX3K+Qd9vn7OFOJR+xSLDj+Aw/N3zBwUt27uTw2sw2TE2+UcY1RiyBZkaGbTkVg9SSdPNUG6aUw=="],
- "template-react-router/dotenv": ["[email protected]", "", {}, "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="],
- "template-prompt-to-motion-graphics/zod": ["[email protected]", "", {}, "sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig=="],
--
"template-react-router/tailwind-merge": ["[email protected]", "", {}, "sha512-AvzE8FmSoXC7nC+oU5GlQJbip2UO7tmOhOfQyOmPhrStOGXHU08j8mZEHZ4BmCqY5dWTCo4ClWkNyRNx1wpT0g=="],
"template-react-router/tailwindcss": ["[email protected]", "", {}, "sha512-ULRPI3A+e39T7pSaf1xoi58AqqJxVCLg8F/uM5A3FadUbnyDTgltVnXJvdkTjwCOGA6NazqHVcwPJC5h2vRYVQ=="],
diff --cc packages/cli/src/extra-packages.ts
index 2c03d70356,6d0e839a15..e3f23cb34a
--- a/packages/cli/src/extra-packages.ts
+++ b/packages/cli/src/extra-packages.ts
@@@ -1,5 -1,6 +1,5 @@@
export const EXTRA_PACKAGES: Record<string, string> = {
- mediabunny: '1.34.2',
- zod: '3.22.3',
+ mediabunny: '1.34.3',
};
export const EXTRA_PACKAGES_DOCS: Record<string, string> = {
diff --cc packages/studio-shared/src/package-info.ts
index bbf4265e4a,b21576ded0..8553f1a738
--- a/packages/studio-shared/src/package-info.ts
+++ b/packages/studio-shared/src/package-info.ts
@@@ -94,9 -94,15 +94,9 @@@ export type ExtraPackage =
};
export const extraPackages: ExtraPackage[] = [
- {
- name: 'zod',
- version: '3.22.3',
- description: 'Schema validation library for defining component props',
- docsUrl: 'https://www.remotion.dev/docs/schemas',
- },
{
name: 'mediabunny',
- version: '1.34.2',
+ version: '1.34.3',
description: 'Multimedia library used by Remotion',
docsUrl: 'https://www.remotion.dev/docs/mediabunny/version',
},
diff --cc packages/studio/src/api/helpers/calc-new-props.ts
index 93cfd40fa2,ed4b617c2c..f81611db01
--- a/packages/studio/src/api/helpers/calc-new-props.ts
+++ b/packages/studio/src/api/helpers/calc-new-props.ts
@@@ -1,6 -1,6 +1,6 @@@
- import type {_InternalTypes} from 'remotion';
+ import type {AnyComposition} from 'remotion';
import {Internals, getRemotionEnvironment} from 'remotion';
-import type {AnyZodObject} from 'zod';
+import type {AnyZodObject} from 'remotion';
export type UpdateDefaultPropsFunction = (currentValues: {
schema: AnyZodObject | null;
diff --cc packages/studio/src/components/get-zod-if-possible.tsx
index 1d604eb9b6,b54594f10f..b51f65740b
--- a/packages/studio/src/components/get-zod-if-possible.tsx
+++ b/packages/studio/src/components/get-zod-if-possible.tsx
@@@ -22,17 -20,8 +22,17 @@@ export async function getZodIfPossible(
} catch {
return null;
}
- };
+ }
+export const getZodV3IfPossible = async (): Promise<ZodV3Type | null> => {
+ try {
+ const mod = await import('zod/v3');
+ return mod;
+ } catch {
+ return null;
+ }
+};
+
export const getZTypesIfPossible = async (): Promise<ZodTypesType | null> => {
try {
const mod = await import('@remotion/zod-types');
@@@ -42,16 -31,11 +42,16 @@@
}
};
- export const useZodIfPossible = () => {
+ export function useZodIfPossible(): ZodType | null {
const context = useContext(ZodContext);
return context?.zod ?? null;
- };
+ }
+export const useZodV3IfPossible = () => {
+ const context = useContext(ZodContext);
+ return context?.zodV3 ?? null;
+};
+
export const useZodTypesIfPossible = () => {
const context = useContext(ZodContext);
return context?.zodTypes ?? null;