npm animejs 4.2.0
v4.2.0

15 hours ago

Looking at the structure of the second file, I'll reformat the first file to match that cleaner format:

Breaking Changes

  • Utils
    • Remove interpolate() (use the simplified lerp() instead)
    • Remove the clock parameter from lerp() (use the framerate dependent damping function damp() instead)
    • Setting a CSS variable using utils.set() now computes the variable value instead of setting the var name. To set the variable name without conversion, use a function-based value (x: () => var(--value)) or use the native element.style.setProperty('--value')
  • Easings
    • linear(), irregular(), steps() and cubicBezier() have been removed from the core and must now be imported separately

New Features

  • API
    • All modules can now be imported individually with subpaths:
import { animate } from 'animejs/animation';
import { createTimer } from 'animejs/timer';
import { createTimeline } from 'animejs/timeline';
import { createAnimatable } from 'animejs/animatable';
import { createDraggable } from 'animejs/draggable';
import { createScope } from 'animejs/scope';
import { engine } from 'animejs/engine';
import * as events from 'animejs/events';
import * as easings from 'animejs/easings';
import * as utils from 'animejs/utils';
import * as svg from 'animejs/svg';
import * as text from 'animejs/text';
import * as waapi from 'animejs/waapi';
  • Spring
    • Add bounce parameter to control the strength of the spring
    • Add duration parameter to define the perceived duration of the spring
    • Add onComplete callback called when the spring currentTime hits the perceived duration
    • Support for over-damped springs with stiffness values below 30 (previously these values had no effect)
  • WAAPI
    • waapi.animate() built-in eases are now on par with the JS animate() method, plus all native WAAPI easing parameters
    • Add persist parameter to control whether the animation should be canceled on finish
  • JS Animation
    • Add support for CSS variable values (e.g., animate(target, { x: 'var(--x, 100px)' }))
  • Utils
    • Add createSeededRandom() to generate pre-seeded pseudo-random utility functions
  • Docs

Bug Fixes

  • Draggable
    • Allow touch dragging within Shadow DOM (#1067)
    • Fix draggable getting stuck while dragging near the origin of the initial grab
  • Animation
    • Fix animation.revert() not properly reverting multi-target animations styles when targets have different starting style values
    • Fix inline styles with hyphens (e.g., border-radius, stroke-width) not being properly reverted
  • WAAPI
    • Fix animation.cancel() not properly committing styles before canceling
    • Fix animation.revert() not properly reverting multi-target animation styles and not overriding newly added styles
    • Fix scroll-controlled WAAPI animations being disconnected after completing once
    • Fix staggered animations with reversed: true not updating on play
  • Timeline
    • Fix tl.call() not being fired in some cases (#1088)

Changes

  • Utils
    • stagger() has been moved to /utils but still available globally via import { stagger } from 'animejs'
  • WAAPI
    • waapi.convertEase() values are now rounded to 4 decimals (previously no rounding)
  • Spring
    • mass minimum value is now clamped to 1
    • stiffness minimum allowed value is now 0
    • damping minimum allowed value is now 0
  • Easings
    • Ease Back default overshoot value is now 1.7 (previously 1.70158)
  • Types
    • Add @types/node dependency for type checking (#1069)
  • Build
    • Simplify build scripts: build, dev, dev:test, test:browser, test:node, open:examples

Deprecated

  • Text
    • text.split() deprecated, use splitText() or text.splitText() instead
  • Spring
    • createSpring() deprecated, use spring() instead

Don't miss a new animejs release

NewReleases is sending notifications on new releases.