-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
fix(dom): do not duplicate root element with no id #796
base: master
Are you sure you want to change the base?
Conversation
Good to see the thought you put into this. Nice, @bloodyKnuckles :) Before merging, we still need a few things:
Because one test was modified, this means a breaking change. There are 2 things to consider, I think: (1) could we possibly support this new feature without breaking anything? Like, could we only support this feature in the HEAD tag? (2) If not, can we consider what are all the possible breaking changes this will cause and how to best communicate it in a migration guide? E.g. does this mean that nested vnodes like |
I appreciate the opportunity to get up to speed on this type of collaboration—especially on this project. I need more help. I think I merged the previous commits but don't know how to check that to be sure. Also, I added a new test that verifies nested, same-name elements are not squashed into one. I.e.,
...actually produces:
And I started an issue for discussion, issue #798: Proposed Breaking Change: PR #796. |
Good job @bloodyKnuckles and sorry for the delay in reviewing it. I'm curious about travis builds failing though. It usually "fails" for random reasons with Sauce Labs, but this time one of them looks like a real failure:
|
@bloodyKnuckles are you still interested in persuing this? This PR would need a rebase and the failure would have to be debugged |
(I investigated that issue myself and the change still causes timeouts and other issues in the document fragment tests) |
Please, remind me, how do I run the tests on my branch? |
After the rebase, just by using |
I'm trying to locally restore my pull request branch. Before I run the tests I am installing but executing
...errors. This takes a long time then ends with a bunch of:
...errors. I'm using Executing
I tried changing that to |
You need to delete previous node_module installations. And before running the tests you have to rebase, we changed the whole testing setup in thr meantime |
Do not duplicate the root element when not using ID property. For example, without this PR, when simply targeting the HEAD tag it gets duplicated because there is no associated ID. This PR simply gives the
selId
variable a default value of empty string, which correlate it with the default value of empty string given to the ID property of therootElement
object bydocument.querySelector
.make commit
instead ofgit commit
Discussions here: #792 #540
This fix broke two other tests:
These tests worked before because the root tag was duplicated since there was no ID assigned to either the root element nor the parent VDOM object. After fixing the "duplicate bug" the root tag was no longer duplicated causing the tests to fail.
I added an ID to the root VDOM objects—now all tests pass.
Also, to get a working test I added a<footer>
tag to the test index.html file, in order to be able to get a "clean" root element and parent VDOM object. My attempts to usecreateRenderTarget
failed to test the fix, my guess is because dynamically adding a DOM object for the root element always created an (empty string) ID, rather than the neededundefined
—and using the HEAD tag broke most tests.I realize the broke "bubbling" tests showed me how to test the fix without adding the
<footer>
tag to the test index.html file. So I cleaned the test up.Glad to be learning these tools so thanks for the guidance and let me know if I need to do anything different.