Skip to content

Commit 864f718

Browse files
authored
fix: regenerate nitrogen files for nitro-modules 0.31.10 (#72)
* fix: regenerate nitrogen files for nitro-modules 0.31.10 PR #40 was merged with nitrogen files generated by nitro-modules@0.31.8. PR #64 upgraded to nitro-modules@0.31.10 but was developed before PR #40 merged, so it didn't regenerate ViewModelImageProperty. The new nitro-modules version requires JNICallable.hpp include. * fix(android): fix HybridViewModelImageProperty addListener type mismatch The listeners property is MutableList<(Unit) -> Unit> but onChanged is () -> Unit. Wrap in lambda to match the expected signature, same pattern as TriggerProperty. * fix(android): fix updateAsset call signature after PR #63 refactor PR #63 changed updateAsset from 3 args to 2 args (removed context) in ReferencedAssetLoader but missed updating the call site in HybridRiveFile. * fix(ci): force turbo rebuild on stale cache fallback match
1 parent 1f325e7 commit 864f718

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ jobs:
103103
uses: ./.github/actions/setup
104104

105105
- name: Cache turborepo for Android
106+
id: turbo-cache-android
106107
uses: actions/cache@v4
107108
with:
108109
path: ${{ env.TURBO_CACHE_DIR }}
@@ -144,6 +145,7 @@ jobs:
144145
- name: Build example for Android
145146
env:
146147
JAVA_OPTS: "-XX:MaxHeapSize=6g"
148+
TURBO_FORCE: ${{ steps.turbo-cache-android.outputs.cache-hit != 'true' }}
147149
run: |
148150
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
149151
@@ -160,6 +162,7 @@ jobs:
160162
uses: ./.github/actions/setup
161163

162164
- name: Cache turborepo for iOS
165+
id: turbo-cache-ios
163166
uses: actions/cache@v4
164167
with:
165168
path: ${{ env.TURBO_CACHE_DIR }}
@@ -208,5 +211,7 @@ jobs:
208211
key: ${{ steps.cocoapods-cache.outputs.cache-key }}
209212

210213
- name: Build example for iOS
214+
env:
215+
TURBO_FORCE: ${{ steps.turbo-cache-ios.outputs.cache-hit != 'true' }}
211216
run: |
212217
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

android/src/main/java/com/margelo/nitro/rive/HybridRiveFile.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,12 @@ class HybridRiveFile : HybridRiveFileSpec() {
6969
val assetsData = referencedAssets.data ?: return
7070
val cache = referencedAssetCache ?: return
7171
val loader = assetLoader ?: return
72-
val context = NitroModules.applicationContext ?: return
7372

7473
val loadJobs = mutableListOf<kotlinx.coroutines.Deferred<Unit>>()
7574

7675
for ((key, assetData) in assetsData) {
7776
val asset = cache[key] ?: continue
78-
loadJobs.add(loader.updateAsset(assetData, asset, context))
77+
loadJobs.add(loader.updateAsset(assetData, asset))
7978
}
8079

8180
if (loadJobs.isNotEmpty()) {

android/src/main/java/com/margelo/nitro/rive/HybridViewModelImageProperty.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class HybridViewModelImageProperty(private val viewModelImage: ViewModelImagePro
1515
}
1616

1717
override fun addListener(onChanged: () -> Unit) {
18-
listeners.add(onChanged)
18+
listeners.add { _ -> onChanged() }
1919
ensureValueListenerJob(viewModelImage.valueFlow.map { })
2020
}
2121
}

nitrogen/generated/android/c++/JHybridViewModelImagePropertySpec.cpp

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)