Skip to content

Make AnimationManager tree-shakable#840

Open
jfboeve wants to merge 2 commits into
mainfrom
feat/treeshake-animation-manager
Open

Make AnimationManager tree-shakable#840
jfboeve wants to merge 2 commits into
mainfrom
feat/treeshake-animation-manager

Conversation

@jfboeve

@jfboeve jfboeve commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

This pull request refactors the animation system to introduce a new AnimationManager interface and a concrete implementation called CoreAnimationManager. It standardizes how animations are created and managed, updates the API for animating nodes, and ensures consistent usage across the codebase and tests. The changes also update type signatures and dependency injection for improved flexibility and testability.

Animation System Refactor

  • Introduced a new AnimationManager interface and implemented it as CoreAnimationManager, clarifying animation management responsibilities and exposing a consistent API (animate, animateNode, and update). (src/core/animations/AnimationManager.ts) [1] [2]
  • Updated all usages of the old createAnimation method to the new animate method in the codebase and tests, ensuring consistency. (src/core/animations/AnimationManager.test.ts, src/core/animations/CoreAnimationController.test.ts) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

CoreNode Animation API Changes

  • Removed the animate method from CoreNode and replaced it with a property that delegates to stage.animationManager.animateNode, aligning with the new animation manager API. (src/core/CoreNode.ts) [1] [2]
  • Cleaned up unused imports related to animation settings and controllers in CoreNode. (src/core/CoreNode.ts)

Renderer and Stage Integration

  • Updated Stage and renderer initialization to accept an animationManager instance via options, improving dependency injection and flexibility. (src/core/Stage.ts, examples/index.ts) [1] [2] [3] [4] [5] [6] [7]

Type and Dependency Updates

  • Updated type imports and usages to reference CoreAnimationManager where appropriate, ensuring type safety and clarity throughout the codebase. (src/core/animations/CoreAnimationController.ts) [1] [2]

These changes collectively modernize the animation system, improve code clarity, and make the animation API more flexible and consistent. This also allows you to implement your own animation manager.

@jfboeve jfboeve requested a review from wouterlucas July 15, 2026 10:51
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