developit / undom

🍩 1kb minimally viable DOM Document implementation
https://npm.im/undom
MIT License
662 stars 25 forks source link

Fix default tree #10

Closed lukeed closed 7 years ago

lukeed commented 7 years ago

By default, the undom tree was:

<#document>
  <body></body>
</#document>

The documentElement was pointing to itself & there was no document.head reference or element.

This PR changes it to:

<#document>
  <html>
    <head></head>
    <body></body>
  </html>
</#document>

The documentElement reference correctly points to html and document.head is now defined.


How would one create undom plugins? Are there any examples to look at?

lukeed commented 7 years ago

Hey bud, verdict? 😃

I made the mistake of making PR from master. And I'm being silly & withholding commits that definitely don't belong here. Derpaderp

developit commented 7 years ago

Looks good to me. Plugins we need to add a .use() method that passes document to the given plugin function.

developit commented 7 years ago

Gotta bump major for this one.

lukeed commented 7 years ago

Thanks ! 🙏