No way to know when ViewModelImageProperty.set() has been applied (listener is a no-op on the new backend)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 44/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react-native, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 158
- Fork
- 17
- Merge trung bình
- 4 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của 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 againCó thể đã có người làm @mfazekas đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
rive-app/rive-nitro-react-native#448 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
rive-app/rive-nitro-react-native#424 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Rive drains battery in the background on AndroidCó thể đã có người làm @mfazekas đã nhận 28 ngày trước. Đang mởandroid bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
rive-app/rive-nitro-react-native#413 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement iOS
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
rive-app/rive-nitro-react-native#58 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rive-app/rive-nitro-react-native
Issue tương tự
-
FR: Support CJK brackets, symbols and full-width markers in footnoteHeuristics (EBPAJ support)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
readest/readest#7413 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
content triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eliasstravik/herdr-projects#788 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Ability to edit tagsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày