Skip to content

Remove owns_view from Builder-SwiftUI.stencil as not needed#281

Merged
tinder-garricnahapetian merged 1 commit intomainfrom
remove-owns-view-where-not-needed
Dec 20, 2022
Merged

Remove owns_view from Builder-SwiftUI.stencil as not needed#281
tinder-garricnahapetian merged 1 commit intomainfrom
remove-owns-view-where-not-needed

Conversation

@tinder-garricnahapetian
Copy link
Contributor

@tinder-garricnahapetian tinder-garricnahapetian commented Dec 20, 2022

The owns_view flag is never needed in Builder-SwiftUI.stencil because both NodeViewInjectedTemplate and StencilRenderer.renderNodeViewInjected use StencilTemplate.NodeViewInjected().stencils which hard codes its Builder stencil to .builder(.default). In other words, Nodes exposes zero public API for creating a view injected node with the Builder-SwiftUI stencil. Moreover, there should be zero logical reason to do so since the SwiftUI specific code in the Builder file is included only if owns_view is true and it would make zero sense to create a view injected node where owns_view is set to true.

Copy link
Contributor

@tinder-cfuller tinder-cfuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tinder-garricnahapetian tinder-garricnahapetian merged commit 5b5c9fe into main Dec 20, 2022
@tinder-garricnahapetian tinder-garricnahapetian deleted the remove-owns-view-where-not-needed branch December 20, 2022 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

templates Templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants