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

Improve Debug format output for VTag and VText #1059

Merged
merged 16 commits into from
Mar 29, 2020

Conversation

dancespiele
Copy link
Contributor

Allow get the complete vnode structure using debug implementation

src/virtual_dom/vnode.rs Outdated Show resolved Hide resolved
@jstarry
Copy link
Member

jstarry commented Mar 29, 2020

@dancespiele could you please post the debug output of vtag and vcomp? I'm curious how they look :)

@dancespiele
Copy link
Contributor Author

for VTag the debug is this:

    VTag {
        tag: "button",
        reference: None,
        listeners: [
            Listener { kind: onclick },
        ],
        attributes: {},
        children: VList {
            children: [
                VList {
                    children: [
                        VTag {
                            tag: "div",
                            reference: None,
                            listeners: [],
                            attributes: {
                                "id": "parent",
                            },
                            children: VList {
                                children: [
                                    VText {
                                        text: "parent",
                                        reference: None,
                                    },
                                ],
                                elide_placeholder: true,
                            },
                            classes: Classes {
                                set: {},
                            },
                            value: None,
                            kind: None,
                            checked: false,
                            node_ref: NodeRef(
                                RefCell {
                                    value: NodeRefInner {
                                        node: None,
                                        link: None,
                                    },
                                },
                            ),
                            captured: [],
                        },
                    ],
                    elide_placeholder: false,
                },
            ],
            elide_placeholder: true,
        },
        classes: Classes {
            set: {
                "button",
                "standard",
                "medium",
                "regular",
                "test-button",
            },
        },
        value: None,
        kind: None,
        checked: false,
        node_ref: NodeRef(
            RefCell {
                value: NodeRefInner {
                    node: None,
                    link: None,
                },
            },
        ),
        captured: [],
    }

but for vcom only this:

Vcomp

let me see if I can get something better for vcomp

@jstarry
Copy link
Member

jstarry commented Mar 29, 2020

Wow, VTag looks great!

src/virtual_dom/vlist.rs Outdated Show resolved Hide resolved
@jstarry jstarry changed the title Better vnode format Improve Debug format output for VTag and VText Mar 29, 2020
@jstarry jstarry merged commit b989494 into yewstack:master Mar 29, 2020
@jstarry
Copy link
Member

jstarry commented Apr 4, 2020

🎉 released in v0.14.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants