Closed VsLoureiro closed 8 years ago
Can you provide any further details on this?
Can you trace the error from the library to the part in your code it's coming from so I have a better idea what kind of use is triggering it?
This is the code that triggers it:
xtag.register('custom-element', { prototype: Object.create(HTMLDivElement.prototype) });
So we introduced a breaking change, but the good news is that it was to simplify things: Elements that don't extend natives are automatically prototyped with HTMLElement for you. This means you don't need to add the prototype property at all for the code snippet you pasted here.
Another note: in the final, standard registerElement API, you can only use HTMLElement prototype unless you're truly extending a native (via the is= syntax and the extends definition property), so your code here is technically invalid. Here's what it would need to look like to be valid:
xtag.register('custom-element', { extends: 'div' });
And to use it:
If you're not actually attempting to extend the DIV element and just want a truly custom tag, you don't need to specify a prototype or extends property at all:
xtag.register('custom-element', {
});
To use:
On May 13, 2016 5:49 AM, "Vitor Loureiro" notifications@github.com wrote:
This is the code that triggers it:
xtag.register('custom-element', { prototype: Object.create(HTMLDivElement.prototype) });
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/x-tag/core/issues/152#issuecomment-219033440
Thank you! It works now.
We only had that for our oldest components, for the new one we don't use the prototype property.
Cheers
@VsLoureiro I have a new build up on master that extends the reach of inheritance/composition to mixins and other features. Do you mind grabbing the dist or core on master and testing against your code to ensure we are not breaking anything? All our tests pass currently.
Hi,
Since version 1.5.7, my application does not run anymore and I had to go back to version 1.5.6.
The error is: Uncaught TypeError: Illegal invocation
in line 9129 of x-tag-core.js file