v4.4.0
Added 10
- A fourth argument prevTween is now passed to function-based value callbacks, providing access to the previous sibling tween's computed end value
- New scrambleText() function-based value to animate text with a character-by-character scramble/reveal effect
- New grid: true auto-grid mode that computes a 2D layout from element positions or JS object coordinates
- The from parameter now accepts [x, y] normalized coordinate arrays (0 to 1) for precise grid origin control
- New priority parameter to control execution order within the engine tick loop
- Adjacent axis properties are now grouped into CSS shorthand for shorter transform strings
- Inline transform parsing rewritten to properly handle multi-argument CSS functions and nested calc() expressions
- createLayout() now accepts an id parameter
- globals is now exported from the main module entry point
- forEachChildren, addChild, removeChild helpers are now exported from utils
Changed 7
- Transforms now follow a fixed render order (perspective > translate > rotate > scale > skew) regardless of the order they are defined in animation parameters
- The third argument of function-based value callbacks changed from total (Number) to targets (Array)
- The stagger callback signature changed so the third argument is now the targets array instead of the total count
- Render loop performance improved by extracting inline closures in tick() and render() to module-scope functions
- Tween composition is now resolved before computing to/from/duration/delay values
- Type annotation for splitText() and TextSplitter target parameter widened from HTMLElement to Element
- Each tween now pre-computes and stores its end value at construction time
Fixed 7
- revert() now restores object properties and DOM attributes to their original pre-animation values, in addition to CSS styles and transforms
- Fix getOriginalAnimatableValue not storing the original inline value for object properties and DOM attributes
- Fix chaining in keyframe arrays and timelines producing incorrect intermediate shapes in morphTo
- Fix accessing non-existent chainable methods throwing an error instead of returning undefined
- Fix splitText addEffect() returning undefined instead of this when the effect argument is not a function
- Fix scroll-controlled layout animations not properly calling onComplete and onPause callbacks
- Fix _startTime not being preserved when reconstructing tracked animations, causing timing jumps on effect refresh
Removed 2
- matrix and matrix3d can no longer be animated directly
- DevTools integration (AnimeJSDevTools) removed
From anime
Breaking Changes
- Transforms
- Transforms now follow a fixed render order (
perspective>translate>rotate>scale>skew), regardless of the order they are defined in animation parameters:// Before: scale rendered first because it was defined first animate(el, { scale: 2, translateX: 100 }) // → scale(2) translateX(100px) // After: order is always fixed animate(el, { scale: 2, translateX: 100 }) // → translate(100px, 0px) scale(2) matrixandmatrix3dcan no longer be animated directly (they are still preserved when read from inline styles and can be set using transform: 'matrix(...)')
- Transforms now follow a fixed render order (
- Function-based values
- The third argument of function-based value callbacks changed from
total(Number) totargets(Array). To migrate, replacetotalwithtargets.length:// Before translateX: (target, index, total) => total * 10 // After translateX: (target, index, targets) => targets.length * 10 - A fourth argument
prevTweenis now passed to function-based value callbacks, providing access to the previous sibling tween's computed end value for the same target and property.
- The third argument of function-based value callbacks changed from
- Stagger
- The stagger callback signature changed to match function-based values: the third argument is now the
targetsarray instead of the total count:// Before delay: stagger(100, { use: (target, i, total) => total - i }) // After delay: stagger(100, { use: (target, i, targets) => targets.length - i })
- The stagger callback signature changed to match function-based values: the third argument is now the
New Features
- scrambleText
- New
scrambleText()function-based value to animate text with a character-by-character scramble/reveal effect (learn more: https://animejs.com/documentation/text/scrambletext)
- New
- Stagger
- New
grid: trueauto-grid mode that computes a 2D layout from element positions or JS object coordinates ({x, y}) instead of requiring explicit[columns, rows]dimensions - The
fromparameter now accepts[x, y]normalized coordinate arrays (0 to 1) for precise grid origin control
- New
- Timer / Animation / Timeline
- New
priorityparameter to control execution order within the engine tick loop
- New
- Transforms
- Adjacent axis properties are now grouped into CSS shorthand for shorter transform strings:
translateX+translateY→translate(x, y)translateX+translateY+translateZ→translate3d(x, y, z)scaleX+scaleY→scale(x, y)scaleX+scaleY+scaleZ→scale3d(x, y, z)
- Inline transform parsing rewritten to properly handle multi-argument CSS functions (
translate(x, y),scale3d(x, y, z)) and nestedcalc()expressions
- Adjacent axis properties are now grouped into CSS shorthand for shorter transform strings:
- Layout
createLayout()now accepts anidparameter
- Exports
globalsis now exported from the main module entry pointforEachChildren,addChild,removeChildhelpers are now exported fromutils
Bug Fixes and improvements
- JS Animation
revert()now restores object properties and DOM attributes to their original pre-animation values, in addition to CSS styles and transforms (previously only CSS styles and transforms were reverted, leaving animated object props and attributes at their last animated value). The publiccleanInlineStyles()utility keeps its original behavior and only clears inline styles and transforms.- Fix
getOriginalAnimatableValuenot storing the original inline value for object properties and DOM attributes, preventing proper revert
- morphTo
- Fix chaining in keyframe arrays and timelines producing incorrect intermediate shapes
- Chainable utils
- Fix accessing non-existent chainable methods throwing an error instead of returning
undefined
- Fix accessing non-existent chainable methods throwing an error instead of returning
- splitText
- Fix
addEffect()returningundefinedinstead ofthiswhen the effect argument is not a function
- Fix
- Layout
- Fix scroll-controlled layout animations not properly calling
onCompleteandonPausecallbacks
- Fix scroll-controlled layout animations not properly calling
- keepTime
- Fix
_startTimenot being preserved when reconstructing tracked animations, causing timing jumps on effect refresh
- Fix
Changes
- Engine
- DevTools integration (
AnimeJSDevTools) removed - Render loop performance: inline closures in
tick()andrender()extracted to module-scope functions to avoid allocation every frame - Tween composition is now resolved before computing
to/from/duration/delayvalues, so the previous sibling tween is available to function-based value callbacks
- DevTools integration (
- splitText
- Type annotation for
splitText()andTextSplittertarget parameter widened fromHTMLElementtoElement
- Type annotation for
- Tween value chaining
- Each tween now pre-computes and stores its end value at construction time
- Enables function-based values like
morphToandscrambleTextto read the previous tween's end value when used in keyframe arrays or timelines
- morphTo
- Now properly chains in keyframe arrays and timelines by reading the previous tween's computed end value instead of mutating the target element with a Symbol
- Editor integration (👀)
- New
globals.editorhook system allowing an external editor to interceptanimate()andcreateTimeline()calls
- New