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
Animation
class to improve code organization and maintainability. TheAnimation
class has been moved fromrive.ts
to 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.ts
underjs/src/animation/
to house theAnimation
class.index.ts
file in thejs/src/animation/
directory to export theAnimation
class.rive.ts
to use the newly createdAnimation
module.Animation
class definition fromrive.ts
.💡 Motivation
The primary motivation for this refactor is to enhance code organization. By moving the
Animation
class to its own module, we achieve:Animation
class.🔍 Detailed Changes
js/src/animation/Animation.ts
Animation
class is now defined in this file.js/src/animation/index.ts
Animation
class fromAnimation.ts
.js/src/rive.ts
Animation
class from the newjs/src/animation/
module.Animation
class definition that was previously embedded in this file.🧪 Testing
Animation
class continue to pass.Animation
class 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
Animation
class should now refer to the new module underjs/src/animation/
.Animation
class are made in the newAnimation.ts
file.Thank you for reviewing this pull request. Looking forward to your feedback and approval!