feat: Add native support for custom elements. #715
You can now pass custom element constructors as the node name of a virtual element. This was implemented at the diff level so that it could efficiently, and correctly, check based on constructors as opposed to somehow determining the node name and reusing the existing algorithms. This is both more efficient than the aforementioned and spec compliant.
I need to spend some time with this one. There are things in here that could impact the non-WC use-cases and I'd like to write some tests / benches around those to be very sure.
Definitely a vote for the duck-type checking of HTMLElement - that's super important, we had to do the same thing for
Ok, so I've done the following:
If I tried moving the custom element check up where you suggested (where it checks if the
I just rebased and squashed the refactors so there's no breaking commits in between.
- No destructuring - No lowercase() function, use .toLowerCase() instead - Favour property access (no variable saving, unless necessary) - Use `'nodeName' in vnodeName.prototype` instead of HTMLElement instance checking