Skip to content

Commit

Permalink
Merge pull request #4445 from remotion-dev/deno-2
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyBurger authored Nov 1, 2024
2 parents 1c51c25 + 344b411 commit dd877b8
Show file tree
Hide file tree
Showing 15 changed files with 104 additions and 26 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions packages/cli/remotiond-cli.js
Original file line number Diff line number Diff line change
@@ -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);
});
13 changes: 13 additions & 0 deletions packages/docs/docs/bun.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ bun create video
This 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 runtime

As of Bun 1.0.24 and Remotion 4.0.88, the following issues are known:
Expand All @@ -33,3 +42,7 @@ Previous issues listed here have been resolved as of Bun 1.0.24.
## For contributors

Start the example testbed using `bun run start-bun`.

## See also

- [Deno support](/docs/deno)
13 changes: 13 additions & 0 deletions packages/docs/docs/cli/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
```

## Commands

The 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.
Expand Down
30 changes: 30 additions & 0 deletions packages/docs/docs/deno.mdx
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ module.exports = {
'miscellaneous/linux-dependencies',
'gl-options',
'bun',
'deno',
'standalone',
'miscellaneous/emojis',
'media-fragments',
Expand Down
7 changes: 7 additions & 0 deletions packages/docs/src/data/articles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/skia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions packages/studio-server/src/file-watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};
Expand Down
4 changes: 3 additions & 1 deletion packages/studio-server/src/start-studio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand Down
36 changes: 14 additions & 22 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dd877b8

Please sign in to comment.