No way to know when ViewModelImageProperty.set() has been applied (listener is a no-op on the new backend)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 44/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- react-native, typescript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 158
- Forks
- 17
- Merge medio
- 4 d 4 h
- PR fusionados (30 d)
- 23
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de 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 againPosiblemente ocupada @mfazekas la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
rive-app/rive-nitro-react-native#448 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rive-app/rive-nitro-react-native#424 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Rive drains battery in the background on AndroidPosiblemente ocupada @mfazekas la tomó hace 28 días. Abiertoandroid bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
rive-app/rive-nitro-react-native#413 ·
Los mantenedores suelen responder en 1 día
-
enhancement iOS
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rive-app/rive-nitro-react-native#58 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de rive-app/rive-nitro-react-native
Issues similares
-
FR: Support CJK brackets, symbols and full-width markers in footnoteHeuristics (EBPAJ support)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
readest/readest#7413 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
content triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
eliasstravik/herdr-projects#788 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Ability to edit tagsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día