No way to know when ViewModelImageProperty.set() has been applied (listener is a no-op on the new backend)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 44/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react-native, typescript
Direzione di ricerca
Start by tracing ViewModelImageProperty.set() and addListener() in the React Native package, then inspect the Android and iOS backend implementations mentioned in the issue. Compare how image writes are applied with number and string writes, and check the existing view readiness and frame APIs. Done means providing a reliable signal after a bound write is applied or drawn, with coverage for the reported paused-view behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Versions: @rive-app/react-native 0.5.10 (rive-android 11.14.3, rive-ios 6.29.0), new backend, React Native 0.86. Seen on a Pixel 9 Pro XL.
Problem
Since 0.5.8, imageProperty.set(image) decodes the image asynchronously and applies it later, which fixed the memory growth. But JS has no way to know when the image is actually applied and drawn:
ViewModelImageProperty.addListener()is a no-op on the new backend, on both Android ("Image property listeners not supported in experimental API") and iOS (TODO: image property listener not yet available in concurrency API).set()returnsvoid, not a promise.
Why it matters
We show a static <Image> of an artwork, then hand over to a RiveView that draws the same artwork through an image property. Without a signal, the handover has to be a fixed timer:
- If we swap too early, the Rive view is visible but hasn't drawn the image yet, so it blinks empty. On a Pixel 9 Pro XL the image lands about 450 ms after
awaitViewReady()resolves. - If we swap too late, the view sits still before its animation starts.
- Views we
pause()after a short paint window stay empty for good if the image lands after the pause, because a paused view isn't redrawn.
Number and string writes have the same gap: a view revealed right after stringProperty.set() plus a trigger draws the artboard's baked placeholder for about 0.5 s on Android before the write lands.
Repro
- Load a file with an image property and create a view model instance.
- Mount a
RiveViewbound to it, and callimageProperty.set(image)with aRiveImagefromRiveImages.loadFromURLAsync. - Show the view as soon as
awaitViewReady()resolves: it draws without the image for several hundred ms. - Or call
pause()about 250 ms after ready: the image never appears untilplayIfNeeded().
Request
Any one of these would work:
- Make
ViewModelImageProperty.addListener()fire once a set has been applied. - Have
set()return aPromise<void>that resolves when the value is applied, or better, after the next frame that includes it. - A view-level signal such as
onFrameDrawnorawaitNextFrame()after pending data-binding writes have been processed. - Have a paused view redraw once when a bound image or property changes, so a parked view doesn't stay stale.
Related
Since 0.5.8, a newer set() on the same property cancels one still decoding (the generation counter). That's correct, but setting the same image twice, for example once before the view binds and again after awaitViewReady(), throws away the first decode and delays the image further.
- Lingua principale
- TypeScript
- Stelle
- 158
- Fork
- 17
- Merge medio
- 4g 4h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rive-app/rive-nitro-react-native
-
useDisposableMemo disposes native objects in effect cleanup, so a subtree hidden by React <Activity> crashes in release builds when shown againForse già presa @mfazekas l’ha presa 1 giorno fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rive-app/rive-nitro-react-native#448 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rive-app/rive-nitro-react-native#424 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Rive drains battery in the background on AndroidForse già presa @mfazekas l’ha presa 28 giorni fa. Apertaandroid bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rive-app/rive-nitro-react-native#413 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement iOS
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rive-app/rive-nitro-react-native#58 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rive-app/rive-nitro-react-native
Issue simili
-
FR: Support CJK brackets, symbols and full-width markers in footnoteHeuristics (EBPAJ support)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
readest/readest#7413 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
content triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eliasstravik/herdr-projects#788 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Ability to edit tagsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno