diff --git a/example/src/exercisers/OutOfBandAssets.tsx b/example/src/exercisers/OutOfBandAssets.tsx index 050dbf27..0ad9d93d 100644 --- a/example/src/exercisers/OutOfBandAssets.tsx +++ b/example/src/exercisers/OutOfBandAssets.tsx @@ -22,26 +22,17 @@ export default function OutOfBandAssetsExample() { referencedAssets: { 'Inter-594377': { source: require('../../assets/fonts/Inter-594377.ttf'), - // source: { - // fileName: 'Inter-594377.ttf', - // path: 'fonts', // only needed for Android assets - // }, + type: 'font', }, 'referenced-image-2929282': { source: { uri: uri, }, - // source: { - // fileName: 'referenced-image-2929282.png', - // path: 'images', // only needed for Android assets - // }, + type: 'image', }, 'referenced_audio-2929340': { source: require('../../assets/audio/referenced_audio-2929340.wav'), - // source: { - // fileName: 'referenced_audio-2929340.wav', - // path: 'audio', // only needed for Android assets - // }, + type: 'audio', }, }, } diff --git a/expo-example/app.config.js b/expo-example/app.config.js index d4bd7bae..22dff6ff 100644 --- a/expo-example/app.config.js +++ b/expo-example/app.config.js @@ -47,6 +47,12 @@ module.exports = { assets: ['../example/assets/rive/rewards.riv'], }, ], + [ + 'expo-font', + { + fonts: ['./assets/kanit_regular.ttf'], + }, + ], ], experiments: { typedRoutes: true, diff --git a/expo55-example/app.config.js b/expo55-example/app.config.js index 96354988..db9b4701 100644 --- a/expo55-example/app.config.js +++ b/expo55-example/app.config.js @@ -47,6 +47,12 @@ module.exports = { assets: ['../example/assets/rive/rewards.riv'], }, ], + [ + 'expo-font', + { + fonts: ['./assets/kanit_regular.ttf'], + }, + ], ], experiments: { typedRoutes: true, diff --git a/ios/new/ExperimentalAssetLoader.swift b/ios/new/ExperimentalAssetLoader.swift index d19c2eef..78ce7176 100644 --- a/ios/new/ExperimentalAssetLoader.swift +++ b/ios/new/ExperimentalAssetLoader.swift @@ -1,4 +1,4 @@ -@_spi(RiveExperimental) import RiveRuntime +import RiveRuntime import NitroModules enum AssetType { diff --git a/ios/new/HybridRiveFile.swift b/ios/new/HybridRiveFile.swift index b8ee3c69..4477890a 100644 --- a/ios/new/HybridRiveFile.swift +++ b/ios/new/HybridRiveFile.swift @@ -1,4 +1,4 @@ -@_spi(RiveExperimental) import RiveRuntime +import RiveRuntime import NitroModules class HybridRiveFile: HybridRiveFileSpec { @@ -149,14 +149,7 @@ class HybridRiveFile: HybridRiveFileSpec { } func updateReferencedAssets(referencedAssets: ReferencedAssetsType) { - guard let worker = worker else { - RCTLogWarn("HybridRiveFile.updateReferencedAssets: No worker available") - return - } - RCTLogInfo("HybridRiveFile.updateReferencedAssets: Updating \(referencedAssets.data?.count ?? 0) assets (note: existing artboards won't refresh)") - Task { @MainActor in - await ExperimentalAssetLoader.registerAssets(referencedAssets, on: worker) - } + RCTLogWarn("[Rive] updateReferencedAssets is not supported with the experimental backend — already-rendered artboards cannot be updated. Use the legacy backend for runtime asset swapping.") } func getEnums() throws -> Promise<[RiveEnumDefinition]> { diff --git a/ios/new/HybridRiveFileFactory.swift b/ios/new/HybridRiveFileFactory.swift index f7f2751c..4752cc36 100644 --- a/ios/new/HybridRiveFileFactory.swift +++ b/ios/new/HybridRiveFileFactory.swift @@ -1,4 +1,4 @@ -@_spi(RiveExperimental) import RiveRuntime +import RiveRuntime import NitroModules final class HybridRiveFileFactory: HybridRiveFileFactorySpec, @unchecked Sendable { diff --git a/ios/new/HybridRiveView.swift b/ios/new/HybridRiveView.swift index 59064c4b..0e253c1a 100644 --- a/ios/new/HybridRiveView.swift +++ b/ios/new/HybridRiveView.swift @@ -1,4 +1,4 @@ -@_spi(RiveExperimental) import RiveRuntime +import RiveRuntime import Foundation import NitroModules import UIKit diff --git a/ios/new/RiveReactNativeView.swift b/ios/new/RiveReactNativeView.swift index b486c9e3..200e5ab1 100644 --- a/ios/new/RiveReactNativeView.swift +++ b/ios/new/RiveReactNativeView.swift @@ -1,7 +1,6 @@ import RiveRuntime import NitroModules import UIKit -import MetalKit enum ExperimentalBindData { case none @@ -28,23 +27,8 @@ class RiveReactNativeView: UIView { private var isViewReady = false private var configTask: Task? private var isPaused = false - private var pendingFit: RiveRuntime.Fit? - var autoPlay: Bool = true - override func layoutSubviews() { - super.layoutSubviews() - applyPendingFitIfMTKViewReady() - } - - // https://github.com/rive-app/rive-nitro-react-native/pull/231 - private func applyPendingFitIfMTKViewReady() { - guard let fit = pendingFit, let rive = riveInstance, - riveUIView?.subviews.contains(where: { $0 is MTKView }) == true else { return } - rive.fit = fit - pendingFit = nil - } - func awaitViewReady() async -> Bool { if !isViewReady { await withCheckedContinuation { continuation in @@ -101,7 +85,8 @@ class RiveReactNativeView: UIView { file: config.file, artboard: artboard, stateMachine: stateMachine, - dataBind: dataBind + dataBind: dataBind, + fit: config.fit ) guard !Task.isCancelled else { return } @@ -110,8 +95,6 @@ class RiveReactNativeView: UIView { self.riveInstance = rive self.setupRiveUIView(with: rive) - self.pendingFit = config.fit - if config.autoPlay { self.isPaused = false }