v0.5.0: Luau migration, quaternion CFrame springs, declarative hooks#17
Merged
Conversation
…tions - Added TransitionFragment component for managing child transitions. - Implemented useAnimation hook for handling animations. - Created useBindings hook for subscribing to binding updates. - Developed useGroupAnimation and useSequenceAnimation hooks for grouped and sequenced animations. - Introduced useSpring and useTween hooks for spring and tween animations. - Added useTransparencyModifier hook for dynamic transparency adjustments. - Created LinearValue utility for handling various value types in animations. - Implemented SpringValue utility for managing spring physics in animations. - Updated init files to reflect new structure and imports. - Added comprehensive tests for animation hooks and components. - Bumped version to 0.5.0 in wally.toml.
- Add Utility/Quaternion with fromMatrix + canonicalize helpers, and switch LinearValue's CFrame path to lerp via quaternion components instead of raw rotation matrix entries. This produces correct shortest-arc rotation interpolation for spring/tween CFrame values. - Extract the RenderStepped pooling logic shared by SpringValue and Tween into Utility/PooledConnection, keyed by the source signal so multiple consumers share a single connection. - Introduce src/Types.luau as the single source of truth for shared types (LinearValueType, SpringProperties, TweenProperties, Binding, TransparencyValue, etc.) and update call sites to import from it. - Convert the public surface from PascalCase methods + metatables to camelCase methods on plain tables (Play/Stop/SetGoal → play/stop/ setGoal, etc.) across LinearValue, SpringValue, Base/Spring/Tween animations, and the hooks that drive them. - Drop Rect, Ray, Region3, and Region3int16 from LinearValueType — the new constructor/deconstructor table only covers types we actually interpolate. - Add test/CFrameValues.story.luau exercising under/critically/ overdamped springs plus a LinearValue lerp on CFrames.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
.luafile to.luauand switched the toolchain fromaftman.tomltorokit.toml, with a.luaurcfor the new Luau-native config.require(script.Parent.Foo)to string-based requires (e.g.require("@self/Hooks/useFoo")), matching the modern Luau / Lune workflow.Utility/Quaternionmodule (fromMatrix+canonicalize) drives CFrame lerping inLinearValue, so spring/tween CFrame animations now follow the shortest-arc rotation instead of interpolating raw rotation-matrix entries. Addedtest/CFrameValues.story.luauexercising under/critically/overdamped CFrame springs alongside aLinearValueCFrame lerp.useSpringValue/useTweenValuehooks — declarative counterparts touseSpringanduseTween(closes Addition of a declarative API alongside the currently imperative one #14). Passtarget(andspeed/damper) directly in the hook props and the animation re-targets on prop change — noupdate({ target = … })calls needed. The imperative hooks are unchanged; pick whichever fits the callsite.startis mount-only so re-renders smoothly retarget from the current value instead of snapping back.useTransparencyModifierhook — new hook for composing transparency values (numbers,NumberSequences, and bindings) through a multiplier, with epsilon clamping at the 0/1 endpoints.PooledConnectionutility — extracted theRenderSteppedpooling logic previously duplicated inSpringValueandTweenintoUtility/PooledConnection, keyed by source signal so multiple consumers share a single connection. Fixes the multi-instance render loop leak (closes [BUG] RenderStep name collision #16): the pooled connection now correctly disconnects when its callback set drains, so running multiplereact-flowinstances (or repeatedly mounting/unmounting) no longer leaves orphaned render-step subscribers running in the background.Typesmodule — moved shared type definitions (LinearValueType,SpringProperties,TweenProperties,Binding,TransparencyValue, etc.) intosrc/Types.luauso animations, utilities, and hooks all reference the same source of truth.LinearValue,SpringValue,Spring,Tween,BaseAnimation) moved from PascalCase metatable methods to camelCase methods on plain tables (Play/Stop/SetGoal→play/stop/setGoal, etc.). Hooks updated to match. Note: this is a breaking change for callers using the value/animation classes directly.LinearValueTypetrimmed — droppedRect,Ray,Region3, andRegion3int16; the new constructor/deconstructor table only covers types we actually interpolate.wally.tomlto0.5.0.