-
Notifications
You must be signed in to change notification settings - Fork 131
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
Adding Animation #21
Comments
Here's my thoughts on animation: Simple callbacks are good; it forces the user to implement their animation logic. Since there are so many ways of doing animation (tweening, integration, hybrid approach, etc) it should not be baked into the framework. Some real-world challenges we have faced, and which tend to be difficult with most frameworks:
|
If we were able to manually animate out elements using
This is a tough one I seen using "sheet" modals. When it's sliding off the page to hide, the content inside of it might have been removed by the diff, so the sheet is empty. From what I can tell it's mostly just entering/leaving animations that are the main problem for UI. If we were to say we weren't going to try and cover every animation use-case and focus on animations for UI it might be easier too. |
Animation = state change middleware |
They are interactive. They are user targetes language. They dont make components unusable. Especially with the completely unstandardised rangr of dependencies. They are often dirty and make no sence in the dom tree. However.. The catch is that they are high level interactions on really low level details. You wrote a component DOM selector. I think all animations should go in a compiled CSS-like tween file. Another thought, tweening can benefit from using a generator instead of a tween fn. |
How about, streams. :) Jsdaily email: |
Anyways, I think we might like these |
Sorry: fsm event was the wrong link. Sorry for shotgunning my thoughts a little. https://github.com/paldepind/flyd |
Hi @anthonyshort how are you! What is the status of this feature? |
What's the status on this? A done callback would be perfect, at least while a better solution pops up. |
The callback is a difficult one to implement, as you need to block any other UI updates from happening at the same time. We wouldn't be able to run the diff again until it all of the unmount callbacks are done. I think the solution would be to do something like React Motion, a meta-component controls whether a child node exists or not. Here's a presentation on the various ways it can be handled with React https://speakerdeck.com/vjeux/react-rally-animated-react-performance-toolbox. It's possible to implement the data-bound solution at the end with Deku now using |
Looks like an interesting approach. Are you considering making this a part of Deku, or a plugin? Any chance I could get an example of the data-bound approach? Thanks. |
react-bootstrap are using Transition component in collapse component. final resault work so good. Maybe deku can get idea from this components. |
WIP
We've been thinking about how animation should work with components. Animation properties are basically another form of state, but it's cumbersome to store that stuff in state. Things like x and y position are a different kind of state. We'd like to be able to include it all in the serialized state too.
We could implement animation in a couple of ways...
Here's an example using an API similar to Impluse
This would start another
requestAnimationFrame
loop on the component separate from the virtual DOM loop. This lets us avoid needing to do virtual tree diffing just to update some element animated properties.If we provide a
done
method tobeforeUnmount
we could easily animate an element out:This is kind of long, but it's not overly abstract on purpose. We could make this into a plugin, or you could just use another library entirely. We'd just need to make sure whatever library it was played nicely with the updates from the virtual DOM.
The text was updated successfully, but these errors were encountered: