5 comments

  • OkayPhysicist3 hours ago
    This is remarkably useful. Even ignoring the built-in commands (which are handy in their own right), I find the button's action being self-described in the html ("tell this element to do this") far more pleasant to read than the normal see button -> /document.getElementById("buttonID") -> scroll back up to the html to figure out what elements are referred to in the script.
    • sheept3 hours ago
      To be fair, there&#x27;s little stopping you from putting the button action in its onclick attribute.<p>I guess the stylistic choice of separating content, style, and interactivity eventually became a convention to keep JavaScript isolated from HTML, but nowadays with Tailwind and HTMX, it does seem like at least some developers want everything in HTML, for the strengths you mentioned.
  • maqnius2 days ago
    I just noticed, that Invoker Commands are available across all major browsers. Good to see that HTML progresses to make Javascript redundant for basic UX.
    • spartanatreyu3 hours ago
      It&#x27;s nice, but it&#x27;s not quite ready for use yet.<p>It&#x27;s not supported on the previous main version of Safari, so everyone following the &quot;last two major versions&quot; of browser support rule can&#x27;t use them.<p>Also, it&#x27;s currently limited to only dialogs and popovers (and custom events, but in those cases you need js anyway).<p>It&#x27;ll be more useful once it can control:<p>- details (open, close, toggle)<p>- video (play, pause, toggle play state, set seek point, mute, set volume)<p>- select (open&#x2F;close widget, set&#x2F;unset value(s))<p>- input (open&#x2F;close widget, set&#x2F;unset value(s))<p>- all elements (add&#x2F;remove&#x2F;toggle&#x2F;set a class&#x2F;attribute)
      • jazzypants2 hours ago
        Yeah, this only gets interesting if they start contemplating native two-way binding, but that still wouldn&#x27;t cover the vast majority of complex use cases that require computed values.
    • masfuerte4 hours ago
      I&#x27;ve always browsed with javascript disabled but in the last few months (presumably in response to AI scraping) loads of sites that previously worked now don&#x27;t. IMDB. Loads of open-source blogs, wikis and source repositories. Commenting on Wikipedia. Browsing job sites.<p>It&#x27;s never been easier to create a great site that doesn&#x27;t require javascript, but hardly anyone is.
      • jazzypants2 hours ago
        Google Search doesn&#x27;t work without JS. I think we&#x27;re actually moving in the opposite direction of what OP inferred. It&#x27;s pretty difficult to reliably detect bots without using JS, and the vast majority of interesting client-side web applications are downright impossible without it. No amount of HATEOAS is going to make a usable version of Figma.
      • Waterluvian3 hours ago
        I think there’s a lot of good reasons to, but hardly any incentive to.<p>People who disable JS are probably a very tiny minority and of those who consume ads, an even smaller one.
  • wild_egg3 hours ago
    Oh awesome. I wanted to use this last year but safari hadn&#x27;t shipped support yet and I hit some problem with the polyfill.<p>Looks like safari shipped support in December though so now I can go nuts
  • gitowiec2 days ago
    I don&#x27;t get it. They say it doesn&#x27;t need JavaScript. But how command is declared? And they show example rotating img with JS
    • maqnius1 day ago
      JS is not needed for some defined build-in commands [0]. Custom commands will emit an Event only which probably should end up in some JS function most of the time.<p>[0] <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Reference&#x2F;Elements&#x2F;button#command" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Reference&#x2F;...</a>
  • mifydev3 hours ago
    nice, htmx is infiltrating into the browser standards