News for hackers. Stuff that matters.
Re:Astro framework lowers competitors by ~40% on performance... by gochi on Wednesday July 05, 2023 @11:40AM (#36601970)
You're basically suggesting implementing JS within HTML, which htmx exists on a technicality, but not sure that's something we should be pushing at all. We're just spreading JS problems to HTML which is a perfectly fine language.
Re:Astro framework lowers competitors by ~40% on performance... by bobthepanda on Wednesday July 05, 2023 @12:14PM (#36602564)
Also, JSX is pretty much literally this.

But yes, HTML was clearly designed for producing output markup; but in reality the people who want to generate markup want to handle nested data, if/else, and loops, because that is better than copy pasting a bunch of markup everywhere and occasionally fat-fingering something.

Re:Astro framework lowers competitors by ~40% on performance... by johnmw on Wednesday July 05, 2023 @05:31PM (#36607451)
I'm not sure I follow? I think the GP was just talking about the ability to import other HTML fragments without JS? Something like:

  <fragment href="site-menu.html"/>
Which would load my shared site wide menu html into the parent div.

I'm not sure why JS would be needed here? (i.e in the same way html <select> elements are interactive without needing "JS").

Going a little more out there, what about cross domain imports for easy web component consumption?

  <fragment href="https://weather-widget.org?location=london" />
I can't see how this would be less secure than current cross domain JS imports?

It used to be sorta possible with HTML Imports but that spec got dropped [1].

[1] https://www.w3.org/TR/html-imports/

Re:Astro framework lowers competitors by ~40% on performance... by mrpf1ster on Wednesday July 05, 2023 @07:20PM (#36608623)
Is this not just an iframe?
Re:Astro framework lowers competitors by ~40% on performance... by wruza on Wednesday July 05, 2023 @08:55PM (#36609495)
Iframes are opaque for css, form fields and for js in some sense.