Docs: Add Element Studio previews and asset rendering - #9062
Merged
Conversation
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — this PR introduces a canonical Element registry, registers Element compositions for rendering, adds a local render/upload script for full-resolution PNG posters and muted H.264 MP4 previews, and updates contributor docs.
- Add
element-registry.ts— canonical type and definitions for all Elements, plus helpers for composition IDs and public preview URLs. - Refactor
ElementPage.tsx— accepts a singledefinitionprop and delegates preview wrapping to a sharedElementPreviewCompositioncomponent. - Add
ElementPreviewComposition.tsx— shared live preview and asset-rendering wrapper with a render-safe neutral canvas. - Register Element compositions in
Root.tsx— renders every registry entry inside a dedicatedelements<Folder>. - Add
render-element-previews.ts— bundles the docs Remotion root, renders each Element poster and full-duration video, and uploads to stableremotion.mediaR2 paths only when--uploadis passed. - Extend
elements.test.ts— validates registry coverage, integer render metadata, even yuv420p-compatible dimensions, stable composition IDs, and deterministic preview URLs. - Update contributor docs —
elements-template/index.mdxandsubmit-an-element.mdxnow require a registry entry, an explicit poster frame, and local preview rendering.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the latest commit normalizes test-discovered Element paths to forward slashes so registry slug matching is platform-independent.
findElementsinsrc/test/elements.test.ts— now derivesnamefrom a localrelativeNameconstant and splits onpath.sepbefore joining with/. This keeps the existingelementDefinitions.find((entry) => entry.slug === element.name)comparison reliable on Windows and avoids the redundantpath.relativecall.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #8908. Closes #9064.
Summary
elements<Folder>remotion.mediaR2 paths with size and content-type verificationGenerated previews
The render command successfully generated and visually verified all current Elements:
All videos were verified as H.264,
yuv420p, with no audio stream. Generated binaries are ignored and are not committed.The R2 upload mode was not run locally because R2 credentials were unavailable. It can be run with:
Validation
bun run buildbun run stylecheckbunx turbo run lint test --filter=docs --no-update-notifiercd packages/docs && bun test src/test/elements.test.tscd packages/docs && bun run render-element-previewsffprobevalidation of codec, pixel format, dimensions, duration, and audio streams