Repository navigation
docs(variables): say what can be a variable, including a video or sound per account - #7530
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
There was a problem hiding this comment.
Request changes at acc4ba67. One blocker in the main example.
Blocker: the welcome-clip example doesn't swap the clip as written. The HTML is labelled compositions/welcome.html, but the command is a bare npx hyperframes render, which renders index.html (render.ts, --composition). That leaves two possible setups, and neither works:
welcome.htmlisn't mounted fromindex.html, so it isn't rendered at all.welcome.htmlis mounted as a sub-composition.stashInstanceVariables(compositionLoader.ts) builds that scope from its declared defaults plus the host'sdata-variable-valuesonly.--variablesreaches it only as CSS custom properties, sodata-var-src="welcomeClip"keeps the default. The #7529 pre-pass runs on the entry HTML before inlining, so it doesn't bind it either. The "length and sound follow the clip" paragraph then doesn't hold.
Fix either way:
- Label the block
index.html, which matches the page's own "Override top-level values from the CLI". - Or add
--composition compositions/welcome.htmlto the command.
Nits:
- The URL-gate bullet says "a relative path or an
http,https, orblobURL". Root-absolute paths (/clips/a.mp4) also pass, becauseisSafeMediaUrlaccepts any value with no scheme. Maybe "a path, or an http/https/blob URL". - The new
## What can be a variablesits inside "Advanced: declare the approved inputs". It turns the existing### Say what a slot meansinto a child of it, so the outline reads oddly.
Everything else in the limits list matches the code: VAR_SRC_TAGS, a data: video being dropped with a warning, and nested data-variable-values mounts resolved by the browser.
|
Fixed at 8fd91d5: the example block is now labelled |
There was a problem hiding this comment.
Approve at 8fd91d50. No blockers. All three points from the earlier review are fixed, and nothing else changed:
- The example is now
index.html. A barenpx hyperframes renderuses it, and--variables welcomeClipgoes through the top-level scope that #7529 binds before measuring. The "length and sound follow the clip" paragraph is now true for this setup. - The URL bullet now says "a path", which matches
isSafeMediaUrl(any value with no scheme passes). ### What can be a variablenow sits under "Advanced: declare the approved inputs", so the outline reads cleanly. The cross-link to#swap-in-a-video-or-a-soundmatches the heading.
The length/sound paragraph depends on #7529, which I approved at 364baab6. Keep the stated order: merge #7529 first.
What
The variables page now says what can be a variable. It gains a plain-words table of the seven kinds, and a "Swap in a video or a sound" section: a link declared as a
stringand bound to a<video>or<audio>withdata-var-src, the per-account example (render the same saved project once per account with--variables), and the limits.Why
The page listed the kinds in a table of uses and never said that video and sound are links bound to a media element, what the render does with them, or where it stops.
Notes
docs/concepts/variables.mdx. No new page; the existing variables page already holds the kinds table, so the section sits beside it.data-var-src(VAR_SRC_TAGS,applyVariableBindings.ts), the URL gate (isSafeMediaUrl,compositionVariables.ts), nested mounts with their owndata-variable-valuesresolved by the browser.