Skip to content

Add debugging property#148

Merged
tinder-cfuller merged 4 commits intomainfrom
node-debugging
Jul 22, 2022
Merged

Add debugging property#148
tinder-cfuller merged 4 commits intomainfrom
node-debugging

Conversation

@tinder-cfuller
Copy link
Contributor

@tinder-cfuller tinder-cfuller commented Jul 22, 2022

Console Usage Example

When stopped at a breakpoint in a Flow:

(lldb) po tree
▿ Node
  - name : "App"
  ▿ children : 1 element
    ▿ 0 : Node
      - name : "Scene"
      ▿ children : 1 element
        ▿ 0 : Node
          - name : "Window"
          ▿ children : 1 element
            ▿ 0 : Node
              - name : "Root"
              - children : 0 elements

When stopped at a breakpoint in a Context:

(lldb) po flow!.tree
▿ Node
  - name : "App"
  ▿ children : 1 element
    ▿ 0 : Node
      - name : "Scene"
      ▿ children : 1 element
        ▿ 0 : Node
          - name : "Window"
          ▿ children : 1 element
            ▿ 0 : Node
              - name : "Root"
              - children : 0 elements

When stopped at a breakpoint in a FlowController:

(lldb) po tree
▿ Node
  - name : ""
  ▿ children : 1 element
    ▿ 0 : Node
      - name : "Scene"
      ▿ children : 1 element
        ▿ 0 : Node
          - name : "Window"
          ▿ children : 1 element
            ▿ 0 : Node
              - name : "Root"
              - children : 0 elements

Since name will be blank for any FlowController, root can be skipped by performing po tree.children.

@tinder-cfuller tinder-cfuller merged commit e3d2ff0 into main Jul 22, 2022
@tinder-cfuller tinder-cfuller deleted the node-debugging branch July 22, 2022 19:36
Comment on lines +17 to +21
public struct Node {

public let name: String
public let children: [Node]
}
Copy link
Contributor

@tinder-garricnahapetian tinder-garricnahapetian Aug 9, 2022

Choose a reason for hiding this comment

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

Should we add a public init? I'm seeing failures in https://github.com/TinderApp/tinder_ios/pull/34580 related to FlowMock: Flow in various tests with error: protocol requires property 'tree' with type 'Node'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is an unfortunate oversight. I will make a PR 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Will we include this in this release?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or can be in the next one if it is not a blocker.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework Framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants