Skip to content

fix(lint): a scene may use Three.js or Lottie loaded by the parent document - #6961

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/lint-three-lottie-from-host
Nov 2, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/lint-three-lottie-from-host

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

check and lint reported missing_three_script (and would report missing_lottie_script) on a scene whose parent document already loads the library, so the only way to pass was to load it again inside the scene.

A sub-composition shares its parent's document at render time, so a library the parent loads is available to it. missing_gsap_script and the GSAP plugin rule already skip sub-compositions and <template> scenes; the Three.js and Lottie rules now follow the same rule through one helper in adapters.ts. A root composition with no library is still reported.

Why

Reported from 0.8.226: "a scene using a library loaded in the parent document should pass dependency detection; the checker required the library in the scene itself."

Test

New test, run for both rules: a <template> scene using THREE. or lottie.loadAnimation is not reported, whether or not it is flagged as a sub-composition. The existing tests that a root composition without the library is reported still pass. The whole lint package (1246 tests) passes 3 runs in a row.

fails without the fix: packages/lint/src/rules/adapters.test.ts › adapter rules › does not report missing_three_script in a scene, since the parent document loads the library
fails without the fix: packages/lint/src/rules/adapters.test.ts › adapter rules › does not report missing_lottie_script in a scene, since the parent document loads the library

Size

Under 100 changed lines.

@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.

Approving at 6def8ed5. I found no blockers.

  • Fails without the fix: I verified this. With adapters.ts reverted to the merge-base, both named cases fail (missing_three_script and missing_lottie_script). With the fix, the whole lint package passes: 23 files, 1246 tests.
  • Same rule as GSAP: inheritsLibrariesFromHost uses the same condition as missing_gsap_script, missing_gsap_plugin and missing_timeline_registry: isSubComposition, or a source that starts with <template. Project lint passes isSubComposition: true for every compositions/*.html. A root composition is still reported.
  • Non-blocking:
    • The same trade-off as GSAP applies. A scene that uses Three.js or Lottie is no longer flagged, even when the parent document doesn't load the library either. A later improvement could check, at the project level, whether the host loads the library a scene relies on.
    • The <template>/sub-composition condition now appears in four rules. A shared helper in context/utils would keep them in sync.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 112 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)

Unstable (2)

  • seqplainkeys-none-center-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo false, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true
  • seqplainkeys-none-px-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 6b008cb Nov 2, 2026
82 checks passed
@miguel-heygen
miguel-heygen deleted the fix/lint-three-lottie-from-host branch November 2, 2026 00:10
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