Repository navigation
6.28.0
This release adds global view models, font binding, and blob binding to the Swift Concurrency API, alongside performance improvements for animation, complex rigs, and virtualized lists.
Added
Apple runtime
- Added global view model support to the concurrency API.
- Use
Artboard.createStateMachine(binding:globals:)to supply a main instance and named global instances during creation. - Use
StateMachine.bindViewModelInstances(main:globals:)to update bindings later. - Use
File.getGlobalViewModelNames()to discover available global names. - Retain the instances you need to observe or modify; the state machine does not expose getters for bound instances.
- Use
- Added automatic binding of authored default view model instances during state-machine creation.
- Use
Artboard.createStateMachine(),Rive(file:), orRive(file:artboard:)when no programmatic instance access is needed.
- Use
- Added font data binding.
- Use
FontPropertyandViewModelInstance.setValue(of:to:)to assign a decodedFont, or passnilto clear it. - Assigned fonts remain retained until replaced, cleared, or the view model instance is released.
- Use
- Added blob data binding.
- Use
Worker.decodeBlob(from:)to create aBlob. - Use
BlobPropertyandViewModelInstance.setValue(of:to:)to assign it, replace it, or clear it withnil. - Assigned blobs remain retained until replaced, cleared, or the view model instance is released.
- Use
- Added
.blobto file asset metadata.- Use
File.getAssets()to inspect the file’s assets and identify blob entries.
- Use
Core runtime
- Added authored word-breaking modes for text:
breakWord,normal, andbreakAll. Existing files retain their previous wrapping behavior. - Added an option for layouts to hug text and shapes without ancestor size limits.
- Added listener actions that write input values directly to view model properties, including pointer coordinates, keyboard state, committed text, focus state, and gamepad values.
Renderer
- Added inner and outer strokes.
- Added additive blending with an animatable, data-bindable strength from 0–100% in the Rive renderer. Core Graphics renders additive blending at full strength.
- Added runtime support for alpha and luminance layer masks, including inverted modes, on supported rendering paths. Authoring remains behind an editor feature flag.
Scripting
- Added font and text-shaping APIs for Luau and AssemblyScript, including styled text, wrapping, ellipsis, bidirectional layout, glyph paths, hit testing, and selection geometry.
- Added custom properties on scripted drawables and support for drawing them with modulated opacity.
- Added
os.dateand runtimestring.formatsupport to the AssemblyScript library.
Fixed
Apple runtime
- Fixed distorted Metal drawables beneath scaled or rotated ancestor views in both the legacy and concurrency APIs.
- Fixed pending font, image, and audio resources not being cleaned up when decoding failed or was cancelled.
- Fixed allocation failures while copying asset or
.rivdata into the concurrency command queue terminating the process instead of reporting a Swift error.
Core runtime
- Fixed hidden nested artboards and artboard lists receiving pointer events.
- Fixed crashes when a list row had no artboard.
- Fixed scroll content that already fits its viewport unexpectedly flinging on release.
- Fixed inverse-kinematics blending using authored bone angles instead of the chain’s current pose.
- Fixed incorrect winding in skinned paths, including fills disappearing when a rig initially loaded in a folded pose.
- Fixed hidden paints failing to refresh trim-path effects when becoming visible.
- Fixed font fitting counting vertical trim space twice.
- Fixed path trimming changing coincident control points.
- Fixed virtualized list updates leaving orphaned focus nodes.
- Fixed scripted interpolators leaking their script inputs.
Renderer
- Fixed deferred rendering resolving externally supplied images incorrectly through
Image:view(). - Fixed rendering into non-zero texture mip levels.
- Fixed deferred rendering hosts and sessions retaining stale references during teardown.
Scripting
- Fixed scripted drawable pointer handlers reporting the wrong event type. Timestamps are now forwarded when supplied by the host.
- Fixed incomplete bounds checks for WASM buffers whose lengths are expressed in elements.
- Fixed ARM64 AOT calls leaving the return stack unbalanced.
Changed
Apple runtime
- Views now automatically redraw after changes to bound main and global view model instances, including nested and list-item instances.
- Bind instances through the state-machine APIs and modify them through
ViewModelInstance; manual observation throughdirtyStream()is no longer needed to trigger redraws.
- Bind instances through the state-machine APIs and modify them through
- Deprecated
DataBind, theRiveinitializer acceptingdataBind:,Rive.viewModelInstance, singularbindViewModelInstance(_:), andViewModelInstance.dirtyStream().- Use
StateMachine.bindViewModelInstances(main:globals:)withtry awaitfor explicit bindings. - Retain your view model instances directly for programmatic access.
- Pass configured components to
Rive(file:artboard:stateMachine:), or use the convenience initializers for automatic authored-default binding. - See the migration example below for the change to
Rive.viewModelInstance.
- Use
Migration
Rive(file:) and Rive(file:artboard:) now create a state machine and bind its authored defaults. The deprecated Rive.viewModelInstance getter returns nil when using these new initializers.
For programmatic access, create and retain the instances you need, bind them explicitly, and pass the configured components to Rive:
let artboard = try await file.createArtboard()
let main = try await file.createViewModelInstance(
.viewModelDefault(from: .artboardDefault(artboard))
)
let stateMachine = try await artboard.createStateMachine(binding: main)
let rive = try await Rive(
file: file,
artboard: artboard,
stateMachine: stateMachine
)
// Retain and interact with main directly.To temporarily retain the deprecated automatic-main-instance behavior, explicitly use Rive(file: file, dataBind: .auto).
For migration steps, see Updating existing concurrency runtime code. For additional examples, see Data binding and the optional auto-bind helper.
Core runtime
- Reduced repeated animation, layout, path, and skinning work, including unnecessary updates for hidden shapes and unchanged blend results.
- Improved virtualized list performance by reducing row lookups, reference-counting overhead, and focus-tree rebuilding.
- Reduced path copying when calculating bounds and preserved reusable geometry during rigid transforms.
Scripting
- Reduced AssemblyScript interpreter and host-callback overhead.
- AOT script memory now grows on demand instead of being allocated up to its configured ceiling at startup.
Commits
See the full commit history between 6.27.0 and 6.28.0.
- feat(apple): add global view model support
cad5528 - feat(apple): add font data binding
ec38e7d - feat(apple): add blob data binding
393300f - fix(apple): correct drawable sizing beneath transformed ancestors
21e702d - fix(apple): clean up pending assets on cancellation
2378207 - fix(apple): handle asset data allocation failures
1da275a - feat(text): author-controlled word breaking
00006b7 - feat(layout): add unbounded hugging for leaf objects
fa59ebc - feat(runtime): set view model properties from listener input values
5ccd230 - feat(renderer): add inner and outer strokes
b4b702a - feat(blend): additive blending with adjustable strength
f7a9bad - feat(runtime): add masking support
2b4767b - feat(scripting): expose fonts and text shaping
ce78925 - perf(runtime): animation, layout, and virtualized list improvements
231b636