refactor(animation): refactor Animation class to a separate module#356
refactor(animation): refactor Animation class to a separate module#356samavati wants to merge 1 commit intorive-app:masterfrom
Conversation
- Moved the `Animation` class from `rive.ts` to a new file `Animation.ts` under `js/src/animation/`. - Added a new `index.ts` file in the `js/src/animation/` directory to export the `Animation` class. - Updated imports in `rive.ts` to use the newly created `Animation` module. This refactor improves code organization by separating the `Animation` class into its own module, making the codebase more modular and easier to maintain.
|
Hi @zplata, I haven't heard back about this pull request yet and I'm eager to get your feedback on the refactoring changes to the Animation class. Specifically, I'd love to know your thoughts on separating the Animation class into a separate module for better development. Thanks for your time! |
zplata
left a comment
There was a problem hiding this comment.
Thanks for the detailed description here! Great to see some movement on cleaning up the big rive.ts file.
I think this change looks safe to me, but will defer to @HayesGordon and @bodymovin on helping get this change in if they agree too!
|
Hi @samavati, we'll get this merged in. Thank you for your contribution and great description. Just a note that I will need to co-author this with you. We'll generate a new commit from this PR to our upstream MONO repository, which will then be available in the public repo. Once that is out, I'll close this PR. |
Brings in: #356 Also fixes warning when building: ``` Should not import the named export 'version' (imported as 'packageData') from default-exporting module (only default export is available soon) ``` Diffs= 6f8c518ff chore: community contribution wasm refactor nested module (#7457) Co-authored-by: Ehsan Samavati <samaavaati@gmail.com> Co-authored-by: Gordon <pggordonhayes@gmail.com>
|
This has been merged as part of: fa1319e Thanks again for the contribution. |
@HayesGordon Thank you |
Pull Request Description
📜 Description
This pull request refactors the
Animationclass to improve code organization and maintainability. TheAnimationclass has been moved fromrive.tsto a new module underjs/src/animation/. This change encapsulates the animation logic within its own module, making the codebase more modular and easier to navigate.🛠️ Changes
Animation.tsunderjs/src/animation/to house theAnimationclass.index.tsfile in thejs/src/animation/directory to export theAnimationclass.rive.tsto use the newly createdAnimationmodule.Animationclass definition fromrive.ts.💡 Motivation
The primary motivation for this refactor is to enhance code organization. By moving the
Animationclass to its own module, we achieve:Animationclass.🔍 Detailed Changes
js/src/animation/Animation.tsAnimationclass is now defined in this file.js/src/animation/index.tsAnimationclass fromAnimation.ts.js/src/rive.tsAnimationclass from the newjs/src/animation/module.Animationclass definition that was previously embedded in this file.🧪 Testing
Animationclass continue to pass.Animationclass works seamlessly with the rest of the codebase after the refactor.📈 Impact
This refactor should have no functional impact on the existing features. It is purely an internal code organization improvement.
📝 Notes
Animationclass should now refer to the new module underjs/src/animation/.Animationclass are made in the newAnimation.tsfile.Thank you for reviewing this pull request. Looking forward to your feedback and approval!