Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Dynamic prop/attr names #124
Comments
|
@developit any thoughts? I can devote some time for a PR. |
|
TBH it doesn't seem like these fit with the minimalistic philosophy of htm. They are all relatively easy to accomplish already using objects, and the resulting output (when not over-transpiled) represents a real improvement over what we'd have to do to support the sugared syntax in HTM's parser. let _data = Symbol('data')
html`<a ...${{ [_data]: data }} />`
// output:
h('a', { [data]: data })Regarding the last example, this might be interesting to you (demo): function draggable(el) {}
draggable['data-draggable'] = true;
html`<a ...${draggable}/>` |
#121 suggests distinguishing min / max philosophies, since that's already shipped. Would it be nice to have htm-max with syntactic sugar/sauce (html-compatible, validation, unclosed tags, dynamic attributes), and keep htm-min JSX-compatible? |
|
I'd like to point out that htm/mini is functionally identical to the regular htm. |
What is this argued by? What are the pros having it identical? Or, rather, what's the point of This distinction potential seems to be underdeveloped. |
|
Their only real difference is that Currently the point of |
Not the same as #109.
That would be useful to have insertable attribute names:
Practical cases
Optional attributes:
Private props:
Anonymous props:
@developit @jviide would you consider that feature?