Repository navigation
Conversation
…x state A view can set _appliesOwnBoxStyle to tell core it applies its own padding, borders, border radii, backgrounds, box shadows and clip path. For those views the style values are still stored and read back as usual, but core skips the state it derives from them (effective paddings and border widths, and the Background object rebuilt on each change). Views that don't set the flag behave exactly as before.
|
View your CI Pipeline Execution ↗ for commit 1fdc8bb
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a view tell core it paints its own padding, borders and backgrounds, so core can skip the state it would derive from them.
What changes
A view can set
_appliesOwnBoxStyle = true. For those views:effectivePadding*andeffectiveBorder*Width;Backgroundobject it rebuilds on every background, border, radius, box-shadow or clip-path change.Views that don't set the flag behave exactly as before.
The use case is a layout plugin that draws boxes itself.
@triniwiz/nativescript-masonkitpaints these properties natively and never reads the derived state, but core still rebuilt it for every declaration on every view. Older cores ignore the flag, so the plugin can set it unconditionally.Numbers
xplat-benchmarks
ns-core-mason-perf, with masonkit setting the flag, size M, interleaved runs. Time to attach:Screenshots were identical.
Testing
own-box-style.spec.ts. A flagged view keeps its style values but skips the derived paddings, border widths andBackground. An unflagged view still derives them.