🎥 Make videos programmatically with React
Deno situation
Jonny Burger344b411ff630
diff --git a/package.json b/package.jsonindex 61b4c23616..70d46ba96b 100644--- a/package.json+++ b/package.json@@ -27,6 +27,7 @@"devDependencies": {"@jonny/eslint-config": "3.0.281","@types/bun": "1.1.10",+ "@types/deno": "2.0.0","@types/react": "18.3.1","@types/react-dom": "18.3.0","eslint": "8.56.0",diff --git a/packages/cli/package.json b/packages/cli/package.jsonindex 3df81f3bab..96a3aa8111 100644--- a/packages/cli/package.json+++ b/packages/cli/package.json@@ -9,7 +9,8 @@"sideEffects": false,"bin": {"remotion": "remotion-cli.js",- "remotionb": "remotionb-cli.js"+ "remotionb": "remotionb-cli.js",+ "remotiond": "remotiond-cli.js"},"scripts": {"formatting": "prettier src --check",diff --git a/packages/cli/remotiond-cli.js b/packages/cli/remotiond-cli.jsnew file mode 100755index 0000000000..f88919b56b--- /dev/null+++ b/packages/cli/remotiond-cli.js@@ -0,0 +1,11 @@+#!/usr/bin/env deno --allow-env --allow-read --allow-write --allow-net --allow-run --allow-sys+const {cli} = require('./dist/index');++// Just like "remotion", but it uses Bun+cli()+ .then(() => process.exit(0))+ .catch((err) => {+ // eslint-disable-next-line no-console+ console.error(err);+ process.exit(1);+ });diff --git a/packages/docs/docs/bun.mdx b/packages/docs/docs/bun.mdxindex a2fbe2fc50..a1cb6df9f4 100644--- a/packages/docs/docs/bun.mdx+++ b/packages/docs/docs/bun.mdx@@ -19,6 +19,15 @@ bun create videoThis command sets all scripts to use [`bunx remotionb`](/docs/cli/#using-bun) which will use Bun as a runtime.Change `remotionb` to `remotion` if you want to use Node.js as a runtime.+## Remotion CLI++If you want to run the Remotion CLI using Bun, **use `remotionb` instead of the `remotion` command**.+It doesn't matter if you prefix `remotionb` with `npx`, `bunx` or another runner command.++```+npx remotionb render+```+## As a runtimeAs of Bun 1.0.24 and Remotion 4.0.88, the following issues are known:@@ -33,3 +42,7 @@ Previous issues listed here have been resolved as of Bun 1.0.24.## For contributorsStart the example testbed using `bun run start-bun`.++## See also++- [Deno support](/docs/deno)diff --git a/packages/docs/docs/cli/cli.mdx b/packages/docs/docs/cli/cli.mdxindex 04908b56d2..bd56e53661 100644--- a/packages/docs/docs/cli/cli.mdx+++ b/packages/docs/docs/cli/cli.mdx@@ -42,6 +42,19 @@ To use Bun, replace `remotion` with `remotionb`.}```+### Using Deno<AvailableFrom v="4.0.227" />++Deno is not supported by Remotion.+If you like to experiment nonetheless, use `npx remotiond` to run the Deno version of the CLI.++```json title="package.json"+{+ "scripts": {+ "render": "remotiond render"+ }+}+```+## CommandsThe following commands are available - you can always run them using `npx remotion` or even without the `npx` prefix if you put the command inside an npm script.diff --git a/packages/docs/docs/deno.mdx b/packages/docs/docs/deno.mdxnew file mode 100644index 0000000000..eb6321799a--- /dev/null+++ b/packages/docs/docs/deno.mdx@@ -0,0 +1,30 @@+---+image: /generated/articles-docs-deno.png+id: deno+crumb: Runtime support+title: Deno support+---++As of right now, Remotion **does not support Deno**.+If you would like to experiment and run Remotion using Deno, you can do so.++For this, we created a way to run the Remotion CLI using Deno (available from v2.0.227):++```+npx remotiond+```++Use `remotiond` instead of the `remotion` command.+It does not matter if you use `npx` or something else as a task runner.++## Permission flags++Remotion does not work with Deno is not run with the following permissions:++```+--allow-env --allow-read --allow-write --allow-net --allow-run --allow-sys+```++## See also++- [Bun support](/docs/bun)diff --git a/packages/docs/package.json b/packages/docs/package.jsonindex c33d67a875..72748bcc37 100644--- a/packages/docs/package.json+++ b/packages/docs/package.json@@ -64,7 +64,7 @@"@remotion/transitions": "workspace:*","@remotion/media-parser": "workspace:*","@rive-app/canvas-advanced": "2.3.0",- "@shopify/react-native-skia": "^1.2.2",+ "@shopify/react-native-skia": "1.3.13","@swc/core": "^1.3.80","@types/uuid": "^8.3.4","chalk": "4.1.2",diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex 7275ad8039..b248ce23a1 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -999,6 +999,7 @@ module.exports = {'miscellaneous/linux-dependencies','gl-options','bun',+ 'deno','standalone','miscellaneous/emojis','media-fragments',diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.tsindex e3bf04d1e0..0b72a16553 100644--- a/packages/docs/src/data/articles.ts+++ b/packages/docs/src/data/articles.ts@@ -3606,6 +3606,13 @@ export const articles = [compId: 'articles-docs-license',crumb: null,},+ {+ id: 'deno',+ title: 'Deno support',+ relativePath: 'docs/deno.mdx',+ compId: 'articles-docs-deno',+ crumb: 'Runtime support',+ },{id: 'fonts',title: 'Using fonts',diff --git a/packages/docs/static/generated/articles-docs-deno.png b/packages/docs/static/generated/articles-docs-deno.pngnew file mode 100644index 0000000000..9f0a5032d5Binary files /dev/null and b/packages/docs/static/generated/articles-docs-deno.png differdiff --git a/packages/example/package.json b/packages/example/package.jsonindex 35d695d531..b67304bbbe 100644--- a/packages/example/package.json+++ b/packages/example/package.json@@ -62,7 +62,7 @@"@remotion/transitions": "workspace:*","@remotion/media-parser": "workspace:*","@remotion/zod-types": "workspace:*",- "@shopify/react-native-skia": "1.2.2",+ "@shopify/react-native-skia": "1.3.13","@types/express": "^4.17.11","@types/hls.js": "^0.13.3","@types/opentype.js": "^1.3.4",diff --git a/packages/skia/package.json b/packages/skia/package.jsonindex e8356301fd..2a23c3bda9 100644--- a/packages/skia/package.json+++ b/packages/skia/package.json@@ -31,6 +31,7 @@"devDependencies": {"@remotion/bundler": "workspace:*","@shopify/react-native-skia": "1.3.13",+ "canvaskit-wasm": "0.39.1","@types/react-native": "^0.69.2","react": "18.3.1","react-dom": "18.3.1",diff --git a/packages/studio-server/src/file-watcher.ts b/packages/studio-server/src/file-watcher.tsindex 6bda99e4f7..c0bcbe6da5 100644--- a/packages/studio-server/src/file-watcher.ts+++ b/packages/studio-server/src/file-watcher.ts@@ -27,6 +27,12 @@ export const installFileWatcher = ({}if (existsNow) {+ if (typeof Deno !== 'undefined') {+ // Deno always goes here, even if the file has not changed.+ // Don't support this for now.+ return;+ }+onChange('changed');}};diff --git a/packages/studio-server/src/start-studio.ts b/packages/studio-server/src/start-studio.tsindex e47530a1b6..4d8078fee5 100644--- a/packages/studio-server/src/start-studio.ts+++ b/packages/studio-server/src/start-studio.ts@@ -108,8 +108,10 @@ export const startStudio = async ({try {if (typeof Bun === 'undefined') {process.title = 'node (npx remotion studio)';+ } else if (typeof Deno === 'undefined') {+ process.title = 'deno (npx remotiond studio)';} else {- process.title = `bun (bunx remotion studio)`;+ process.title = `bun (bunx remotionb studio)`;}} catch (err) {}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 7fb1981aaa..4bc796774f 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -24,6 +24,9 @@ importers:'@types/bun':specifier: 1.1.10version: 1.1.10+ '@types/deno':+ specifier: 2.0.0+ version: 2.0.0'@types/react':specifier: 18.3.1version: 18.3.1@@ -604,8 +607,8 @@ importers:specifier: 2.3.0version: 2.3.0'@shopify/react-native-skia':- specifier: ^1.2.2- version: 1.2.2([email protected])+ specifier: 1.3.13+ version: 1.3.13([email protected])'@swc/core':specifier: ^1.3.80version: 1.3.80@@ -889,8 +892,8 @@ importers:specifier: workspace:*version: link:../zod-types'@shopify/react-native-skia':- specifier: 1.2.2- version: 1.2.2([email protected])+ specifier: 1.3.13+ version: 1.3.13([email protected])'@types/express':specifier: ^4.17.11version: 4.17.13@@ -1495,6 +1498,9 @@ importers:'@types/react-native':specifier: ^0.69.2version: 0.69.2+ canvaskit-wasm:+ specifier: 0.39.1+ version: 0.39.1react:specifier: 18.3.1version: 18.3.1@@ -11981,24 +11987,6 @@ packages:resolution: {integrity: sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==}dev: false- /@shopify/[email protected]([email protected]):- resolution: {integrity: sha512-YlDNJXTCstlOmyJxeQjaTaef8ACLuEPMDrSgEichQM3ELlWuU1HTSVbpXW2x4LbbEDPXwu/aF/16MUN8pzzcmA==}- hasBin: true- peerDependencies:- react: '>=18.0'- react-native: '>=0.64'- react-native-reanimated: '>=2.0.0'- peerDependenciesMeta:- react-native:- optional: true- react-native-reanimated:- optional: true- dependencies:- canvaskit-wasm: 0.39.1- react: 18.3.1- react-reconciler: 0.27.0([email protected])- dev: false-/@shopify/[email protected]([email protected]):resolution: {integrity: sha512-7LvSy+4nvJRGSDJi1fHVtbMxSDRnV2csTGB8RCcdFJsqQHxuIF05jM1GkrEbp/qCZHVPKKrjxbtHByERvx7OPQ==}hasBin: true@@ -13052,6 +13040,10 @@ packages:dependencies:'@types/ms': 0.7.31+ /@types/[email protected]:+ resolution: {integrity: sha512-O9/jRVlq93kqfkl4sYR5N7+Pz4ukzXVIbMnE/VgvpauNHsvjQ9iBVnJ3X0gAvMa2khcoFD8DSO7mQVCuiuDMPg==}+ dev: true+/@types/[email protected]:resolution: {integrity: sha512-yPEZ3z7EohrmOxbk/QTAa0yonMFkNkjnVXqbGb7D4rMr+F1dGQ8ZUFxXkyLLJuiICPejZ0AZE9Rrk9wUCczx4A==}