-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(TS): animation #8297
chore(TS): animation #8297
Conversation
type fixes, mergeWithDefaults for animate ran npm audit
# Conflicts: # src/constants.ts # src/typedefs.ts # src/util/anim_ease.ts # src/util/animate.ts # src/util/animate_color.ts # src/util/lang_object.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments, nothing major
Checkout package-lock.json
from master (upstream probably) so it is removed from the PR diff
And run prettier
src/util/animate_color.ts
Outdated
} | ||
}, | ||
onChange: (current, valuePerc, timePerc) => | ||
onChange?.( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we slipped in a bunch of optional chaining operator, but those are not supported before chrome 80.
We didn't fully decide yet which browsers are we going to support, in this case better leave the code as it was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove the chaining ops, but typescript compiles it down into unchained anyway so I don't get why we should remove them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know that's a problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because typescript compile down a lot of stuff that we don't let it do.
For now we let the browsersupport of rollup compile the stuff for us.
I couldn't get Typescript to choose browser granularity in chosing what to compile to, and at the end what you have to support is browsers.
there are at least 3 behavor change i would like to see reverted, and it seems to me you added a |
The only ACTUAL behavior change is that the currentState of a color animation is now a TColorAlphaSource instead of a color string. See my other comments about the target stuff. I can change it but the problem is its SUPER hard to generify the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typed animation registry to avoid confusion
it's weird that when I comment and review the comments are displayed out of context
src/util/animate_color.ts
Outdated
} | ||
}, | ||
onChange: (current, valuePerc, timePerc) => | ||
onChange?.( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know that's a problem
I think the 3 behavor change are: removal of ...restOptions Adding in pr description |
TODO: will modify this in another PR
I went ahead and removed animate color stuff. I'm putting that in a new PR where I'll clean it up. |
@ShaMan123 @asturur Any outstanding issues with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the status of the isMany typing?
I would like that in this PR
In order to pass tests:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor patch color
updated from master
updated description
seems good to go
@asturur let's merge this one |
We had a list of priorities i m going in order. |
Ok fixed merge conflicts that is step 1 |
notes for me since this is a long review
|
this build 1.6KB extra, not sure why, they usually reduce, but not an issue |
Will take me tomorrow to finish reading this. |
if (!propIsColor && typeof to === 'string') { | ||
// check for things like +=50 | ||
// which should animate so that the thing moves by 50 units in the positive direction | ||
to = to.includes('=') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we dump this?
Point taken |
I think this PR is good, thanks both.
I have noticed there are type tests, and i see they can't run for now. is that correct? |
didn't get what you meant. The rest I agree.
Correct. #8394 handles the test framework. |
Co-authored-by: kristpregracke <kpregracke@redfoundry.com> Co-authored-by: ShaMan123 <shacharnen@gmail.com> Co-authored-by: Shachar <34343793+ShaMan123@users.noreply.github.com> Co-authored-by: Andrea Bogazzi <andreabogazzi79@gmail.com>
Co-authored-by: kristpregracke <kpregracke@redfoundry.com> Co-authored-by: ShaMan123 <shacharnen@gmail.com> Co-authored-by: Shachar <34343793+ShaMan123@users.noreply.github.com> Co-authored-by: Andrea Bogazzi <andreabogazzi79@gmail.com>
Changes
AnimationBase
contains all the logiccalculate
that returns the current value of the animationanimateColor(from ,to ,duration, options)
=>animateColor(options)
colorEasing
integrated into default easing ofColorAnimation
byValue
optionthere was a conflict happening in the cases:
fromSource
as it has become redundantreturn animation instance from animate instead of a cancel function and remove
findAnimationByXXX
fromAnimationRegistry
Gist
@asturur there are too many threads in this PR. All are pretty much stale accept #8297 (review) that I would like you to comment on.
Proposals
AnimationBase
extend Observable and fire state events?animate
accept also a color animation options object