News for hackers. Stuff that matters.
Re:Is htmx Just Another JavaScript Framework? by nine_k on Thursday January 11, 2024 @01:06PM (#38956070)
But how about Web Components? Finally, it seems, there's something reusable, and something reasonably framework-neutral.
Re:Is htmx Just Another JavaScript Framework? by bobthepanda on Thursday January 11, 2024 @01:31PM (#38956504)
is it that nice?

the beauty of HTML markup is that it's declarative. at least from the tutorials I've seen, WebComponents drag you firmly back into imperative land with document.addChild everywhere.

Re:Is htmx Just Another JavaScript Framework? by nine_k on Thursday January 11, 2024 @07:03PM (#38961517)
The imperative part is required to build a Web Component.

When you merely import it. you can use it as declaratively as any other HTML tag. Basically Web COmponents allow you to add your own tags that are rendered as components, and freely mix "built-in" and "custom" DOM nodes in your document.

Re:Is htmx Just Another JavaScript Framework? by sharlos201068 on Saturday January 13, 2024 @07:37AM (#38979405)
I'm pretty sure a declarative shadow Dom is currently in the works.
Re:Is htmx Just Another JavaScript Framework? by paulddraper on Thursday January 11, 2024 @02:05PM (#38957130)
Web Components are how you can create user-land HTML elements.

But there is a widespread desire for better native HTML elements.

E.g., a date range input.

Re:Is htmx Just Another JavaScript Framework? by nine_k on Thursday January 11, 2024 @07:09PM (#38961581)
I'd say that it's the other way around, and native elements that are not system-dependent (say, a video player) should lose prominence. There's no reason to have a "native-looking" button on a web page, which otherwise cannot (and should not) be made native-looking.

Instead I expect the industry to stabilize around a few widespread sets of web components, much like a lot of CSS for controls stabilized around Bootstrap's styles.

Re:Is htmx Just Another JavaScript Framework? by troupo on Friday January 12, 2024 @02:26AM (#38965102)
Which controls stabilized around Bootstrap styles (now there's a a name I haven't heard in a long time)?

No, industry should not and will not stabilize around "few widespread sets". For the simple reason: it's extremely difficult to create a proper userland UI control in the browser. How many custom drop downs fail even the most basic keyboard behaviours? How many custom UI elements fail even the most basic screenreader interactions? etc. etc.

What you really truly need is a rich browser-native set if controls, and https://open-ui.org/ is slowly working towards that.

Related: You can't capture the nuance of my form fields https://web.archive.org/web/20230208235009/https://drewdevau...

Re:Is htmx Just Another JavaScript Framework? by troupo on Thursday January 11, 2024 @02:56PM (#38958033)
You will need to wait another 10-15 years before they overcome the issues that they caused for themselves (while twisting and contorting the platform in unpredictable ways): https://threadreaderapp.com/thread/1717580502280867847