Skip to content

perf(example): initialize animation and page resources lazily - #1136

Open
OskarEichler wants to merge 1 commit into
callstack:masterfrom
OskarEichler:codex/pager-example-animation
Open

perf(example): initialize animation and page resources lazily#1136
OskarEichler wants to merge 1 commit into
callstack:masterfrom
OskarEichler:codex/pager-example-animation

Conversation

@OskarEichler

@OskarEichler OskarEichler commented Aug 27, 2026

Copy link
Copy Markdown

Summary

perf(example): initialize animation and page resources lazily. Fixes #1119.

Compatibility / observable changes

Example-only: resource lifetime and animation drivers are unchanged; discarded initializer work is removed.

Implementation

Carousel examples allocate new Animated.Values on every render. The change is kept independent from the other source-review fixes. This contribution is AI-assisted.

Test Plan

  • Real React renderer checks verify both carousel examples retain their animation values across updates. Page/route initializer changes preserve their existing initial values.
  • Each independent PR's source overlay passes the root TypeScript check.
  • Combined review branch: bun run typescript, bun run lint (zero errors; 25 existing example warnings), bun run prepare, and git diff --check pass.
  • Combined example: Android Debug (./gradlew assembleDebug --max-workers=4), iOS Simulator Release (xcodebuild, signing disabled), and both production Metro bundles pass with its RN 0.85.3 dependencies.
  • Across the combined changes: 26 JS/React, 15 UIKit/provider, six ObjC++ and 21 Kotlin checks pass. Native API doubles and real UIKit execution are distinguished above.
  • Clean packaging of the combined branch includes the independent declaration-output fix proposed for Clean install fails because generated declarations do not match the package types entrypoint #1109; other PRs do not silently include that unrelated change.

No checked-in test files were added or modified. The existing Jest suite contains one TODO and no executed tests; focused external diagnostics provide the behavioral checks.

Prerequisites and reproduction

See #1119 for the baseline, reproduction and proposed fix.

Checklist

  • Tested on a physical device
  • Complete OS/device matrix

Downstream RN 0.87.1 verification

The combined 9.0.2 consumer artifact is pinned at 35a43b89b9e658c926a647a5b8bf9c7863e73771. Immutable install and byte comparison of all 66 non-metadata files pass. Both Android Debug variants, both iOS Debug Simulator variants, four production Metro bundles, 13 web builds, four extension builds and app lint pass. The first Android attempt encountered a concurrent web-output replacement during Gradle input hashing; serial rerun passed. The upstream iOS example also launches and renders its home screen. This does not cover physical devices or the complete Maestro interaction matrix.

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.

Carousel examples allocate new Animated.Values on every render

1 participant