Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
59a8c3f
feat: experimental iOS Rive backend with synchronous API
mfazekas Feb 9, 2026
e897fbc
chore: move docs to .local/docs, remove from git
mfazekas Feb 9, 2026
b67258a
refactor: remove ExperimentalFileSource from legacy backend
mfazekas Feb 9, 2026
7049920
fix: restore whitespace in legacy files, remove fragile asset type gu…
mfazekas Feb 9, 2026
da52f25
fix: share single Worker across all files, fix artboard property data…
mfazekas Feb 9, 2026
1af91b8
fix: wire up trigger property to experimental fire/stream API
mfazekas Feb 9, 2026
0b8751e
fix: set fit after view setup to fix .layout mode on initial render
mfazekas Feb 11, 2026
976d9b8
test: add advanced data binding harness tests
mfazekas Feb 11, 2026
b7bfe4f
fix: guard negative index in legacy viewModelByIndex and createInstan…
mfazekas Feb 11, 2026
ed98433
fix: correct trigger property listener task type signature
mfazekas Feb 11, 2026
75c660a
fix: embed SPM RiveRuntime.framework via Podfile post_install hook
mfazekas Feb 11, 2026
165b68c
refactor: split Android into legacy/experimental backend directories
mfazekas Feb 12, 2026
9258ae6
feat: implement Android experimental backend using new app.rive.* API
mfazekas Feb 12, 2026
c222601
feat: implement Android experimental backend with CommandQueue API
mfazekas Feb 16, 2026
e5b16c2
feat: migrate getEnums() from sync to async (Promise)
mfazekas Feb 17, 2026
99ae376
fix: color property overflow and test tolerance for cross-platform di…
mfazekas Feb 17, 2026
c93d120
feat: add backend property to RiveFileFactory for runtime detection
mfazekas Feb 17, 2026
7164508
feat: migrate viewModelByIndex, createInstanceByIndex, viewModel to a…
mfazekas Feb 17, 2026
298c3f8
fix: lint formatting in ViewModel spec and harness test
mfazekas Feb 17, 2026
df30e76
ci: add experimental runtime harness tests for iOS and Android
mfazekas Feb 18, 2026
28d9143
ci: increase iOS experimental harness timeout to 90min for cold builds
mfazekas Feb 18, 2026
1637077
fix: handle throwing Worker() init in rive-ios 6.15.1
mfazekas Feb 18, 2026
0ebfe91
fix: experimental iOS instance lookup and test guards
mfazekas Feb 19, 2026
4cf22b4
feat: add async APIs for RiveFile/ViewModel and fix experimental inst…
mfazekas Feb 19, 2026
776371c
chore: upgrade rive-ios SPM to 6.15.2
mfazekas Feb 19, 2026
6508356
fix: only allow snakeLizard enum on android legacy backend
mfazekas Feb 19, 2026
28b7535
test: add useViewModelInstance e2e harness tests
mfazekas Feb 19, 2026
9c8adfb
fix: implement color property get/listen and fix UInt32 crash on expe…
mfazekas Feb 26, 2026
911587c
feat(ios): decouple SPM from experimental runtime toggle
mfazekas Mar 11, 2026
473648a
feat: make useRiveProperty start undefined and deliver value via list…
mfazekas Mar 11, 2026
a6d1a15
fix: unify USE_RIVE_NEW_API flag, replace SPM with CocoaPods, fix exp…
mfazekas Mar 12, 2026
b77cfa1
fix: skip autoPlay test on both experimental backends
mfazekas Mar 12, 2026
aa2fdf0
fix: remove unused Platform import
mfazekas Mar 12, 2026
be5135e
chore: update nitrogen generated files
mfazekas Mar 16, 2026
c787e09
fix: use ArrayBuffer instead of ArrayBufferHolder in new HybridRiveFi…
mfazekas Mar 16, 2026
f0e57a2
feat: add async versions of viewModelCount, artboardCount, artboardNames
mfazekas Mar 16, 2026
5728122
feat: add async alternatives for ViewModel property value getters
mfazekas Mar 16, 2026
5d3be00
fix: add missing Promise import in experimental Android property file…
mfazekas Mar 16, 2026
c3a13f0
ci: remove android style guide enforcement from ktlint
mfazekas Mar 17, 2026
98da6a7
fix(kotlin): fix all ktlint violations and add lint:fix:kotlin script
mfazekas Mar 17, 2026
3f0a5da
ci: fail lint-kotlin job on ktlint errors
mfazekas Mar 17, 2026
cd995f4
feat: add explicit type field to ResolvedReferencedAsset for asset lo…
mfazekas Mar 17, 2026
fa2c0f3
fix: format import in ReferencedAssets.ts to satisfy Prettier
mfazekas Mar 17, 2026
b310191
chore: re-run nitrogen to regenerate bridge code for RiveAssetType/ty…
mfazekas Mar 17, 2026
18f91c0
fix: disable function-naming ktlint rule for Composable PascalCase fu…
mfazekas Mar 17, 2026
934e68f
fix: apply ktlint auto-format to ComposeTestActivity
mfazekas Mar 17, 2026
30db41d
fix(ios): update ExperimentalAssetLoader to use typed RiveAssetType enum
mfazekas Mar 17, 2026
4a1efa1
fix(android): update ExperimentalAssetLoader to use typed RiveAssetTy…
mfazekas Mar 17, 2026
3ddd1aa
refactor: API cleanup — validate option, createBlankInstanceAsync ren…
mfazekas Mar 17, 2026
96787de
fix(ios): correct set(value:) argument label to match generated protocol
mfazekas Mar 17, 2026
77b1df2
test(harness): assert first listener emission fires without prop update
mfazekas Mar 18, 2026
4b07bc2
feat(example): add Data Binding (expapi) exerciser using async VM API
mfazekas Mar 18, 2026
e3a5bb0
fix(ios): createInstanceByIndex(Async) now respects the index
mfazekas Mar 18, 2026
7c992cd
fix: remove createInstanceByIndexAsync, fix createInstanceByIndex on …
mfazekas Mar 18, 2026
5ecdf1e
fix(ios): implement propertyCount and instanceCount using runtime APIs
mfazekas Mar 18, 2026
a33ad6f
test: strengthen replaceViewModel assertion to verify actual replacement
mfazekas Mar 18, 2026
8326192
fix(ios): don't set instanceName to property path for nested VMIs
mfazekas Mar 18, 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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ ktlint_standard_string-template-indent = disabled
ktlint_standard_backing-property-naming = disabled
ktlint_standard_no-consecutive-comments = disabled
ktlint_standard_no-empty-first-line-in-class-body = disabled
ktlint_standard_condition-wrapping = disabled
ktlint_standard_if-else-wrapping = disabled
ktlint_standard_function-naming = disabled

[nitrogen/generated/**/*.kt]
ktlint = disabled
197 changes: 196 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
ktlint_version: "1.5.0"
android: true
fail_on_error: true

lint:
runs-on: ubuntu-latest
Expand Down 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
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
run: |
cd example
bundle install
USE_RIVE_NEW_API=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"
42 changes: 19 additions & 23 deletions RNRive.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,14 @@ 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}"

# Xcode 26 workaround: strip .Swift Clang submodule from RiveRuntime's prebuilt
# modulemaps to prevent ODR conflicts with locally-compiled Swift C++ interop.
# See: https://github.com/rive-app/rive-nitro-react-native/issues/173
if defined?(Pod::Installer)
module RiveXcode26SwiftModuleFix
def run_podfile_pre_install_hooks
rive_dir = File.join(sandbox.root.to_s, 'RiveRuntime')
if Dir.exist?(rive_dir)
Dir.glob(File.join(rive_dir, '**', 'module.modulemap')).each do |path|
content = File.read(path)
next unless content.include?('RiveRuntime.Swift')
cleaned = content.gsub(/\nmodule RiveRuntime\.Swift \{[^}]*\}\n?/m, "\n")
File.write(path, cleaned)
end
end
super
end
end

Pod::Installer.prepend(RiveXcode26SwiftModuleFix)
# Set to '1' (or set $UseRiveNewAPI = true in Podfile) to enable the
# experimental Rive runtime backend. When disabled, the legacy backend is used.
use_rive_new_api = ENV['USE_RIVE_NEW_API'] == '1' || (defined?($UseRiveNewAPI) && $UseRiveNewAPI)

if use_rive_new_api
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

Pod::Spec.new do |s|
Expand All @@ -65,11 +51,21 @@ Pod::Spec.new do |s|

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

if use_rive_new_api
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
s.dependency 'RiveRuntime', rive_ios_version

install_modules_dependencies(s)

if use_rive_new_api
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