Skip to content

fix: address code review findings#3

Merged
Xerrion merged 1 commit into
masterfrom
fix/code-review-fixes
Feb 22, 2026
Merged

fix: address code review findings#3
Xerrion merged 1 commit into
masterfrom
fix/code-review-fixes

Conversation

@Xerrion

@Xerrion Xerrion commented Feb 22, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses all findings from comprehensive code review.

Bug Fixes

  • B1 (CRITICAL): Renamed keyframe field from time to progress — aligns code with README documentation. Consumers following the README would have created broken animations.
  • B2 (HIGH): Validate duration > 0 in Animate() — negative duration caused infinite broken animations.
  • B3 (HIGH): Pre-resolve CubicBezier easing functions at animation start — eliminates per-tick closure allocation for zoom animations.
  • B4 (MEDIUM): Save and restore original frame:GetScale() / frame:GetAlpha()Stop() now correctly restores pre-animation values instead of hardcoded 1.0.
  • B5 (MEDIUM): Document single-point-anchor requirement.
  • B6 (LOW): Unroll InterpolateProperties — removes temp table + ipairs iterator allocation per OnUpdate tick.

Robustness

  • P2: Enhanced RegisterAnimation validation — checks keyframe ordering, 0.0/1.0 boundaries, defaultDuration > 0.
  • P3: Deferred onFinished callbacks — all completion state is cleaned up before any callbacks fire, preventing one erroring callback from blocking others.
  • P4: Clamp frame scale to minimum 0.001 to prevent SetScale(0) errors from custom animations.

Breaking Change

Keyframe definitions now use progress field instead of time. This aligns with the README documentation. Since v1.0.0 has no external consumers yet, this is safe to ship.

Library minor version bumped: 1 → 2

- B1: Rename keyframe field 'time' to 'progress' for API consistency
- B2: Validate animation duration > 0 in Animate()
- B3: Pre-resolve CubicBezier easing functions at animation start
- B4: Save and restore original frame scale/alpha
- B5: Document single-point-anchor requirement
- B6: Unroll InterpolateProperties to eliminate per-tick table allocation
- P2: Enhanced keyframe validation (ordering, boundaries, duration)
- P3: Deferred onFinished callbacks after all completions processed
- P4: Clamp scale minimum to 0.001 to prevent SetScale(0) errors

BREAKING CHANGE: Keyframe definitions now use 'progress' field instead of 'time'
@Xerrion
Xerrion merged commit 1067e6d into master Feb 22, 2026
1 check passed
@Xerrion
Xerrion deleted the fix/code-review-fixes branch February 22, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant