question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

V7 and Document Fragments

See original GitHub issue

I really love new simplified patch usage and the simplified algorithm.

However, it seems we assume that the node.parentNode always exists in https://github.com/jorgebucaran/superfine/blob/master/src/index.js#L265

This works for the most part, but fails when the provided node is a DocumentFragment, since DocumentFragment won’t have a parentNode.

The patch in this case errors out with:

image

To add more context, I have a web-components wrapper based on Superfine, which was invoking the patch in v6 as https://github.com/osdevisnot/supertag/blob/master/src/supertag.ts#L94

With V7, I believe the correct usage would simply be something like:

this[ROOT] = patch(this[ROOT], this.render());

But this fails with above error since this[ROOT] is a DocumentFragment created using

this[ROOT] = this.attachShadow({ mode: 'open' });

Any pointers on how we can use the V7 patch with DocumentFragments? Or am I missing something?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
jorgebucarancommented, Sep 5, 2019

Thank you both! I’ll check this out asap (possibly over the weekend).

1reaction
jorgebucarancommented, Sep 19, 2019

@stken2050 You could use document.body and produce a <body> with your vdom too. The change that you probably missed is that we replace (recycling if possible) your DOM node now, rather than append to it.

I think it would be helpful if you add the information since I think many would test this under document.body directly.

Will do. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

DocumentFragment - Web APIs | MDN
Chrome Edge DocumentFragment Full support. Chrome1. Toggle history Full support. Edge... DocumentFragment() constructor Full support. Chrome29. Toggle history Full support. Edge... append Full support. Chrome54. Toggle...
Read more >
Fragment lifecycle - Android Developers
Each Fragment instance has its own lifecycle. When a user navigates and interacts with your app, your fragments transition through various ...
Read more >
Application Programmer's Guide - IBM
You can also use Rational Rose® Technical Developer V7.0 to generate the proxy-client ... znvwsdl1.wsdl, Use to exchange XML or HTML document fragments....
Read more >
Document Fragments and why you should use them
A document fragment is a fragment of a Document Object Model (DOM) tree, a chunk of tree that's separated from the rest of...
Read more >
@bugsnag/plugin-strip-query-string | Yarn - Package Manager
0 vulnerabilities. @bugsnag/js plugin to strip query string and document fragment from stackframe filenames ... v7.18.0 (2022-09-22). Changed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found