| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Consolidating padding into paddingInternal (#11216) deleted the [padding*Property.setNative] and [padding*Property.getDefault] handlers from Button, Label, LayoutBase, TextBase, TextField and TextView. The per-property native handlers are the extension surface plugins build on: a subclass that overrides one and chains with super[paddingTopProperty.setNative](value) now throws, and one that overrides to suppress core's padding application is silently bypassed, since padding flows through paddingInternal around it. The handlers are back, restructured so the single-native-write goal of the consolidation still holds: each per-side handler stages its side into a pending struct, and [paddingInternalProperty.setNative] seeds that struct from the current native padding, drives the four per-side handlers - subclass overrides included - and commits one native write. A side whose override does not chain to super keeps its current native value, which is what suppression looked like before. The getDefault handlers return the same values they used to. Standalone invocations of a per-side handler are no-ops: every padding change also updates paddingInternal, which performs the flush.
|
View your CI Pipeline Execution ↗ for commit d333b18
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at 2026-08-27 00:18:57 UTC |
Sorry, something went wrong.
npm i https://pkg.pr.new/@nativescript/core@11368 npm i https://pkg.pr.new/@nativescript/vite@11368 npm i https://pkg.pr.new/@nativescript/webpack@11368 commit: d333b18 |
Sorry, something went wrong.
An override of a per-side [padding*Property.setNative] handler exists to intercept padding application - suppress it, transform the value, or redirect it to a different native mechanism. The consolidated paddingInternal write applied padding around such overrides, so the interception never mattered. When a subclass overrides any of the four handlers (detected once per constructor), the consolidated write now stands down and the property machinery drives the per-side handlers directly, each applying its own side - the pre-consolidation behavior, including not touching the native view at all for a suppressed side. Without overrides the staged single-write path is unchanged. The android handlers also honor the value argument again instead of reading the effective value, so chaining super with a transformed value applies that value - as it did before the consolidation. The ios handlers keep reading effective values, which is what they always did.
| Back | FazBrowse Home | New Git URL |
PR Checklist
What is the current behavior?
#11216 consolidated padding application into an internal paddingInternal property and deleted the per-side [padding*Property.setNative] / [padding*Property.getDefault] handlers from Button (iOS + Android), Label (iOS), LayoutBase (Android), TextBase (Android), TextField (iOS) and TextView (iOS).
Those per-property native handlers are the de-facto public extension surface every plugin builds on. Two breakages for subclasses (e.g. @nativescript-community/ui-label):
TypeError: (intermediate value)[paddingLeftProperty.setNative] is not a function at applyAllNativeSetters (ui/core/properties/index.js) at initNativeView …What is the new behavior?
The per-side handlers are restored on all six classes, restructured so #11216's one-native-write goal still holds:
So: super[padding*Property.setNative] resolves again (no crash), override semantics work again, and padding is still applied in one native call per update.
New regression spec (padding-native-protocol.spec.ts): asserts the handlers exist on the affected prototypes and exercises the exact plugin pattern — a subclass handler chaining to super — without throwing. 426 unit tests passing, core:build clean for both platforms.
Update (d333b1821): the consolidated write now stands down entirely when a subclass overrides any per-side handler (detected once per constructor). In that case the property machinery drives the per-side handlers directly, each applying its own side — full pre-#11216 semantics:
Views with no overrides keep the staged single-native-write path. The spec now covers all of the above against a stubbed native view.