Skip to content

🎥 Make videos programmatically with React

further optimize pipeline

Jonny Burger30269f9efe61
diff --git a/package.json b/package.json
index 39097742da..71b584abba 100644
--- a/package.json
+++ b/package.json
@@ -5,14 +5,15 @@
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
"test": "turbo run lint test",
- "stylecheck": "tsc -b --verbose && turbo run lint formatting",
- "build": "tsc -b --verbose && turbo run build",
- "build-docs": "tsc -b --verbose && turbo run build-docs",
- "ci": "tsc -b --verbose && turbo run build test --concurrency=50%",
+ "ts-build": "tsc -b --verbose",
+ "stylecheck": "turbo run lint formatting",
+ "build": "turbo run build",
+ "build-docs": "turbo run build-docs",
+ "ci": "turbo run build test --concurrency=50%",
"watch": "tsc -b --verbose -w",
"release-alpha": "pnpm recursive publish --tag=alpha --no-git-checks && pnpm recursive run --sequential publishprivate",
"release": "pnpm recursive publish && pnpm recursive run --sequential publishprivate && git push --tags && git push",
- "clean": "rm -rf packages/**/dist && rm -rf packages/**/node_modules && rm -rf node_modules && rm -rf .cache && rm -rf packages/**/tsconfig.tsbuildinfo && rm -rf packages/**/tsconfig-cjs.tsbuildinfo && rm -f packages/tsconfig.tsbuildinfo && rm -rf packages/**/.turbo && rm -rf .turbo"
+ "clean": "rm -rf packages/**/dist && rm -rf packages/**/node_modules && rm -rf node_modules && rm -rf .cache && rm -rf packages/**/tsconfig.tsbuildinfo && rm -f packages/tsconfig.tsbuildinfo && rm -rf packages/**/.turbo && rm -rf .turbo"
},
"engines": {
"node": ">=16",
diff --git a/packages/astro-example/build.mjs b/packages/astro-example/build.mjs
index f227d71635..68e81e1427 100644
--- a/packages/astro-example/build.mjs
+++ b/packages/astro-example/build.mjs
@@ -15,6 +15,6 @@ if (majorVersion < 16) {
process.exit(0);
}
-execSync("pnpm exec astro build", {
+execSync("bunx astro build", {
stdio: "inherit",
});
diff --git a/packages/astro-example/package.json b/packages/astro-example/package.json
index 3a69f5ca2e..337ea4a3e3 100644
--- a/packages/astro-example/package.json
+++ b/packages/astro-example/package.json
@@ -21,6 +21,7 @@
"@remotion/transitions": "workspace:*",
"@types/react": "18.3.1",
"@types/react-dom": "18.3.0",
+ "lottie-web": "5.12.2",
"astro": "^2.0.14",
"react": "^18.1.0",
"react-dom": "^18.1.0",
diff --git a/packages/astro-example/src/components/Counter.tsx b/packages/astro-example/src/components/Counter.tsx
index 9fa406d8a5..a1a54e0f03 100644
--- a/packages/astro-example/src/components/Counter.tsx
+++ b/packages/astro-example/src/components/Counter.tsx
@@ -1,7 +1,6 @@
import "./Counter.css";
import { Player } from "@remotion/player";
import { Gif } from "@remotion/gif";
-import { Pumpkin } from "./LottieExample";
const Comp: React.FC = () => {
return (
@@ -12,7 +11,6 @@ const Comp: React.FC = () => {
height={200}
width={200}
/>
- <Pumpkin></Pumpkin>
</div>
);
};
diff --git a/packages/astro-example/src/components/LottieExample.tsx b/packages/astro-example/src/components/LottieExample.tsx
deleted file mode 100644
index 5d78f22ffb..0000000000
--- a/packages/astro-example/src/components/LottieExample.tsx
+++ /dev/null
@@ -1,46 +0,0 @@
-import { Lottie } from "@remotion/lottie";
-import { useEffect, useState } from "react";
-import {
- AbsoluteFill,
- continueRender,
- delayRender,
- interpolate,
- useCurrentFrame,
- useVideoConfig,
-} from "remotion";
-
-export const Pumpkin = () => {
- const frame = useCurrentFrame();
- const { durationInFrames } = useVideoConfig();
-
- const animationDelay = 1;
- const animationInput = frame - animationDelay;
- const animationOpacity = interpolate(
- animationInput,
- [0, 5, durationInFrames - 20, durationInFrames],
- [0, 1, 1, 0]
- );
-
- const [animationData, setAnimationData] = useState(null);
- const [handle] = useState(() => delayRender());
-
- useEffect(() => {
- // Credits: https://lottiefiles.com/37789-scary-halloween-pumpkin
- fetch("https://assets2.lottiefiles.com/packages/lf20_c5izbrx1.json")
- .then((res) => res.json())
- .then((data) => {
- setAnimationData(data);
- continueRender(handle);
- });
- }, [handle]);
-
- if (!animationData) {
- return null;
- }
-
- return (
- <AbsoluteFill style={{ opacity: animationOpacity }}>
- <Lottie animationData={animationData} />
- </AbsoluteFill>
- );
-};
diff --git a/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar b/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar
index 3a25b51386..8d24fa64f8 100644
Binary files a/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar and b/packages/cloudrun/src/gcpInstaller/gcpInstaller.tar differ
diff --git a/packages/compositor-darwin-arm64/remotion b/packages/compositor-darwin-arm64/remotion
index 7d1ad7b88b..4ac6fd61a0 100755
Binary files a/packages/compositor-darwin-arm64/remotion and b/packages/compositor-darwin-arm64/remotion differ
diff --git a/packages/core/.npmignore b/packages/core/.npmignore
index 6c654afe20..9401dd8b18 100644
--- a/packages/core/.npmignore
+++ b/packages/core/.npmignore
@@ -7,9 +7,7 @@ tsconfig.tsbuildinfo
coverage
ensure-correct-version.js
.turbo
-tsconfig-cjs.json
tsconfig.json
-dist/tsconfig-cjs.tsbuildinfo
.prettierrc.js
dist/esm/**.d.ts
dist/esm/**/**.d.ts
diff --git a/packages/example/public/bigbuckbunny.aac b/packages/example/public/bigbuckbunny.aac
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/packages/player/.npmignore b/packages/player/.npmignore
index 67e620e186..c388c3d11b 100644
--- a/packages/player/.npmignore
+++ b/packages/player/.npmignore
@@ -6,7 +6,6 @@ tsconfig.tsbuildinfo
vitest.config.mts
*.tgz
.turbo
-dist/tsconfig-cjs.tsbuildinfo
dist/tsconfig.tsbuildinfo
tsconfig.json
ensure-correct-version.ts
diff --git a/packages/transitions/.gitignore b/packages/transitions/.gitignore
deleted file mode 100644
index d72310fd45..0000000000
--- a/packages/transitions/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-tsconfig-cjs.tsbuildinfo
diff --git a/packages/transitions/.npmignore b/packages/transitions/.npmignore
index 4e3c20a128..c52ec03425 100644
--- a/packages/transitions/.npmignore
+++ b/packages/transitions/.npmignore
@@ -6,7 +6,5 @@ tsconfig.tsbuildinfo
jest.config.js
*.tgz
.turbo
-tsconfig-cjs.tsbuildinfo
-tsconfig-cjs.json
tsconfig.json
.prettierrc.mjs
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 9e4185dc17..5f96fae325 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -106,6 +106,9 @@ importers:
astro:
specifier: ^2.0.14
version: 2.0.14(@types/[email protected])
+ lottie-web:
+ specifier: 5.12.2
+ version: 5.12.2
react:
specifier: ^18.1.0
version: 18.2.0
diff --git a/turbo.json b/turbo.json
index 711d4efd2f..7d6bd83c10 100644
--- a/turbo.json
+++ b/turbo.json
@@ -2,11 +2,14 @@
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
- "dependsOn": ["^build"],
+ "dependsOn": ["^build", "//#ts-build"],
"outputs": ["dist/esm/**"],
"outputMode": "new-only"
},
-
+ "//#ts-build": {
+ "outputs": ["packages/**/dist/**.js", "packages/**/dist/**.d.ts"],
+ "outputMode": "new-only"
+ },
"@remotion/example#build": {
"dependsOn": ["^build"],
"outputs": ["build/**", "dist/esm/**", "./node_modules/.cache/**"],