Closed KonnorRogers closed 2 years ago
Use a real shadowDOM printer!
fixes #42
There needs to be some more robust testing, but in manually checking triple-nested-shadow-roots it works as expected.
stdout | __tests__/pretty-shadow-dom.test.tsx > It should render 3 shadow root instances <body> <div> <triple-shadow-roots> <ShadowRoot> <nested-shadow-roots> <ShadowRoot> <duplicate-buttons> <ShadowRoot> <slot name="start" /> <button> Button One </button> <br /> <slot /> <br /> <button> Button Two </button> <slot name="end" /> </ShadowRoot> </duplicate-buttons> </ShadowRoot> </nested-shadow-roots> </ShadowRoot> </triple-shadow-roots> </div> </body>
There's large amount of white space due to how node.childNodes works. This is expected and how prettyDOM works today due to "significant whitespace"
node.childNodes
I'll look to see if theres a way to strip this out in the future.
Use a real shadowDOM printer!
fixes #42
There needs to be some more robust testing, but in manually checking triple-nested-shadow-roots it works as expected.
There's large amount of white space due to how
node.childNodes
works. This is expected and how prettyDOM works today due to "significant whitespace"I'll look to see if theres a way to strip this out in the future.