Skip to content

feat: animations — $animate + ngAnimate (CSS & JS drivers) (spec 041) - #47

Merged
Mgrdich merged 4 commits into
masterfrom
animation
Jul 9, 2026
Merged

Mgrdich merged 4 commits into
masterfrom
animation

Conversation

@Mgrdich

@Mgrdich Mgrdich commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the Animations roadmap item (spec 041): the classic AngularJS ngAnimate experience, adapted to this project's ESM-first conventions. An always-on core $animate façade + synchronous instant engine ships on ng; the opt-in ngAnimate module upgrades it to animated behavior via the DI last-wins $$animateQueue override seam — apps that don't animate pay nothing, and existing synchronous behavior is byte-identical.

  • Two-layer engine: core instant $$animateQueue (synchronous, zero behavior change) vs. the ngAnimate engine (digest-end flush, cancel/join matrix, startup grace). DI last-wins makes the upgrade automatic.
  • Directive parity set: ng-if / ng-repeat / ng-switch / ng-include / ng-view route DOM ops through enter/leave/move; ng-show / ng-hide / ng-class family / forms state classes route through addClass/removeClass/setClass.
  • CSS driver: parity ng-enter/-active + <cls>-add/-active class conventions, ng-animate marker, transition + keyframe duration detection, injectable computeStyle/raf/timer seams.
  • JS animations: $animateProvider.register + the .animation(name, fn) module DSL (shared registry), class-gated, throw-routed.
  • Controls & extras: completion promises (pre-handled rejections), enabled() (global/per-element) + classNameFilter + startup grace, staggering, ng-animate-children, $animate.on/off listeners, and the full interruption/cleanup matrix.
  • Error channel: adds the 14th '$animate' EXCEPTION_HANDLER_CAUSES token (append-only).

Test plan

  • pnpm lint — clean
  • pnpm format:check — clean
  • pnpm typecheck — clean
  • pnpm build — succeeds; ./animate subpath emits ESM + CJS + .d.ts
  • pnpm test — 244 files, 4948 passing (21 pre-existing skips)
  • animate module coverage — 97% stmts / 93% branches / 96% funcs / 97% lines (≥90% threshold)
  • CI green on 94f8f2a (raised the runner's Node heap to fix a type-aware-ESLint OOM)

Docs

  • src/animate/README.md — worked CSS + JS examples, digest/promise/cancellation contracts, documented divergences.
  • context/diagrams/animate.md (+ index link + structural-test guard) — collaborator graph and call order.
  • CLAUDE.md — ./animate module-table row, new invariants, and "Where to look when…" rows.

🤖 Generated with Claude Code

Mgrdich and others added 4 commits July 8, 2026 10:16
Opt-in ngAnimate module upgrading an always-on core $animate façade +
instant engine via the DI last-wins $$animateQueue seam. Wires the full
directive parity set (ng-if/repeat/switch/include/view + ng-show/hide/
class family + forms state classes) through enter/leave/move/addClass/
removeClass/setClass. Ships the CSS transition/keyframe driver, JS
animations via $animateProvider.register + the .animation module DSL,
completion promises (pre-handled rejections), enabled()/classNameFilter/
startup grace, staggering, ng-animate-children, $animate.on/off listeners,
and the full cancel/join + cleanup interruption matrix. Adds the 14th
'$animate' EXCEPTION_HANDLER_CAUSES token.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The typed ESLint pass grew past the default Node heap and OOMs (exit 134)
on the CI runner. Mirror the existing build script's approach — invoke
eslint via `node --max-old-space-size=8192` so lint self-bumps its heap
locally and in CI without a NODE_OPTIONS wrapper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Revert the package.json lint-script change (invoking eslint through a
hardcoded node_modules path is brittle) in favor of a job-level
NODE_OPTIONS=--max-old-space-size=8192 in the CI workflow. Keeps `lint`
as plain `eslint src/` and also covers the equally heap-heavy typecheck
and test steps that OOM (exit 134) on the runner's default heap.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Mgrdich
Mgrdich merged commit eb0d7b6 into master Jul 9, 2026
2 checks passed
@Mgrdich
Mgrdich deleted the animation branch July 9, 2026 15:36
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