refactor(animation): refactor Animation class to a separate module #356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!