Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move view injected view controllable to interface #909

Merged
merged 1 commit into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sources/NodesGenerator/Resources/Stencils/Flow.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ internal protocol {{ node_name }}ContextInterface: Context, WindowListener {}
internal protocol {{ node_name }}ContextInterface: Context, RootListener {}
{% else %}
internal protocol {{ node_name }}ContextInterface: Context {}
{% if owns_view %}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
Expand All @@ -28,6 +29,7 @@ internal protocol {{ node_name }}ContextInterface: Context {}
@MainActor
internal protocol {{ node_name }}ViewControllable: {{ view_controllable_type }} {}
{% endif %}
{% endif %}

internal final class {{ node_name }}FlowImp: AbstractFlow
<
Expand Down
11 changes: 11 additions & 0 deletions Sources/NodesGenerator/Resources/Stencils/Interface.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ import {{ import }}
@MainActor
internal protocol {{ node_name }}Listener: AnyObject {}
{% endif %}
{% if node_name != "App" and node_name != "WindowScene" and node_name != "Window" and not owns_view %}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
{% if not view_controllable_mock_contents %}
/// @mockable
{% endif %}
@MainActor
internal protocol {{ node_name }}ViewControllable: {{ view_controllable_type }} {}
{% endif %}

/// @mockable
@MainActor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
@MainActor
internal protocol <nodeName>ContextInterface: Context {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
/// @mockable
@MainActor
internal protocol <nodeName>ViewControllable: <viewControllableType> {}

internal final class <nodeName>FlowImp: AbstractFlow
<
<nodeName>ContextInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import <flowImport>
@MainActor
internal protocol <nodeName>ContextInterface: Context {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
@MainActor
internal protocol <nodeName>ViewControllable: <viewControllableType> {}

internal final class <nodeName>FlowImp: AbstractFlow
<
<nodeName>ContextInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ import <flowImport2>
@MainActor
internal protocol <nodeName>ContextInterface: Context {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
@MainActor
internal protocol <nodeName>ViewControllable: <viewControllableType> {}

internal final class <nodeName>FlowImp: AbstractFlow
<
<nodeName>ContextInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
@MainActor
internal protocol <nodeName>Listener: AnyObject {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
/// @mockable
@MainActor
internal protocol <nodeName>ViewControllable: <viewControllableType> {}

/// @mockable
@MainActor
internal protocol <nodeName>Flow: Flow {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import <interfaceImport>
@MainActor
internal protocol <nodeName>Listener: AnyObject {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
@MainActor
internal protocol <nodeName>ViewControllable: <viewControllableType> {}

/// @mockable
@MainActor
internal protocol <nodeName>Flow: Flow {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import <interfaceImport2>
@MainActor
internal protocol <nodeName>Listener: AnyObject {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
@MainActor
internal protocol <nodeName>ViewControllable: <viewControllableType> {}

/// @mockable
@MainActor
internal protocol <nodeName>Flow: Flow {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ import Nodes
@MainActor
internal protocol ___VARIABLE_productName___ContextInterface: Context {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
/// @mockable
@MainActor
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}

internal final class ___VARIABLE_productName___FlowImp: AbstractFlow
<
___VARIABLE_productName___ContextInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import Nodes
@MainActor
internal protocol ___VARIABLE_productName___Listener: AnyObject {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
/// @mockable
@MainActor
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}

/// @mockable
@MainActor
internal protocol ___VARIABLE_productName___Flow: Flow {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ import Nodes
@MainActor
internal protocol ___VARIABLE_productName___ContextInterface: Context {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
/// @mockable
@MainActor
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}

internal final class ___VARIABLE_productName___FlowImp: AbstractFlow
<
___VARIABLE_productName___ContextInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ import Nodes
@MainActor
internal protocol ___VARIABLE_productName___Listener: AnyObject {}

/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
/// presentation or containment as desired.
/// @mockable
@MainActor
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}

/// @mockable
@MainActor
internal protocol ___VARIABLE_productName___Flow: Flow {}
Expand Down