Repository navigation
This release adds explicit hardware-keyboard focus and per-file deferred decoding to the Concurrency API. It also restores 120 fps rendering on ProMotion displays, which had dropped to about 90 fps since 6.29.0.
Added
Apple runtime
- Explicit keyboard focus: An app can now give a Rive view hardware-keyboard input directly, so keyboard-driven content such as WASD controls responds without the user pressing Tab first. This is opt-in, and ordinary Tab, click, and SwiftUI focus behavior is unchanged. (Change)
- In UIKit and AppKit, call
RiveUIView.becomeKeyboardResponder()andresignKeyboardResponder(). Both return whether ownership changed. - In SwiftUI, use
.keyboardFocused(_:onResult:). The optional callback receives aKeyboardResponderAction(.becomeor.resign) and whether it succeeded. - A request succeeds only for loaded, unpaused content in the key window whose
.rivfile has focus nodes configured in the Rive Editor. - This doesn't enable text input or show the software keyboard.
- In UIKit and AppKit, call
- Per-file deferred decoding: A file can now decode each artboard when it's first needed instead of when the file loads. Eager decoding remains the default. (Change, Change)
- Pass
File.Configuration(deferDecoding: true)toFile(source:worker:configuration:). Eager and deferred files can share a worker. - If a deferred artboard fails to decode,
createArtboardthrowsFileError.invalidArtboard.
- Pass
Core runtime
- Ink vertical trim for text: Text has a new vertical trim option that fits the top and bottom of the text box to the glyph outlines of the first and last lines, rather than to font metrics. It's configured in the Rive Editor. (Change)
Scripting
- Artboard and node access: A script can now read the artboard it lives in with
context:artboard()and its own node withcontext:node(), which also reaches the node's parent and siblings. When something the script read inupdateoradvancechanges, the script runs again. (Change) - Node bounds: Nodes now have
bounds()andworldBounds(), which return the node's box in its own space and in the artboard's space. A node with no size of its own, such as a group, returns a zero box. (Change) NodeRefinputs: A script input can now name a node in the script's artboard. The script reads the node withget()and can write to it while the scripted object exists. (Change)Image.fromPixels:Image.fromPixels(width, height, data)turns premultiplied RGBA8 pixels into anImagethat a script can draw, sample, or assign to a view model image property. It returnsnilwhen the buffer isn't exactlywidth * height * 4bytes or a side is outside 1–65535. (Change)- Stopping events from listener actions: Calling
hit()on thePointerEventthat a scripted listener action receives now makes the listener's target opaque for that event, so targets beneath it don't receive it. Previously the call did nothing.KeyboardEventalso gainshit(), which lets a capture-phase listener claim only the keys its script chooses. (Change, Change)
Fixed
Apple runtime
- 90 fps on ProMotion displays: Since 6.29.0,
RiveUIViewran at about 90 fps instead of 120 fps on ProMotion displays. It holds 120 fps again. The 6.29.0 fixes for one-second stalls and the iOS 16 and 17 crash remain in place. Under heavy GPU load, the average wait for a drawable is longer, because frames that 6.29.0 skipped are now rendered. Reported in #472. (Fix) - View model property streams that stopped updating: When two streams observed the same view model property and one ended, the other could stop receiving values. This also happened when a replacement stream opened just before the old one finished. Streams for the same property now share one subscription, which stays active until the last stream ends. Reported in #469. (Fix)
- Data race when submitting commands: Submitting a command could race with the command server checking for work, which ThreadSanitizer reported. The check now happens under the lock. (Fix)
Core runtime
- Memory growth from repeated view model lookups: Looking up the same view model repeatedly grew the file's memory each time. A file now keeps one runtime object per view model and returns it on every lookup. (Fix)
- Crashes when instancing a file from several threads: Creating or destroying artboard instances of the same file on several threads at once could corrupt memory and crash. The shared state that instancing writes is now locked. (Fix)
- Crash when replacing a view model instance: Replacing a view model instance could read freed memory when a component showed an artboard from another file. Replacing the instance is now safe, and a component shown with its own view model instance keeps it. (Fix)
- Virtualized list rows after hiding: When a virtualized list was hidden by its layout and shown again, rows could land on top of each other or the wrong rows could appear. Rows now return to the same places. (Fix)
- Tab navigation in virtualized lists: Tab couldn't reach rows that a virtualized list hadn't built yet, and it could land on a row that was no longer shown. The list now scrolls an unbuilt row into view and focuses it. Focus that changes during an animating scroll also scrolls to the right place. (Fix)
- Layer masks sharing a source: When two layer masks used the same source, one measured no coverage and, in alpha mode, erased its whole layer. Both masks now draw correctly. (Fix)
- Artboards held after being cleared while hidden: When a view model artboard property was cleared or swapped while its component's layout was hidden, the old artboard wasn't released until the layout showed again. It's now released right away. (Fix)
- Text languages with deferred decoding: With deferred decoding on, text in an artboard decoded after the file loaded lost its language, so Japanese text could draw with Chinese glyphs. Deferred artboards now keep their text languages. (Fix)
- Fallback fonts for emoji sequences: A sequence such as a keycap emoji, in a font that had the digit but not the keycap mark, drew the digit several times before the emoji. A cluster with any missing glyph now falls back as a whole. A fallback chain that kept returning new fonts could also overflow the stack, and chains are now bounded. (Fix)
Renderer
- GPU Canvas aborts on Metal: A GPU Canvas shader that declared too many buffers, or a draw with a vertex buffer that no attribute read, aborted the app. The first now fails to build and the second draws. Compute shaders and storage buffers are also reported as unsupported until they work. (Fix)
Scripting
- Script nodes in components claiming every pointer event: A script node or scripted layout inside a component claimed presses and hovers anywhere on the host artboard, which kept them from the host's own targets. It now receives pointer events only where its component shows, and keeps a drag that started there. (Fix)
- Script sounds playing after their artboard is deleted: A sound that a script started kept playing after its artboard and file were deleted. The sound now belongs to the script's artboard and stops with it. A sound started inside a value listener or a promise handler still has no owner. (Fix)
Behavior changes
Core runtime
- Components showing an artboard from another file: An artboard from another file, shown with its own view model, no longer inherits the host's data. Its bindings, paths, and global view model lookups no longer fall through to the host's view models. Artboards from the host's own file, and artboards shown without their own view model, are unchanged. (Change)
Performance
Core runtime
- Idle list rows: List rows that host a scripted drawable or scripted path effect, or whose text uses a stateful global text style, never went idle. These rows now stop advancing once their scripts and styles have no work, and wake when something changes. (Change, Change)
- Per-frame allocations with clipping: Drawing an artboard with clips allocated memory every frame. The storage is now reused, which removes one of the largest sources of per-frame allocation. (Change)
- Formula converters: Formula converters no longer allocate on every evaluation. On one file with 341 formulas, the advance of a frame fell from 1.38 ms to 1.17 ms. This illustrates one improvement, and gains depend on the content. (Change)
- Artboard instancing: Creating an artboard instance no longer scans every object to order its draw targets, which benefits every component and list row. (Change)
- Paints without images: Shapes, layouts, and text whose paints have no image now draw directly, which skips work that every draw had been doing. (Change)
- Focus trees: A component nested under several hosts with state machines had its focus tree built repeatedly, doubling with each level. It's now built once. Lists with focusable rows also update their focus rows in linear time, where large lists had taken time proportional to the square of their length. (Change, Change)
Renderer
- Path tessellation: The Rive Renderer reads less data per vertex and does more stroke work during tessellation. On an iPhone 15 with Metal, a stress scene of 30 tigers ran 1.6% and 1.7% faster with the two changes. (Change, Change)