You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
remove legacy CommonJS after Electron ESM comes out
Remove the autostart parameter from tween.update(time, autostart). It makes the API less intuitive: for example if you call stop() and then the next animation frame calls update() and restarts the tween, it seems like stop() is not working. Better to make the APIs explicit: tweens will start and stop only when you tell them to, regardless if update is being called, and update does only one thing well (update the time).
This also allows us to eliminate confusion with onStart. Currently you call tween.start(), but onStart will be be fired until update() is called (f.e. in the next animation frame). Instead, we can make it be called immediately so that any state that should be initially set for the tween is guaranteed to be set, regardless of update().
Remove the TWEEN singleton, make Tweens start with no Group by default
docs: Teach people how to make a Tween and update it directly.
docs: Teach them that if they want to update multiple Tweens at once, they must make a Group.
This eliminates possible errors people will have when they clash tweens from two or more separate pieces of code (when using the current TWEEN)
explicitly managing each tween, or explicitly making Groups, will naturally lead to people writing componentized code with lowered chance of issues.
this leads to understanding of what is going on, rather than proper code being non-obvious up front
Remove relative values. It involves detecting strings for little convenience. People can just use math on their side with not much more effort.
Remove the dynamic-to feature. It isn't used often, and much internal complication.
Remove array of to-values, provide a replacement robust and decoupled Curve/Path API so we can animate along curves/paths (tracked in Curve/Path feature #721)
the array of to values adds quite some complexity muddied with the concept of a Tween and time animation.
When we use array of to values, we inadvertently destroy the meaning of an easing curve because the actual number output is no longer on that curve so the meaning is obscure.
the ability to choose interpolation method, f.e. bezier, which is useful for making a smooth curve out of the discrete points (f.e. "animate along a smooth path calculated from the discrete sharp values") is better in a separate more robust and flexible API, and we will simplify the job of Tween.
F.e. Three.js has Path and Curve tools
We can use a Tween to animate position along such path primitives.
Remove and replace .yoyo. Provide a reverse function that can return a new tween instance with reversed data.
Perhaps instead of removing, tween.yoyo() can be a shortcut for tween.chain(tween.reverse()). The main idea is that the yoyo state is not intertwined inside the regular tween state like it currently is. Instead, two separate tweens each have their own state. Replaced with Timeline.
This composes tweens independently of each other, so they don't need to have state remembering who they are chained to. This allows way more flexible new options (Timeline) like playing tweens in parallel, not just in sequence, etc.
improved testing.
run unit tests in browsers, because that's where Tween is used more often.
use @web/test-runner for this
Add a way to perform visual snapshot testing so that we may catch issues that unit tests may not, by snapshotting results of visual animations
Proposed (welcome to debate):
autostartparameter fromtween.update(time, autostart). It makes the API less intuitive: for example if you callstop()and then the next animation frame callsupdate()and restarts the tween, it seems likestop()is not working. Better to make the APIs explicit: tweens will start and stop only when you tell them to, regardless ifupdateis being called, and update does only one thing well (update the time).onStart. Currently you calltween.start(), butonStartwill be be fired untilupdate()is called (f.e. in the next animation frame). Instead, we can make it be called immediately so that any state that should be initially set for the tween is guaranteed to be set, regardless ofupdate().TWEENsingleton, makeTweens start with noGroupby defaultTweens at once, they must make aGroup.TWEEN)Curve/Pathfeature #721)tovalues adds quite some complexity muddied with the concept of a Tween and time animation.PathandCurvetools.yoyo. Provide areversefunction that can return a new tween instance with reversed data.Tween.yoyois deprecated in feat!: Timeline orchestration (sequence/parallel, nesting, labels) #713, replaced withTimelineorchestration.timeline.add(tween).add(tween.reverse())Perhaps instead of removing,Replaced withtween.yoyo()can be a shortcut fortween.chain(tween.reverse()). The main idea is that the yoyo state is not intertwined inside the regular tween state like it currently is. Instead, two separate tweens each have their own state.Timeline.tween.chainwith aTimelinefeature.Tween.chaindeprecated (done in feat!: Timeline orchestration (sequence/parallel, nesting, labels) #713, use a Timeline to sequence multiple Tweens)@web/test-runnerfor thisWhat else?