Skip to content

Commit 844d871

Browse files
committed
feat: make experimental runtime the default, legacy opt-in via USE_RIVE_LEGACY
1 parent 0a3d09c commit 844d871

5 files changed

Lines changed: 32 additions & 34 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ jobs:
473473
echo "=== Checking logcat for errors ==="
474474
adb logcat -d -s ReactNativeJS:* RiveExample:* RNRive:* | tail -200 || echo "No logs found"
475475
476-
test-harness-ios-experimental:
476+
test-harness-ios-legacy:
477477
runs-on: macos-latest
478478
timeout-minutes: 90
479479
env:
@@ -496,16 +496,16 @@ jobs:
496496
with:
497497
path: |
498498
**/ios/Pods
499-
key: ${{ runner.os }}-experimental-cocoapods-${{ hashFiles('example/ios/Podfile', '*.podspec') }}
499+
key: ${{ runner.os }}-legacy-cocoapods-${{ hashFiles('example/ios/Podfile', '*.podspec') }}
500500
restore-keys: |
501-
${{ runner.os }}-experimental-cocoapods-
501+
${{ runner.os }}-legacy-cocoapods-
502502
503503
- name: Install cocoapods
504504
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
505505
run: |
506506
cd example
507507
bundle install
508-
USE_RIVE_NEW_API=1 bundle exec pod install --project-directory=ios
508+
USE_RIVE_LEGACY=1 bundle exec pod install --project-directory=ios
509509
510510
- name: Save cocoapods cache
511511
if: steps.cocoapods-cache.outputs.cache-hit != 'true'
@@ -520,9 +520,9 @@ jobs:
520520
uses: actions/cache/restore@v4
521521
with:
522522
path: example/ios/build
523-
key: ${{ runner.os }}-ios-experimental-build-${{ env.XCODE_VERSION }}-${{ hashFiles('yarn.lock', 'ios/**', 'nitrogen/generated/ios/**', '*.podspec', 'example/ios/Podfile', 'example/ios/RiveExample/**') }}
523+
key: ${{ runner.os }}-ios-legacy-build-${{ env.XCODE_VERSION }}-${{ hashFiles('yarn.lock', 'ios/**', 'nitrogen/generated/ios/**', '*.podspec', 'example/ios/Podfile', 'example/ios/RiveExample/**') }}
524524
restore-keys: |
525-
${{ runner.os }}-ios-experimental-build-${{ env.XCODE_VERSION }}-
525+
${{ runner.os }}-ios-legacy-build-${{ env.XCODE_VERSION }}-
526526
527527
- name: Build iOS app
528528
if: steps.ios-build-cache.outputs.cache-hit != 'true'
@@ -580,7 +580,7 @@ jobs:
580580
echo "=== Checking simulator logs for errors ==="
581581
xcrun simctl spawn booted log show --predicate 'processImagePath CONTAINS "RiveExample"' --last 5m --style compact 2>&1 | tail -200 || echo "No logs found"
582582
583-
test-harness-android-experimental:
583+
test-harness-android-legacy:
584584
runs-on: ubuntu-latest
585585
timeout-minutes: 30
586586
env:
@@ -602,19 +602,19 @@ jobs:
602602
run: |
603603
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
604604
605-
- name: Enable experimental Rive API
605+
- name: Enable legacy Rive backend
606606
run: |
607-
sed -i 's/USE_RIVE_NEW_API=false/USE_RIVE_NEW_API=true/' example/android/gradle.properties
607+
echo "USE_RIVE_LEGACY=true" >> example/android/gradle.properties
608608
609609
- name: Cache Gradle
610610
uses: actions/cache@v4
611611
with:
612612
path: |
613613
~/.gradle/wrapper
614614
~/.gradle/caches
615-
key: ${{ runner.os }}-gradle-harness-experimental-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
615+
key: ${{ runner.os }}-gradle-harness-legacy-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
616616
restore-keys: |
617-
${{ runner.os }}-gradle-harness-experimental-
617+
${{ runner.os }}-gradle-harness-legacy-
618618
${{ runner.os }}-gradle-harness-
619619
${{ runner.os }}-gradle-
620620
@@ -623,9 +623,9 @@ jobs:
623623
uses: actions/cache/restore@v4
624624
with:
625625
path: example/android/app/build
626-
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') }}
626+
key: ${{ runner.os }}-android-legacy-build-${{ env.ANDROID_API_LEVEL }}-${{ hashFiles('yarn.lock', 'android/**', 'nitrogen/generated/android/**', 'example/android/app/build.gradle', 'example/android/gradle.properties') }}
627627
restore-keys: |
628-
${{ runner.os }}-android-experimental-build-${{ env.ANDROID_API_LEVEL }}-
628+
${{ runner.os }}-android-legacy-build-${{ env.ANDROID_API_LEVEL }}-
629629
630630
- name: Build Android app
631631
if: steps.android-build-cache.outputs.cache-hit != 'true'

RNRive.podspec

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ if !rive_ios_version
2828
raise "Internal Error: Failed to determine Rive iOS SDK version. Please ensure package.json contains 'runtimeVersions.ios'"
2929
end
3030

31-
# Set to '1' (or set $UseRiveNewAPI = true in Podfile) to enable the
32-
# experimental Rive runtime backend. When disabled, the legacy backend is used.
33-
use_rive_new_api = ENV['USE_RIVE_NEW_API'] == '1' || (defined?($UseRiveNewAPI) && $UseRiveNewAPI)
31+
# The experimental runtime backend is used by default. Set USE_RIVE_LEGACY=1
32+
# (or $UseRiveLegacy = true in Podfile) to fall back to the legacy backend.
33+
use_legacy = ENV['USE_RIVE_LEGACY'] == '1' || (defined?($UseRiveLegacy) && $UseRiveLegacy)
3434

35-
if use_rive_new_api
36-
Pod::UI.puts "@rive-app/react-native: Using experimental Rive runtime backend"
37-
else
35+
if use_legacy
3836
Pod::UI.puts "@rive-app/react-native: Using legacy Rive runtime backend (iOS SDK #{rive_ios_version})"
37+
else
38+
Pod::UI.puts "@rive-app/react-native: Using experimental Rive runtime backend"
3939
end
4040

4141
Pod::Spec.new do |s|
@@ -51,10 +51,10 @@ Pod::Spec.new do |s|
5151

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

54-
if use_rive_new_api
55-
s.exclude_files = ["ios/legacy/**"]
56-
else
54+
if use_legacy
5755
s.exclude_files = ["ios/new/**"]
56+
else
57+
s.exclude_files = ["ios/legacy/**"]
5858
end
5959

6060
s.public_header_files = ['ios/RCTSwiftLog.h']
@@ -65,7 +65,7 @@ Pod::Spec.new do |s|
6565

6666
install_modules_dependencies(s)
6767

68-
if use_rive_new_api
68+
unless use_legacy
6969
s.xcconfig = { 'OTHER_SWIFT_FLAGS' => '$(inherited) -DRIVE_EXPERIMENTAL_API' }
7070
end
7171
end

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,16 @@ android {
111111
targetCompatibility JavaVersion.VERSION_1_8
112112
}
113113

114-
def useNewRiveApi = rootProject.findProperty('USE_RIVE_NEW_API') == 'true'
114+
def useLegacy = rootProject.findProperty('USE_RIVE_LEGACY') == 'true'
115115

116116
sourceSets {
117117
main {
118118
java.srcDirs += ["generated/java",
119119
"generated/jni"]
120-
if (useNewRiveApi) {
121-
java.srcDirs += ["src/experimental/java"]
122-
} else {
120+
if (useLegacy) {
123121
java.srcDirs += ["src/legacy/java"]
122+
} else {
123+
java.srcDirs += ["src/experimental/java"]
124124
}
125125
}
126126
}

example/android/gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ newArchEnabled=true
3838
# If set to false, you will be using JSC instead.
3939
hermesEnabled=true
4040

41-
USE_RIVE_NEW_API=true
42-
4341
# Rive: skip auto-init so RiveRuntime.initialize() must be called from JS.
4442
# Useful for testing init failure handling via the Runtime Init exerciser.
4543
# Rive_RiveRuntimeAndroidSkipSetup=true

example/ios/Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ PODS:
17541754
- React-logger (= 0.79.2)
17551755
- React-perflogger (= 0.79.2)
17561756
- React-utils (= 0.79.2)
1757-
- RiveRuntime (6.17.0)
1757+
- RiveRuntime (6.18.0)
17581758
- RNCAsyncStorage (2.2.0):
17591759
- DoubleConversion
17601760
- glog
@@ -1904,7 +1904,7 @@ PODS:
19041904
- ReactCommon/turbomodule/core
19051905
- RNWorklets
19061906
- Yoga
1907-
- RNRive (0.3.1):
1907+
- RNRive (0.4.0):
19081908
- DoubleConversion
19091909
- glog
19101910
- hermes-engine
@@ -1928,7 +1928,7 @@ PODS:
19281928
- ReactCodegen
19291929
- ReactCommon/turbomodule/bridging
19301930
- ReactCommon/turbomodule/core
1931-
- RiveRuntime (= 6.17.0)
1931+
- RiveRuntime (= 6.18.0)
19321932
- Yoga
19331933
- RNScreens (4.18.0):
19341934
- DoubleConversion
@@ -2379,12 +2379,12 @@ SPEC CHECKSUMS:
23792379
ReactAppDependencyProvider: 04d5eb15eb46be6720e17a4a7fa92940a776e584
23802380
ReactCodegen: c63eda03ba1d94353fb97b031fc84f75a0d125ba
23812381
ReactCommon: 76d2dc87136d0a667678668b86f0fca0c16fdeb0
2382-
RiveRuntime: 1c18823e5fd2b88f09666cf7c7ba14da7b8d52a4
2382+
RiveRuntime: 67df68cb59eeee7334a6c6656230393986858ac3
23832383
RNCAsyncStorage: a1c8cc8a99c32de1244a9cf707bf9d83d0de0f71
23842384
RNCPicker: 28c076ae12a1056269ec0305fe35fac3086c477d
23852385
RNGestureHandler: 6b39f4e43e4b3a0fb86de9531d090ff205a011d5
23862386
RNReanimated: 66b68ebe3baf7ec9e716bd059d700726f250d344
2387-
RNRive: 3909767b7ea667f114816356e508cc83954a4a30
2387+
RNRive: deeb388054707b87f7bbbe783f560b4fb656efab
23882388
RNScreens: f38464ec1e83bda5820c3b05ccf4908e3841c5cc
23892389
RNWorklets: b1faafefb82d9f29c4018404a0fb33974b494a7b
23902390
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748

0 commit comments

Comments
 (0)