Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The only way to get out of the current front end hell IMO is if we get client side import:

https://github.com/whatwg/html/issues/2791



I'm aghast at the comments in that thread. They are truly asleep at the wheel.

No wonder the front end is such a disaster with those mindsets running the show.


> I'm aghast at the comments in that thread. They are truly asleep at the wheel.

And the wheel that they're at is the one in a clown car. Which is driving off a cliff.

Just having a custom element `<my-include-html remote-src='...'>`[1] is enough to forgo 50% of the reason for using a front-end framework with a build-step.

[1] One that executes scripts, allows `<style>` tags, etc.


That's a solved problem. You can create a custom element for that with some 5 lines of code. Or use one ready: https://github.com/justinfagnani/html-include-element


And that’s exactly what some people don’t want!


Some people will never be happy


Would this be different from using HTMX to load an HTML partial on page load?

Something like:

  <div hx-trigger="load" hx-get="/header.html"></div>


I mean <script type="module"></script> can do ECMAScript module imports.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: