Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
582f156
feat: experimental iOS Rive backend with synchronous API
mfazekas Feb 9, 2026
5916624
chore: move docs to .local/docs, remove from git
mfazekas Feb 9, 2026
a845f29
refactor: remove ExperimentalFileSource from legacy backend
mfazekas Feb 9, 2026
6ebf265
fix: restore whitespace in legacy files, remove fragile asset type gu…
mfazekas Feb 9, 2026
32e742c
fix: share single Worker across all files, fix artboard property data…
mfazekas Feb 9, 2026
7dc2964
fix: wire up trigger property to experimental fire/stream API
mfazekas Feb 9, 2026
7ff04e8
fix: set fit after view setup to fix .layout mode on initial render
mfazekas Feb 11, 2026
e418b4b
test: add advanced data binding harness tests
mfazekas Feb 11, 2026
31c3115
fix: guard negative index in legacy viewModelByIndex and createInstan…
mfazekas Feb 11, 2026
cf062f2
fix: correct trigger property listener task type signature
mfazekas Feb 11, 2026
caff580
fix: embed SPM RiveRuntime.framework via Podfile post_install hook
mfazekas Feb 11, 2026
04d7a20
refactor: split Android into legacy/experimental backend directories
mfazekas Feb 12, 2026
046becf
feat: implement Android experimental backend using new app.rive.* API
mfazekas Feb 12, 2026
2c25174
feat: implement Android experimental backend with CommandQueue API
mfazekas Feb 16, 2026
aebbc51
feat: migrate getEnums() from sync to async (Promise)
mfazekas Feb 17, 2026
beb5827
fix: color property overflow and test tolerance for cross-platform di…
mfazekas Feb 17, 2026
8196fed
feat: add backend property to RiveFileFactory for runtime detection
mfazekas Feb 17, 2026
3e42312
feat: migrate viewModelByIndex, createInstanceByIndex, viewModel to a…
mfazekas Feb 17, 2026
a01fc48
fix: lint formatting in ViewModel spec and harness test
mfazekas Feb 17, 2026
920dfb4
ci: add experimental runtime harness tests for iOS and Android
mfazekas Feb 18, 2026
c68ec58
ci: increase iOS experimental harness timeout to 90min for cold builds
mfazekas Feb 18, 2026
436d243
fix: handle throwing Worker() init in rive-ios 6.15.1
mfazekas Feb 18, 2026
fc628e5
fix: experimental iOS instance lookup and test guards
mfazekas Feb 19, 2026
7e984b2
feat: add async APIs for RiveFile/ViewModel and fix experimental inst…
mfazekas Feb 19, 2026
4fd2755
chore: upgrade rive-ios SPM to 6.15.2
mfazekas Feb 19, 2026
96abedd
fix: only allow snakeLizard enum on android legacy backend
mfazekas Feb 19, 2026
5b13844
test: add useViewModelInstance e2e harness tests
mfazekas Feb 19, 2026
91c487b
fix: implement color property get/listen and fix UInt32 crash on expe…
mfazekas Feb 26, 2026
06e7401
feat(ios): decouple SPM from experimental runtime toggle
mfazekas Mar 11, 2026
7f5904d
feat: make useRiveProperty start undefined and deliver value via list…
mfazekas Mar 11, 2026
503a981
Merge remote-tracking branch 'origin/main' into feat/rive-ios-experim…
mfazekas Mar 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 195 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,198 @@ jobs:
run: |
echo "=== Checking logcat for errors ==="
adb logcat -d -s ReactNativeJS:* RiveExample:* RNRive:* | tail -200 || echo "No logs found"

test-harness-ios-experimental:
runs-on: macos-latest
timeout-minutes: 90
env:
XCODE_VERSION: 16.4
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Use appropriate Xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}

- name: Restore cocoapods
id: cocoapods-cache
uses: actions/cache/restore@v4
with:
path: |
**/ios/Pods
key: ${{ runner.os }}-experimental-cocoapods-${{ hashFiles('example/ios/Podfile', '*.podspec') }}
restore-keys: |
${{ runner.os }}-experimental-cocoapods-

- name: Install cocoapods (experimental SPM)
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example
bundle install
USE_RIVE_SPM=1 bundle exec pod install --project-directory=ios

- name: Save cocoapods cache
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
**/ios/Pods
key: ${{ steps.cocoapods-cache.outputs.cache-key }}

- name: Restore iOS build cache
id: ios-build-cache
uses: actions/cache/restore@v4
with:
path: example/ios/build
key: ${{ runner.os }}-ios-experimental-build-${{ env.XCODE_VERSION }}-${{ hashFiles('yarn.lock', 'ios/**', 'nitrogen/generated/ios/**', '*.podspec', 'example/ios/Podfile', 'example/ios/RiveExample/**') }}
restore-keys: |
${{ runner.os }}-ios-experimental-build-${{ env.XCODE_VERSION }}-

- name: Build iOS app
if: steps.ios-build-cache.outputs.cache-hit != 'true'
working-directory: example/ios
run: |
set -o pipefail && xcodebuild \
-derivedDataPath build \
-workspace RiveExample.xcworkspace \
-scheme RiveExample \
-sdk iphonesimulator \
-configuration Debug \
build \
CODE_SIGNING_ALLOWED=NO

- name: Save iOS build cache
if: steps.ios-build-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: example/ios/build
key: ${{ steps.ios-build-cache.outputs.cache-primary-key }}

- name: Boot iOS Simulator
uses: futureware-tech/simulator-action@v4
with:
model: 'iPhone 16 Pro'
os_version: '18.6'

- name: Install app on simulator
run: xcrun simctl install booted example/ios/build/Build/Products/Debug-iphonesimulator/RiveExample.app

- name: Wait for simulator to be fully ready
run: |
echo "Waiting for simulator to be fully ready..."
sleep 10
xcrun simctl list devices | grep Booted

- name: Run harness tests on iOS
working-directory: example
run: |
for attempt in 1 2 3; do
echo "Attempt $attempt of 3"
if yarn test:harness:ios --verbose --testTimeout 120000; then
echo "Tests passed on attempt $attempt"
exit 0
fi
echo "Attempt $attempt failed, retrying..."
sleep 5
done
echo "All attempts failed"
exit 1

- name: Debug - Check for console logs
if: failure()
run: |
echo "=== Checking simulator logs for errors ==="
xcrun simctl spawn booted log show --predicate 'processImagePath CONTAINS "RiveExample"' --last 5m --style compact 2>&1 | tail -200 || echo "No logs found"

test-harness-android-experimental:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
ANDROID_API_LEVEL: 35
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Finalize Android SDK
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"

- name: Enable experimental Rive API
run: |
sed -i 's/USE_RIVE_NEW_API=false/USE_RIVE_NEW_API=true/' example/android/gradle.properties

- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-harness-experimental-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-harness-experimental-
${{ runner.os }}-gradle-harness-
${{ runner.os }}-gradle-

- name: Restore Android build cache
id: android-build-cache
uses: actions/cache/restore@v4
with:
path: example/android/app/build
key: ${{ runner.os }}-android-experimental-build-${{ env.ANDROID_API_LEVEL }}-${{ hashFiles('yarn.lock', 'android/**', 'nitrogen/generated/android/**', 'example/android/app/build.gradle', 'example/android/gradle.properties') }}
restore-keys: |
${{ runner.os }}-android-experimental-build-${{ env.ANDROID_API_LEVEL }}-

- name: Build Android app
if: steps.android-build-cache.outputs.cache-hit != 'true'
working-directory: example/android
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: |
./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=x86_64

- name: Save Android build cache
if: steps.android-build-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: example/android/app/build
key: ${{ steps.android-build-cache.outputs.cache-primary-key }}

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Run harness tests on Android
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.ANDROID_API_LEVEL }}
arch: x86_64
target: google_apis
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
disable-animations: true
script: |
adb install example/android/app/build/outputs/apk/debug/app-debug.apk
sleep 10
cd example && for attempt in 1 2 3; do echo "Attempt $attempt of 3"; if timeout 300 env ANDROID_AVD=test yarn test:harness:android --verbose --testTimeout 120000; then echo "Tests passed on attempt $attempt"; exit 0; fi; echo "Attempt $attempt failed (exit $?), retrying..."; sleep 5; done; echo "All attempts failed"; exit 1

- name: Debug - Check logcat
if: failure() || cancelled()
run: |
echo "=== Checking logcat for errors ==="
adb logcat -d -s ReactNativeJS:* RiveExample:* RNRive:* | tail -200 || echo "No logs found"
57 changes: 55 additions & 2 deletions RNRive.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,46 @@ if !rive_ios_version
raise "Internal Error: Failed to determine Rive iOS SDK version. Please ensure package.json contains 'runtimeVersions.ios'"
end

Pod::UI.puts "@rive-app/react-native: Rive iOS SDK #{rive_ios_version}"
# Set to '1' (or set $UseRiveExperimentalRuntime = true in Podfile) to enable the
# experimental Rive runtime backend. When disabled, the legacy backend is used.
use_rive_experimental_runtime = ENV['USE_RIVE_EXPERIMENTAL_RUNTIME'] == '1' || (defined?($UseRiveExperimentalRuntime) && $UseRiveExperimentalRuntime)

if use_rive_experimental_runtime
Pod::UI.puts "@rive-app/react-native: Using experimental Rive runtime backend"
else
Pod::UI.puts "@rive-app/react-native: Using legacy Rive runtime backend (iOS SDK #{rive_ios_version})"
end

# SPM-resolved dynamic frameworks aren't embedded by CocoaPods automatically.
# Hook into post_install to append RiveRuntime to every target's embed script
# so consumers don't need to add anything to their own Podfiles.
if defined?(Pod::Installer)
module RiveSPMEmbedFix
def run_podfile_post_install_hooks
super
aggregate_targets.each do |target|
embed_script = File.join(
sandbox.root,
'Target Support Files',
target.name,
"#{target.name}-frameworks.sh"
)
next unless File.exist?(embed_script)
content = File.read(embed_script)
next if content.include?('RiveRuntime')
content.sub!(
/if \[ "\$\{COCOAPODS_PARALLEL_CODE_SIGN\}" == "true" \]; then\s+wait\s+fi/,
"install_framework \"${PODS_XCFRAMEWORKS_BUILD_DIR}/RiveRuntime/RiveRuntime.framework\"\n" \
"if [ \"${COCOAPODS_PARALLEL_CODE_SIGN}\" == \"true\" ]; then\n wait\nfi"
)
File.write(embed_script, content)
Pod::UI.puts "[RNRive] Added RiveRuntime.framework to embed script for #{target.name}"
end
end
end

Pod::Installer.prepend(RiveSPMEmbedFix)
end

Pod::Spec.new do |s|
s.name = "RNRive"
Expand All @@ -43,11 +82,25 @@ Pod::Spec.new do |s|

s.source_files = "ios/**/*.{h,m,mm,swift}"

if use_rive_experimental_runtime
s.exclude_files = ["ios/legacy/**"]
else
s.exclude_files = ["ios/new/**"]
end

s.public_header_files = ['ios/RCTSwiftLog.h']
load 'nitrogen/generated/ios/RNRive+autolinking.rb'
add_nitrogen_files(s)

s.dependency "RiveRuntime", rive_ios_version
spm_dependency(s,
url: 'https://github.com/rive-app/rive-ios.git',
requirement: { kind: 'exactVersion', version: rive_ios_version },
products: ['RiveRuntime']
)

install_modules_dependencies(s)

if use_rive_experimental_runtime
s.xcconfig = { 'OTHER_SWIFT_FLAGS' => '$(inherited) -DRIVE_EXPERIMENTAL_API' }
end
end
7 changes: 7 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,17 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

def useNewRiveApi = rootProject.findProperty('USE_RIVE_NEW_API') == 'true'

sourceSets {
main {
java.srcDirs += ["generated/java",
"generated/jni"]
if (useNewRiveApi) {
java.srcDirs += ["src/experimental/java"]
} else {
java.srcDirs += ["src/legacy/java"]
}
}
}
}
Expand Down
Loading
Loading