Closed WebReflection closed 5 years ago
P.S. a simplified shortcut could also be:
${node => Object.assign(Sub.for(node), {
props: {value: 1 + this.props.rand}
}).render()}
apologies I've just realized the received node is not necessarily the parent
and it's also already unique per invocation so that the static id part is simplified.
Editing the initial request right after posting this.
it's "clean up" duty time, closing all my issues that never had an update 👋
Please add a deprecated / abandoned info in the README, thanks.
As explained in here, I'd like to know if there's any interest in improving the current transformation or if I should just fork this and try to make it work as intended.
There is a little, but huge, change that opens doors for this transformation in a pretty seamless way.
JSX
should become
enabling the following features:
.render()
will be automatically invoked the component would already have updated props (or the same if not computed at runtime).How to transform
The rule is pretty simple:
Should become
So that attributes would be passed as props.
The Template Literal rules
The JSX surrounding parenthesis will mark the beginning and the end of the Template Literal, and holes found outside components should be replaced by
${}
instead of{}
so that this:would become
I hope all details are clear enough.
TBD
I am not sure it makes sense to pass along children, since each component can create those directly in the render method, and use props to define children, i.e.
So, actually, I think for the time being having just the proposed transform would be awesome.
Thank You !!!
You had this idea and I'm trying to make it happen for the whole hyperHTML user-base, which I'm pretty sure would appreciate the possibility of using JSX to simplifying lightweight components usage in hyperHTML instead of Custom Elements.
Thanks in advance for considering this or, eventually, for sharing your thoughts on this.
Best Regards.
Code Pen live here https://codepen.io/WebReflection/pen/MPxBzJ?editors=0010