Skip to content

perf(ux): drive Skeleton pulse on the reanimated UI thread#140

Merged
os-zhuang merged 1 commit into
mainfrom
perf/skeleton-reanimated-pulse
Jun 11, 2026
Merged

perf(ux): drive Skeleton pulse on the reanimated UI thread#140
os-zhuang merged 1 commit into
mainfrom
perf/skeleton-reanimated-pulse

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

The loading Skeleton pulsed by calling setState on every RAF frame. A loading list renders ~15 skeletons, so that's ~15 × 60 React re-renders per second just to breathe.

Moved the looped opacity (1 → 0.4 → 1, eased) to a reanimated shared value + UI-thread worklet (withRepeat/withSequence/withTiming). Identical pulse, zero React re-renders, smoother on device.

Bridges the perceived-speed and visual-craft tracks.

Verification

  • tsc --noEmit clean, eslint clean
  • 1337 tests pass (2 Skeleton snapshots updated for the ViewAnimated.View structure)
  • Behavior-preserving refactor: same visual pulse, driven more cheaply.

🤖 Generated with Claude Code

The skeleton pulse previously called setState on every animation frame, so
a loading list of ~15 skeletons re-rendered React ~15×60 times/sec. Move
the looped opacity (1 → 0.4 → 1) to a reanimated shared value + UI-thread
worklet: identical breathing, zero React re-renders, smoother on device.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@os-zhuang os-zhuang merged commit 53bde47 into main Jun 11, 2026
3 checks passed
@os-zhuang os-zhuang deleted the perf/skeleton-reanimated-pulse branch June 11, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant