chinedufn / percy

Build frontend browser apps with Rust + WebAssembly. Supports server side rendering.
https://chinedufn.github.io/percy/
Apache License 2.0
2.26k stars 84 forks source link

WIP: Comments #110

Closed dbrgn closed 5 years ago

dbrgn commented 5 years ago

Initial draft for adding user defined comment support.

Most of it was straightforward, although some parts should probably be refactored in the future since it's getting boilerplate-y.

The main open question I'm facing right now is in crates/virtual-dom-rs/src/patch/apply_patches.rs:

        Node::COMMENT_NODE => {
            // At this time we do not support user entered comment nodes, so if we see a comment
            // then it was a delimiter created by virtual-dom-rs in order to ensure that two
            // neighboring text nodes did not get merged into one by the browser. So we skip
            // over this virtual-dom-rs generated comment node.
        }

How do we deal with the <!-- ptns --> comments?

chinedufn commented 5 years ago

@dbrgn thanks for putting this together!

This main question that comes to mind for me is - what is the use case for being able to create comment nodes?

Thanks!

dbrgn commented 5 years ago

This main question that comes to mind for me is - what is the use case for being able to create comment nodes?

In my case, trying to work around a browser bug by inserting a comment node after a <br> element.

chinedufn commented 5 years ago

Gotcha thanks for the context!

dbrgn commented 5 years ago

I'll close this for now since I don't currently have the time to continue the development of this feature.

If someone wants to take over, feel free!