JavaScript/TypeScript animation engine
let in = TWEEN.Easing.Linear.In; in()
. by @soumen-pradhan in https://github.com/tweenjs/tween.js/pull/682
Full Changelog: https://github.com/tweenjs/tween.js/compare/v23.1.1...v23.1.2
Full Changelog: https://github.com/tweenjs/tween.js/compare/v23.1.0...v23.1.1
requestAnimationFrame
not firing for unfocused tabs) and then start firing again later, things now work (tweens can travel properly into the future)..delay()
are no longer valid (it was not a documented feature). See df8214619f671162034b9c881f81eafcdcbcad92 for migration example.Full Changelog: https://github.com/tweenjs/tween.js/compare/v22.0.0...v23.0.0
But! Some people might still be using it, so:
dist/index.cjs.js
was renamed to dist/index.cjs
. If you relied on dist/index.cjs.js
, update your paths and you'll be good to go.Full Changelog: https://github.com/tweenjs/tween.js/compare/v21.1.1...v22.0.0
exports
field so that types will be discoverable by TypeScript out of the box when importing tween.js into a TS project. Thanks @tazyong @jramstedt @keiya01!Full Changelog: https://github.com/tweenjs/tween.js/compare/v21.0.0...v21.1.1
exports
field was added to package.json
to make it compatible with ESM tools (to override the main
field currently pointing at a CommonJS file which doesn't make sense for ESM, but does for old Node.js). To be safe, we made this a major version because there's a chance it can break someone's app (f.e. if they imported from dist/ directly, that will now be blocked, and they would need to change import ... from '@tweenjs/tween.js/dist/tween.esm.js'
to import ... from '@tweenjs/tween.js'
). Thanks for this @christjt!You won't be able to outrun the fox!
tween.dynamic(true)
.
Warning When
dynamic
is set tofalse
, Tween makes a copy of the object passed intotween.to()
and will never modify it (hence updating the original object from the outside is not dynamic). Whendynamic
istrue
, Tween uses the original object as the source of values during animation (every update reads the values, hence they can be modified dynamically) but note that in dynamic mode, Tween will modify any interpolation arrays of the object passed intotween.to()
which may cause side-effects on any external code that may also rely on the same object. We've added two new dynamic_to examples. In each example, when dynamic is disabled, the fox cannot catch any rabbits. When dynamic is enabled, the rabbits have no chance!
tween.to()
now throws if it is called when a tween is started (even if paused). Call tween.stop()
first before setting a new .to()
value.Easing
object is no longer monkey-patchable, i.e. it has been frozen with Object.freeze()
. If you relied on patching Easing
, instead you should use alternative references for the easing functions you wish to use.From now on we will also keep the changelog updated with each release so that it is easy to see what changed and if any migration is needed for breaking changes.
The update to v18 was largely foundational: removal of bower and update of scripts and CI. It may break someone using Bower to install from git, hence the major bump.
src/Tween.js
to dist/tween.umd.js
for global <script>
tags. See the install guide.tween.start('+100')
tween.delay(100).start()
Reverted a breaking change from v17.3.0 to v17.3.2 (v17.3.1 was never released) that broke dynamic-to with array interpolation values.
In v17.6, objects passed to tween.to()
that have interpolation arrays will be modified as before v17.3.2, and those objects can be modified on the outside during animation to update interpolation values dynamically.
v18 contains the new behavior where the object passed into to()
is prototypically copied and never modified, but that prevents dynamic interpolation values during animations (the breaking change is suitable for the major version bump from 17 to 18).
A following major version will provide a new dynamic
option to the to()
method for choosing the desired behavior.