perf(core): reduce padding native setter calls#11216
Conversation
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx test apps-automated -c=ios |
❌ Failed | 21m 14s | View ↗ |
nx run-many --target=test --configuration=ci --... |
✅ Succeeded | 1s | View ↗ |
☁️ Nx Cloud last updated this comment at 2026-05-16 17:16:58 UTC
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (16)
💤 Files with no reviewable changes (1)
WalkthroughThis PR consolidates padding handling across the NativeScript UI framework by introducing a single ChangesPadding Property Consolidation
🎯 4 (Complex) | ⏱️ ~60 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |

PR Checklist
What is the current behavior?
Right now, core calls padding native setter method (e.g. setPadding) for each shorthand property.
In a few words, setting css
paddingwill call native setter 4 times.What is the new behavior?
The new approach ensures padding keeps its shorthand identity and reduces the native setter calls at the same time.
This is achieved by sticking to core's practices:
Following a couple of rules helps make use of core's batch update mechanism and its suspendedUpdates bag that stores pending updates per property key.
This is where
paddingInternalcomes to play and as a property it makes sure there's only one single update in the bag.To trigger updates for the new property we set its value to be the 4 padding props as a concatenated string.
Then, the
setNativecorresponding method will use the 4effectivePaddingprops to update native view padding.Additionally, the PR improves the way default paddings are restored for both platforms by replacing effective padding props with getters and at the same time removes repetitive code here and there.
Closes #8335