Re:Web Components Will Outlive Your JavaScript Framework
by candiddevmike on Wednesday October 25, 2023 @01:19PM
(#38015341)
So you want to inline JavaScript, similar to CSS and the `style` attribute?
[ Parent
| on HN ]
Re:Web Components Will Outlive Your JavaScript Framework
by recursivedoubts on Wednesday October 25, 2023 @02:03PM
(#38016008)
I would prefer something more like what htmx has in hx-trigger:
https://htmx.org/attributes/hx-trigger/
w/ an explicit and declarative syntax, but that attribute is fairly involved
this was a brief exercise in thinking about the minimal changes necessary to HTML to support something like htmx, and unfortunately there isn't any attribute that maps to hx-trigger in the same way there is for other htmx attributes, so I resorted to the on* attributes + generalizing the submit() function on forms.
Re:Web Components Will Outlive Your JavaScript Framework
by Spivak on Wednesday October 25, 2023 @05:28PM
(#38018630)
Yes and no. You wouldn't call a <form> inlining JS while it does come with some degree of interaction. It would be an expansion of HTML to include a few new things to (ideally) enable a wider rage of lightly-interactive websites to be HTML only.