Skip to content

docs(skills): fix anime.js v3 syntax in v4 adapter guidance - #3064

Merged
miguel-heygen merged 2 commits into
heygen-com:mainfrom
youngeuibae:fix/animejs-v4-adapter-docs
Aug 16, 2026
Merged

docs(skills): fix anime.js v3 syntax in v4 adapter guidance#3064
miguel-heygen merged 2 commits into
heygen-com:mainfrom
youngeuibae:fix/animejs-v4-adapter-docs

Conversation

@youngeuibae

@youngeuibae youngeuibae commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Problem

The Anime.js guidance loaded a v4 bundle but taught the incompatible v3 API:

anime({ targets: ".mark", easing: "easeOutExpo" });
anime.timeline().add({ targets: ".mark" });

Anime.js v4 exposes a namespace object instead: anime.animate(targets, params) and anime.createTimeline(). It also renamed easing to ease, changed ease names, and moved timeline targets to the first add() argument. v4 also has no anime.running, so the documented auto-discovery fallback cannot discover v4 instances.

Changes

  • Rewrite the adapter and skill examples for the v4 namespace API.
  • Require explicit window.__hfAnime registration and document deterministic v4 usage.
  • Correct the keyframe reference's timeline example.
  • Align the public and adapter-local anime global types with v4 while retaining optional v3 running discovery for compatibility.
  • Add a source-level regression test that rejects executable v3 call sites and pins both global type shapes.
  • Regenerate skills-manifest.json.

The producer fixtures remain on animejs@4.0.2/lib/anime.iife.min.js; that URL still resolves and those fixtures already use the correct v4 createTimeline() API.

Attribution

The documentation fix remains authored by @youngeuibae in the first commit. The branch was rebased onto current main, and the maintainer follow-up only adds the missing type alignment and regression guard.

Verification

  • Published animejs@4.0.2 and animejs@4.5.0 exports inspected: both expose animate / createTimeline, neither exposes a callable default or running.
  • node --test scripts/animejs-v4-guidance.test.mjs — 5/5 pass.
  • vitest run --environment jsdom packages/core/src/runtime/adapters/animejs.test.ts — 15/15 pass.
  • Pinned oxfmt check and oxlint on changed source/test files — clean.
  • bun packages/cli/scripts/gen-skills-manifest.ts --check — in sync.

Full workspace typechecking is left to CI because this isolated review worktree intentionally has no installed/generated workspace dependency tree.

Fixes #3293

@youngeuibae
youngeuibae force-pushed the fix/animejs-v4-adapter-docs branch from a3b4689 to 3e98e2b Compare August 6, 2026 08:24
@youngeuibae youngeuibae changed the title docs(skills): fix anime.js adapter guidance for v4 docs(skills): fix anime.js v3 syntax in v4 adapter guidance Aug 6, 2026
youngeuibae and others added 2 commits August 16, 2026 17:29
The animejs adapter docs teach v3 syntax against a v4 build, so the examples
cannot run as written: every v4 bundle assigns a *namespace object* to the
global `anime`, making v3's `anime({ targets })` call form a TypeError. `easing:`
is now `ease:`, ease names lost their `ease` prefix, and `timeline.add()` takes
`(targets, parameters, position)`.

- Rewrite `skills/hyperframes-animation/adapters/animejs.md` for v4:
  `anime.animate()` / `anime.createTimeline()`, `ease:` names, targets-first
  `add()`, position shorthands, and a note that the producer fixtures pin
  4.0.2 (`lib/`) while 4.1+ moved bundles to `dist/bundles/`.
- Fix the same v3 `anime.timeline({ targets })` snippet in
  `skills/hyperframes-keyframes/references/keyframe-patterns.md`.
- Stop advertising `anime.running` auto-discovery as a safety net. No v4 build
  exports `running` (checked 4.0.2 and 4.5.0), so `discover()` returns
  immediately and any instance a composition forgets to push onto
  `window.__hfAnime` is silently never seeked. Marked v3-only/inert in the
  skill page and the adapter docstring; explicit registration is now stated
  as mandatory.
- Add render-safety notes the page lacked: `createSeededRandom()` as the
  deterministic replacement for `Math.random()`, and why
  `autoplay: onScroll(...)`, `createDraggable`, and pointer-driven
  `createAnimatable` cannot work under headless seek rendering.
- Regenerate skills-manifest.json.

Runtime behaviour is unchanged: the `packages/core` edit is comment-only, and
the seek path already works on v4 (registered instances expose
seek/pause/play). The now-dead `anime.running` branch in `discover()` is left
in place — it is guarded and try/caught, and removing it is a behaviour change
that belongs in its own PR.
@miguel-heygen
miguel-heygen force-pushed the fix/animejs-v4-adapter-docs branch from 3e98e2b to 37fab5a Compare August 16, 2026 17:37

@miguel-heygen miguel-heygen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at 37fab5a7fdbdba1e4754ed3ab0ac76c9a4f8a0a1.

The v4 API claims match the published 4.0.2 and 4.5.0 packages and the official v4 API shape. Executable examples now use animate(targets, params) / createTimeline(), explicit adapter registration is accurately required, the public and local global types no longer teach v3, and the new source contract test protects both the examples and type shapes. The contributor's authored commit remains intact after the rebase.

No code-level blockers found. Required CI should remain the merge gate.

Verdict: APPROVE
Reasoning: The issue is reproduced, the fix covers every repository guidance/type surface found, regression coverage exercises the failure mode, and targeted tests plus manifest/format/lint checks pass.

— Magi

@miguel-heygen
miguel-heygen merged commit 67edb01 into heygen-com:main Aug 16, 2026
58 of 89 checks passed
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.

anime.js adapter and skill document v3 API while loading the v4 CDN bundle

2 participants