https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • l

    lively-beach-14291

    09/18/2020, 7:09 PM
    @alexandros mirage.js is neat, one could build a complete client-side demo of HTMX with that.
  • m

    most-jelly-15242

    09/18/2020, 7:47 PM
    Just catching up. @User Thanks for the quick fix!
  • m

    mysterious-toddler-20573

    09/19/2020, 3:22 AM
    > https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API 😉 @lively-beach-14291 I do want to look at a hyper script syntax for workers
  • l

    lively-beach-14291

    09/19/2020, 2:41 PM
    So, Evan You's post on refactoring Vue is interesting; notibly, he brings attention to...
  • l

    lively-beach-14291

    09/19/2020, 2:41 PM
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
  • l

    lively-beach-14291

    09/19/2020, 2:42 PM
    https://t.co/Fzycn2sUT7?amp=1
  • g

    gorgeous-ghost-95789

    09/19/2020, 5:02 PM
    I love the idea of pushing HTMX into more advanced areas of the ecosystem. It could be a huge win.
  • g

    gorgeous-ghost-95789

    09/19/2020, 5:03 PM
    It looks like web workers are supported by IE11. https://caniuse.com/webworkers
  • g

    gorgeous-ghost-95789

    09/19/2020, 5:04 PM
    But service workers (subtle difference) are not. https://caniuse.com/serviceworkers
  • g

    gorgeous-ghost-95789

    09/19/2020, 5:04 PM
    Perhaps there’s a way to make optional features for modern browsers?
  • g

    gorgeous-ghost-95789

    09/19/2020, 5:06 PM
    It looks like Proxy is not supported by IE11 😕
  • g

    gorgeous-ghost-95789

    09/19/2020, 5:06 PM
    https://caniuse.com/proxy
  • l

    lively-beach-14291

    09/20/2020, 9:35 AM
    So, it looks like Vue3 decided this wasn't a show-stopper for them. They don't have direct IE11 compatibility since the default information uses proxy.
  • l

    lively-beach-14291

    09/20/2020, 10:17 AM
    Here's the thing, for desktops IE11 is less than 3% of browser usage, and is almost exclusively in large corporations. There's a small handful of corporate developers who need IE11, however, it's doubtful they'd be permitted to use HTMX anyway -- most are Angular shops.
  • l

    lively-beach-14291

    09/20/2020, 10:17 AM
    https://gs.statcounter.com/browser-market-share/desktop/worldwide
  • l

    lively-beach-14291

    09/20/2020, 10:19 AM
    So, given how well proxy is supported, I'm wondering if it would improve any of HTMX features/maintainability/speed. If Vue3 decided to make the break, it seems fine for HTMX to do so. I'd rather have 10% faster on modern browers and tablets than support an ageing corporate fleet.
  • m

    mysterious-toddler-20573

    09/20/2020, 3:09 PM
    I would like to keep htmx supporting IE11 out of the box for a while. At this point its kind of a running joke. The current htmx implementation is simple and functional in style, so there isn't much that a proxy could help with there. I did recently add a feature that will not work in IE11: if an AJAX response does a redirect and that information is available, we will use that value when pushing a URL: https://github.com/bigskysoftware/htmx/blob/3bddff33e55048c6c6643b86fde06a656d6c88fa/src/htmx.js#L1542
  • m

    mysterious-toddler-20573

    09/20/2020, 3:09 PM
    That's an instance where I"m OK w/ not supporting ie11 100%. If you want to support IE11 100% in that case, you need to send a header down explicitly. And it doesn't break IE11, it just doesn't work perfectly.
  • m

    mysterious-toddler-20573

    09/20/2020, 3:10 PM
    All that said, with hyperscript I'm happy to break IE11, as long as the feature in question is opt-in
  • m

    mysterious-toddler-20573

    09/20/2020, 3:11 PM
    the basic stuff should work in IE11, but if we were to surface workers or whatever with a nicer API than they currently have, I'm fine with that not working IE11. Just don't use them if you want IE11 support.
  • m

    mysterious-toddler-20573

    09/20/2020, 3:12 PM
    The reality, as @User points out, is that anyone that has to support IE11 is probably using extremely legacy frameworks and won't be able to use htmx, and, even moreso, hyperscript.
  • l

    lively-beach-14291

    09/20/2020, 5:03 PM
    @User I'm curious why Vue3 decided to use Proxy; what problem did it solve? Was it bi-directional model binding? What would it even mean to have bidirectional model binding for htmx or hyperscript?
  • g

    gorgeous-ghost-95789

    09/20/2020, 7:07 PM
    I've only used Vue for some toy experiments but I have a lot of experience with Angular 1 and 2. I would agree with your guess, @lively-beach-14291 -- a front end framework like Vue would gain a lot by being able to listen for changes to object states, and Proxy seems like a great solution for that.
  • g

    gorgeous-ghost-95789

    09/20/2020, 7:09 PM
    I don't know that this idea would translate well in HTMX, because there is no front-end model. However, I'm getting really curious about the way that Hyperscript is evolving. So maybe there's a place for some of these more "modern" features there.
  • g

    gorgeous-ghost-95789

    09/20/2020, 7:10 PM
    @mysterious-toddler-20573 do you have any more thoughts on how web workers / service workers might work inside of HTMX? Perhaps to move some of the processing off of the main Javascript thread?
  • m

    most-jelly-15242

    09/20/2020, 9:34 PM
    The reactivity features in Alpine are implemented using proxy. There's a nice intro video series here https://laracasts.com/series/building-alpinejs and episode 3 shows how proxy is used.
  • m

    mysterious-toddler-20573

    09/21/2020, 1:14 AM
    @User I view it as more of a hyperscript thing rather than an htmx thing. Spitballing an idea here, but something like:
    Copy code
    js
      worker MyWorker
         on foo 
           doWhatever()
         end
      end
    and then having the ability to treat workers as a target event:
    Copy code
    js
      on click
        send foo to MyWorker
      end
  • m

    mysterious-toddler-20573

    09/21/2020, 1:15 AM
    so you can define workers inline and then send messages to them just like you would any other element in the DOM
  • g

    gorgeous-ghost-95789

    09/21/2020, 1:48 AM
    Ok, that’s very cool. I’ll dig in to the specs so that I can be half-educated when I push breaking PR changes 😉
  • b

    big-airline-13935

    09/21/2020, 8:22 AM
    @User According to that video, AlpineJS uses https://github.com/salesforce/observable-membrane which is a proxy wrapper.
1...353637...1146Latest