Skip to content

fix(lint): a timeline registered in a local script file counts as registered - #6829

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/lint-external-scripts
Oct 30, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/lint-external-scripts

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What

hyperframes check and lint now read a project's local <script src> files. A timeline registered in animation.js (or any local script file) no longer gets missing_timeline_registry ("Missing window.__timelines registration"), and the script rules see that file's code as they would an inline <script>.

Why

A feedback report said the author "had to inline the root timeline because external animation.js was not discovered by static lint". The same registration passed inline and failed from a file: lint read only inline <script> text, so the error fired for a project that renders fine.

Related work

missing_data_no_timeline already stops when any <script src> is present, because it cannot see files; this reads the files instead, the way linked stylesheets are already read (externalStyles).

How

lintProject finds local <script src> files in the root and each sub-composition, resolved beside the file or from the project root like stylesheets, and passes them as externalScripts. They join the lint context's scripts (so the script rules analyse them) and missing_timeline_registry also checks their text. Remote URLs, data: and blob: sources, minified files (*.min.js) and files over 1 MB are not read, so a vendored library is not linted as authored code.

Size

88 changed lines (84 added, 4 removed) in 5 files.

Test plan

  • project.test.ts: a root whose animation.js registers the timeline gets no missing_timeline_registry, and one whose animation.js registers nothing still gets it
  • the whole lint package 1233/1233 and the CLI lintProject and lint suites 81/81, three runs in a row
  • oxfmt, oxlint, tsc and the comment ratchet clean

fails without the fix: project.test.ts > local script files > counts a timeline registered in a local script file

fails without the fix (module files): project.test.ts > local script files > reads a module script file as a module fails when the syntax rule reads the tag from script.raw again (a type="module" file starting with import gets a false invalid_inline_script_syntax).

What I measured

Built CLI on Linux, lint --json: a root with <script src="animation.js"> registering the timeline reported missing_timeline_registry before this change, and the same code inline reported nothing. The built CLI after the change was not run; the lint package and CLI lint suites above cover it.

What I did NOT execute

The reporter's project, Studio's per-file lint (it does not go through lintProject), and rules that now analyse a local script file for the first time on a large authored script.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head ec36ea1a

A timeline in a <script type="module" src> file still fails check. The missing_timeline_registry error is replaced by a false invalid_inline_script_syntax error. ↓ inline

Scope

Read the whole diff and every rule that reads ctx.scripts and checks attrs/raw. Ran the lint package locally (1233/1233). I probed master and this head with three fixtures: a classic animation.js (fixed), an inline module with import (clean on both), and a type="module" src file with import (master: missing_timeline_registry; this head: invalid_inline_script_syntax at main.js:1). The fails without the fix: line is present and checks out. CI was still running at review time.

Comment thread packages/lint/src/context.ts Resolved
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 102 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

@miguel-heygen
miguel-heygen force-pushed the fix/lint-external-scripts branch from ec36ea1 to b1889ad Compare October 30, 2026 16:47

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES — 1 resolved, 0 open, 1 new · ec36ea1a → b1889ada; oxfmt --check fails on this head (CI Format, Windows preflight, preview-regression all red from it).

Comment thread packages/lint/src/rules/core.ts Resolved

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: APPROVE — 1 resolved, 0 open, 0 new · b1889ada → f32b817f; all CI green at this head.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 0708f6c Oct 30, 2026
81 checks passed
@miguel-heygen
miguel-heygen deleted the fix/lint-external-scripts branch October 30, 2026 19:18
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 6, 2026
…view

Adopts heygen-com#7250 (SVG stroke drawing is not a dead stretch), heygen-com#7248
(contract check reads a timeline registered in a local script), heygen-com#7252
(comma-list selectors hidden by authored CSS), heygen-com#7238 (snapshot and
preview show a clip on the render frame), heygen-com#7237 (stalled cloud upload
retries) and heygen-com#7251 (per-scene SVG id namespacing), with prerequisite
heygen-com#6829. Defers heygen-com#7246 (needs the delivery limiter from heygen-com#6940) and heygen-com#7232
(needs the WebKit decode-first pipeline), with conditions in the
ledger. Watermark advances to b108f85.

Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant