Extract applySynchronousUpdates from performOperations#9078
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extracts the synchronous UI props update logic from the performOperations method into a dedicated applySynchronousUpdates method. It also introduces two helper functions: shouldUseSynchronousUpdatesInPerformOperations (compile-time feature flag check) and partitionUpdates (splits props into synchronous and shadow tree batches).
Changes:
- Added
shouldUseSynchronousUpdatesInPerformOperations()as aconstexprfunction in an anonymous namespace, consolidating the platform-specific feature flag checks that were previously inlineif constexprblocks. - Added
partitionUpdates()to separate update batches into synchronous and shadow tree props, replacing the inline partitioning logic that previously existed in both Android and iOS codepaths. - Extracted the Android and iOS synchronous update application logic into the new
applySynchronousUpdatesmember method.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
ReanimatedModuleProxy.h |
Declares the new applySynchronousUpdates private method. |
ReanimatedModuleProxy.cpp |
Adds shouldUseSynchronousUpdatesInPerformOperations, partitionUpdates helpers and applySynchronousUpdates method; refactors performOperations to use them. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ea4bdef to
8b85857
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
## Summary Separates the synchronous UI props update logic into its own `applySynchronousUpdates` method. Adds `partitionUpdates` and `shouldUseSynchronousUpdatesInPerformOperations` helpers to support the extracted method. ## Test plan
## Summary Separates the synchronous UI props update logic into its own `applySynchronousUpdates` method. Adds `partitionUpdates` and `shouldUseSynchronousUpdatesInPerformOperations` helpers to support the extracted method. ## Test plan
Separates the synchronous UI props update logic into its own `applySynchronousUpdates` method. Adds `partitionUpdates` and `shouldUseSynchronousUpdatesInPerformOperations` helpers to support the extracted method.
Summary
Separates the synchronous UI props update logic into its own
applySynchronousUpdatesmethod.Adds
partitionUpdatesandshouldUseSynchronousUpdatesInPerformOperationshelpers to support the extracted method.Test plan