Things are getting a bit crazy now, but it SEEMS to work? Anyone feel like weighing in?
Things this would allows us to do:
Achieve (almost) parity between the attributes and properties of an element. You could do <three-mesh position.x="5"> just like you could do meshElement.position.x = 5.
Very likely significantly simplify our attribute handling code.
Potential problems:
this makes us much more dependent on changes in Three.js itself. If Three.js ever introduces a property named, say, mountedCallback, it would break our entire setup because we couldn't possibly reflect that property on elements (because they already have a mountedCallback.) You could argue that the chances that Three.js will ever have a mountedCallback are extremely slim, but this was just an example -- it will generally apply to all properties that may already exist on HTMLElements and classes derived from it (like the ones we provide.)
I don't intend to merge this change any time soon -- just wanted to put it out there for discussion.
Things are getting a bit crazy now, but it SEEMS to work? Anyone feel like weighing in?
Things this would allows us to do:
<three-mesh position.x="5">
just like you could domeshElement.position.x = 5
.Potential problems:
mountedCallback
, it would break our entire setup because we couldn't possibly reflect that property on elements (because they already have amountedCallback
.) You could argue that the chances that Three.js will ever have amountedCallback
are extremely slim, but this was just an example -- it will generally apply to all properties that may already exist on HTMLElements and classes derived from it (like the ones we provide.)I don't intend to merge this change any time soon -- just wanted to put it out there for discussion.