Skip to content

docs(concepts): clarify what can and can't be a variable#970

Merged
jrusso1020 merged 2 commits into
mainfrom
05-19-docs_concepts_clarify_what_can_and_can_t_be_a_variable
May 20, 2026
Merged

docs(concepts): clarify what can and can't be a variable#970
jrusso1020 merged 2 commits into
mainfrom
05-19-docs_concepts_clarify_what_can_and_can_t_be_a_variable

Conversation

@jrusso1020
Copy link
Copy Markdown
Collaborator

@jrusso1020 jrusso1020 commented May 19, 2026

What

Adds two new sections to docs/concepts/variables.mdx clarifying what can and can't be a variable in HyperFrames compositions:

  • What can be a variable — frames variables as two layers (the five declared types + the string-URL escape hatch for media assets), with a worked product-card example, a <Note> explaining the post-script DOM probe, and per-element notes for <img> / <video> / <audio>.
  • What can't be a variable — table mapping inputs that look variable-shaped but live elsewhere (duration → data-duration, dimensions → data-width/data-height, fps → CLI flag, format/codec/quality → CLI flags, cross-composition values → data-variable-values), plus a paragraph on the runtime-values-vs-authoring-inputs rule.

Also adds a one-paragraph cross-link from docs/deploy/aws-lambda.mdx to the existing templates-on-lambda.mdx guide, and a short ## Variables (inputProps) section in docs/deploy/migrating-to-hyperframes-lambda.mdx that points readers at the Remotion mapping table already in the templates guide.

Why

The existing concepts/variables.mdx documents the five declared types (string, number, color, boolean, enum) but doesn't address the most common reader question: "can I parameterize images, videos, and audio?" The answer — "yes, by passing URLs through string variables" — is idiomatic but undiscoverable from the current doc. Readers either ask, or figure it out from templates-on-lambda.mdx, or never find it.

This PR makes the URL-via-string-variable pattern first-class in the concept doc, and gives the deploy docs a shallow pointer so Lambda adopters don't have to read the concept doc to find the matching surface.

How

  • Two new sections in docs/concepts/variables.mdx placed between Variable Types and Reading Variables at Runtime so the dual-layer point (declared types + URL escape hatch) sits adjacent to the type list.
  • The media example uses realistic product-card content (no foo/bar) per DOCS_GUIDELINES.md.
  • The <video> / <audio> bullets explicitly call out that timing attributes (data-start, data-duration, data-track-index, data-has-audio) live on the element directly — the probe phase at packages/producer/src/services/htmlCompiler.ts (discoverMediaFromBrowser) scans video[data-start], audio[data-start] after the composition script runs and reads the resolved src, so a variable-assigned src is picked up without extra wiring.
  • The Lambda + migration notes both deep-link into templates-on-lambda.mdx (#working-with-large-variables, #migrating-from-remotion-lambda-inputprops) instead of duplicating its content.

Doc-only PR. No code changes, no behavior changes.

Test plan

  • Unit tests added/updated — N/A (doc-only)
  • Manual testing performed — diff verified to touch only the three intended .mdx files (+66 lines, -0); anchors used in cross-links (#variable-types, #per-instance-overrides-sub-compositions, #working-with-large-variables, #migrating-from-remotion-lambda-inputprops) follow Mintlify's slug convention and match existing headings.
  • Documentation updated (if applicable) — this PR is the documentation update.

🤖 Generated with Claude Code

@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 19, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hyperframes 🟢 Ready View Preview May 19, 2026, 8:36 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content is excellent — the "what can / can't be a variable" framing is clear, examples are realistic, and the table of non-variable inputs is a nice touch.

Blocking: 3 broken links failing the "Validate docs" CI check. All three link to /deploy/templates-on-lambda which doesn't exist:

  1. docs/concepts/variables.mdx/deploy/templates-on-lambda#working-with-large-variables
  2. docs/deploy/aws-lambda.mdx/deploy/templates-on-lambda
  3. docs/deploy/migrating-to-hyperframes-lambda.mdx/deploy/templates-on-lambda#migrating-from-remotion-lambda-inputprops

Either that page needs to be created in this PR, or the links should point to an existing page. Once the links are fixed I'm happy to approve.

Copy link
Copy Markdown
Collaborator

@vanceingalls vanceingalls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additive review — Miguel already raised the broken-links blocker; this review confirms it with the structural diagnosis and a couple of nits.

Strengths

  • docs/concepts/variables.mdx:60 — the <Note> ("the runtime probes the DOM after your composition script runs") is accurate: packages/producer/src/services/htmlCompiler.ts:1006 (discoverMediaFromBrowser) does query video[data-start], audio[data-start] after the page script runs (line 1021) and reads data-duration off the live DOM (line 1030). Code-and-doc agreement is good.
  • docs/concepts/variables.mdx:81-105 — the "do you need to vary duration too?" sub-section catches the actual follow-up question readers will have and answers it with a working snippet. Concrete > abstract; this is the part doc-skimmers will actually retain.
  • docs/concepts/variables.mdx:108-118 — the "What can't be a variable" table is the highest-leverage addition. The CLI-flag-vs-variable distinction is exactly the failure mode that drove the doc gap.

Blocker — broken /deploy/templates-on-lambda links across all three files (as @miguel-heygen noted)

Validate docs is red (run 26123583408, npx mint broken-links → "found 3 broken links in 3 files"):

  • docs/concepts/variables.mdx:68/deploy/templates-on-lambda#working-with-large-variables
  • docs/deploy/aws-lambda.mdx:14/deploy/templates-on-lambda
  • docs/deploy/migrating-to-hyperframes-lambda.mdx:53/deploy/templates-on-lambda#migrating-from-remotion-lambda-inputprops

The structural cause is a stack-slicing issue, not a typo. templates-on-lambda.mdx is being introduced by PR #968, which sits at the top of a 5-PR feature stack (#962#964#966#967#968) — all still open. PR #970 was sliced off that stack and re-based onto main, but the cross-links it added assume the target page already exists on main. It doesn't, and won't until the entire feature stack lands.

Two viable fixes:

  1. Land the feature stack first, then re-target #970. Cleanest: #970's value is the conceptual variables clarification, which is independent of the Lambda feature. Hold this PR until #968 has merged, then the cross-links resolve naturally on main. blocker.
  2. Remove the forward-references from #970 and re-add them in #968. If you want #970 to land independently of the feature stack: drop the three templates-on-lambda links here. The "What can / can't be a variable" content stands on its own. Then #968 (which already adds the target page) can include the inbound links to concepts/variables.mdx. blocker.

Either way, the current PR cannot ship with Validate docs red — that check exists precisely to prevent dangling doc links from landing on main.

Important — PR-body test plan claim doesn't match CI state

The PR body says: "Manual testing performed — diff verified to touch only the three intended .mdx files… anchors used in cross-links follow Mintlify's slug convention and match existing headings." That second clause is the failed assertion — the cross-link targets do NOT match any existing heading because the target file doesn't exist yet. The Mintlify slug-convention check is necessary but not sufficient; the file existence check is the one that failed. Worth noting in the next iteration: Validate docs running locally before push would have caught this. important.

Nit — anchor inside variables.mdx itself looks good

The intra-doc link at variables.mdx:117 to #per-instance-overrides-sub-compositions resolves correctly against the existing ## Per-instance Overrides (Sub-compositions) heading at line 152. Mintlify's slug conversion (lowercase, parens stripped, hyphenated) matches. No action needed; mentioning so the next reviewer doesn't re-flag it.

Verdict: REQUEST CHANGES
Reasoning: Required Validate docs CI check is red on three broken cross-references to a doc page that doesn't yet exist on main. Content is otherwise strong and the standalone "What can / can't be a variable" framing is exactly what the gap needed — but the PR can't land in this slicing.

Review by Vai

@jrusso1020 jrusso1020 changed the base branch from main to graphite-base/970 May 19, 2026 20:48
@jrusso1020 jrusso1020 force-pushed the 05-19-docs_concepts_clarify_what_can_and_can_t_be_a_variable branch from b6aeac1 to bdbbc1b Compare May 19, 2026 20:48
@jrusso1020 jrusso1020 changed the base branch from graphite-base/970 to 05-19-docs_deploy_templates-on-lambda_guide May 19, 2026 20:49
@jrusso1020 jrusso1020 changed the base branch from 05-19-docs_deploy_templates-on-lambda_guide to graphite-base/970 May 19, 2026 21:13
@jrusso1020 jrusso1020 force-pushed the graphite-base/970 branch from 0dbb53e to 480d0cf Compare May 20, 2026 00:20
@jrusso1020 jrusso1020 force-pushed the 05-19-docs_concepts_clarify_what_can_and_can_t_be_a_variable branch from bdbbc1b to 15a065d Compare May 20, 2026 00:20
@jrusso1020 jrusso1020 changed the base branch from graphite-base/970 to main May 20, 2026 00:20
@jrusso1020
Copy link
Copy Markdown
Collaborator Author

Restacked onto main now that #968 (templates-on-lambda guide) and #976 (variables validation) have merged. The three cross-links now resolve against the page that exists on main:

  • /deploy/templates-on-lambda#working-with-large-variables## Working with large variables (line 230 of templates-on-lambda.mdx)
  • /deploy/templates-on-lambda → file exists at docs/deploy/templates-on-lambda.mdx
  • /deploy/templates-on-lambda#migrating-from-remotion-lambda-inputprops## Migrating from @remotion/lambda inputProps (line 299)

Verified locally with npx mint broken-links from docs/success no broken links found. Will add that to my pre-push step going forward (the test-plan claim about anchor verification missed the file-existence case).

PR is now base=main, +92 lines across the three intended .mdx files. @miguel-heygen @vanceingalls re-requesting review.

Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken cross-links to /deploy/templates-on-lambda now resolve — #968 landed that page. Validate docs CI is green. Content was already reviewed and solid on the first pass.

Approved.

Copy link
Copy Markdown
Collaborator

@vanceingalls vanceingalls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at HEAD 15a065d3. Flipping CHANGES_REQUESTED → APPROVE — prior blocker is structurally resolved by the upstream stack merging.

Status of prior findings

  • Blocker (3 broken /deploy/templates-on-lambda cross-links) → ADDRESSED. docs/deploy/templates-on-lambda.mdx now exists on main (landed via #968 at sha efe2dc14). Three anchors verified against current main headings: ## Working with large variables (line 230), ## Migrating from @remotion/lambda inputProps (line 299), plus the bare file link.
  • Important (test-plan claim about anchors-vs-file-existence) → no body update on this nit, but irrelevant now that both checks would pass.

CI status (verbatim)

Docs / Validate docs workflow did NOT re-run on this HEAD — workflow_runs filtered by SHA returns []. Likely a Graphite-rebase trigger quirk (path-filtered workflow on a force-pushed branch sometimes skips). Same workflow runs SUCCESS on sibling branches around the same time. Mintlify Deployment SUCCESS on this HEAD.

Recommend an empty commit to actually re-fire Validate docs before merge if you want the gate to leave a green trace on this SHA — substantively the validation would pass given the file + anchors are verifiably present on main.

Verdict: APPROVE.

Re-review by Vai

@jrusso1020 jrusso1020 merged commit 8080e1f into main May 20, 2026
37 of 43 checks passed
@jrusso1020 jrusso1020 deleted the 05-19-docs_concepts_clarify_what_can_and_can_t_be_a_variable branch May 20, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants