Skip to content

🎥 Make videos programmatically with React

contributing to web renderer

Jonny Burgeraf9e0d1e2a37
diff --git a/packages/docs/docs/contributing/web-renderer.mdx b/packages/docs/docs/contributing/web-renderer.mdx
new file mode 100644
index 0000000000..49119241b4
--- /dev/null
+++ b/packages/docs/docs/contributing/web-renderer.mdx
@@ -0,0 +1,70 @@
+---
+image: /generated/articles-docs-contributing-web-renderer.png
+title: Contributing to client-side rendering
+sidebar_label: Web renderer
+crumb: Contributing
+---
+
+The code for `@remotion/web-renderer` is located in the `packages/web-renderer` folder.
+Before running any of these commands, do the [main setup](/docs/contributing).
+
+## Developing in watch mode
+
+To develop the web renderer, you can use the watch mode:
+
+```sh title="In ./"
+bun run watchwebrenderer
+```
+
+This will automatically rebuild the package when you make changes to the code.
+
+## Running tests
+
+This package uses test-driven development. Changes are tested using [Vitest Browser Mode](https://vitest.dev/guide/browser/why.html).
+
+First you need to install the browser dependencies:
+
+```sh title="In packages/web-renderer"
+bunx playwright install --with-deps
+```
+
+Then you can run the tests:
+
+```sh
+bun run testwebrenderer
+```
+
+To only run a specific test file, you can specify the file name:
+
+```sh
+bunx vitest src/test/video.test.tsx
+```
+
+To only run a specific test, you can change `test()` to `test.only()`.
+
+To only run the test in a specific browser, you can specify the browser name:
+
+```sh
+bunx vitest --browser chromium
+bunx vitest --browser firefox
+bunx vitest --browser webkit
+```
+
+## Enabling the Studio Render Button
+
+Set the following to `true` in `packages/studio/src/helpers/show-browser-rendering.ts`:
+
+```ts
+export const SHOW_BROWSER_RENDERING = true;
+```
+
+Now, in [`packages/example`](/docs/contributing/#testing-your-changes), and in any template, you will see a "Render on web" button.
+
+Don't commit this, the CI will fail.
+
+Eventually, this flag will be removed and the button will be enabled by default.
+If this happened and this instruction remains here, please send a PR to remove it :)
+
+## See also
+
+- [Contributing to Remotion](/docs/contributing)
diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.ts
index bdbf75640d..d85d1d5fb4 100644
--- a/packages/docs/sidebars.ts
+++ b/packages/docs/sidebars.ts
@@ -1363,6 +1363,7 @@ const sidebars: SidebarsConfig = {
'contributing/formatting',
'contributing/bounty',
'contributing/rust',
+ 'contributing/web-renderer',
'contributing/presentation',
'authoring-packages',
'contributing/ineligible',
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 974baba9b2..9983f40406 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -1214,6 +1214,15 @@ export const articles = [
noAi: false,
slug: 'contributing/rust',
},
+ {
+ id: 'contributing/web-renderer',
+ title: 'Contributing to client-side rendering',
+ relativePath: 'docs/contributing/web-renderer.mdx',
+ compId: 'articles-docs-contributing-web-renderer',
+ crumb: 'Contributing',
+ noAi: false,
+ slug: 'contributing/web-renderer',
+ },
{
id: 'cors-issues',
title: 'How to debug any CORS issue',
@@ -4339,15 +4348,6 @@ export const articles = [
noAi: false,
slug: 'preload/preload',
},
- {
- id: 'prereleases',
- title: 'Testing prereleases',
- relativePath: 'docs/prereleases.mdx',
- compId: 'articles-docs-prereleases',
- crumb: 'Only the brave',
- noAi: false,
- slug: 'prereleases',
- },
{
id: 'presigned-urls',
title: 'Upload with a presigned URL',
diff --git a/packages/docs/static/generated/articles-docs-contributing-web-renderer.png b/packages/docs/static/generated/articles-docs-contributing-web-renderer.png
new file mode 100644
index 0000000000..462feda57a
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-contributing-web-renderer.png differ