Contributing to client-side rendering
The code for @remotion/web-renderer is located in the packages/web-renderer folder.
Before running any of these commands, do the main setup.
Developing in watch mode
To develop the web renderer, you can use the watch mode:
In ./shbun 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.
First you need to install the browser dependencies:
In packages/web-renderershbunx playwright install --with-deps
Then you can run the tests:
shbun run testwebrenderer
To only run a specific test file, you can specify the file name:
shbunx 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:
shbunx vitest --browser chromiumbunx vitest --browser firefoxbunx vitest --browser webkit
Enabling the Studio Render Button
Set the following to true in packages/studio/src/helpers/show-browser-rendering.ts:
tsexport const SHOW_BROWSER_RENDERING = true;
Now, in packages/example, 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 :)