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

    mysterious-toddler-20573

    09/18/2020, 3:32 PM
    really strange
  • m

    mysterious-toddler-20573

    09/18/2020, 3:32 PM
    only diff between 0.1.0 and 0.1.1 should be not doing the double dispatch when kebab and camel names match
  • m

    most-jelly-15242

    09/18/2020, 3:33 PM
    I am looking at the diff now, trying to understand what's going on
  • m

    most-jelly-15242

    09/18/2020, 3:47 PM
    So If I download 0.1.0 and manually change what you fixed for 0.1.1, then it works. But if I use 0.1.1 directly, it doesn't work. Tried it in a private browser window, and it's the same. No idea what's going on
  • f

    flaky-dream-95803

    09/18/2020, 3:50 PM
    hello 🙂
  • m

    most-jelly-15242

    09/18/2020, 3:54 PM
    @mysterious-toddler-20573 The issue seems to be coming from the changes here. This is a difference between 0.1.0 and 0.1.1 downloaded from https://unpkg.com/
  • m

    most-jelly-15242

    09/18/2020, 3:56 PM
    In Chrome, it's
    hx-trigger
    lowercase
  • f

    flaky-dream-95803

    09/18/2020, 4:05 PM
    Is there a way to pass query string parameters to requests triggered by htmx? E.g., if I'm on page http://example.com/?x=1 and it contains
    <div hx-get="/foo" hx-trigger="load"></div>
    I would like to pass
    x
    in
    GET /foo
    request
  • m

    most-jelly-15242

    09/18/2020, 4:07 PM
    @User You can use
    hx-vars="x:1"
  • f

    flaky-dream-95803

    09/18/2020, 4:08 PM
    how would I get that
    1
    from URL into hx-vars?
  • m

    most-jelly-15242

    09/18/2020, 4:08 PM
    Ah, you can also use a computed function in hx-vars
  • f

    flaky-dream-95803

    09/18/2020, 4:08 PM
    oh you can put expression there
  • f

    flaky-dream-95803

    09/18/2020, 4:09 PM
    ok, that might work. thanks!
  • m

    most-jelly-15242

    09/18/2020, 4:09 PM
    @User So this seems to fix it in Chrome, FF and Safari:
    Copy code
    js
    //AK - FIXED CHROME issue - "refuse to get unsafe header" warning.                       
    if (xhr.getAllResponseHeaders().indexOf("HX-Trigger".toLowerCase()) >= 0) {
        handleTrigger(elt, this.getResponseHeader("HX-Trigger"));
    }                      
    
    if (xhr.getAllResponseHeaders().indexOf("HX-Push".toLowerCase()) >= 0) {
        var pushedUrl = this.getResponseHeader("HX-Push");
    }
    //AK - FIXED CHROME issue - "refuse to get unsafe header" warning. \\
  • g

    gorgeous-ghost-95789

    09/18/2020, 4:13 PM
    @User - earlier this morning you were asking about mocking a back end from within Javascript. HTMX's test cases already do this, using a librarycalled Mocha. If you're looking to make a platform-agnostic TODO demo, check out some of the manual test cases for an example.
  • g

    gorgeous-ghost-95789

    09/18/2020, 4:15 PM
    Lost threads like this are why IM/Slack/Discord suck so much.
  • m

    most-jelly-15242

    09/18/2020, 4:19 PM
    @User @User You may also want to have a look at mirage.js
  • m

    mysterious-toddler-20573

    09/18/2020, 4:26 PM
    ugh, I think I merged that change into master and not dev, so it showed up in 0.1.1
  • m

    mysterious-toddler-20573

    09/18/2020, 4:27 PM
    thanks for the catch, too bad we can't really test case sensitivity
  • m

    mysterious-toddler-20573

    09/18/2020, 4:27 PM
    I'll put out a 0.1.2 later today
  • m

    mysterious-toddler-20573

    09/18/2020, 4:28 PM
    foiled by git incompetence again...
  • m

    mysterious-toddler-20573

    09/18/2020, 6:18 PM
    @User i just put out 0.1.2
  • m

    mysterious-toddler-20573

    09/18/2020, 6:18 PM
    this is fun!
  • m

    mysterious-toddler-20573

    09/18/2020, 6:18 PM
    should fix your issue, and I added a case-sensitivity test
  • m

    mysterious-toddler-20573

    09/18/2020, 6:19 PM
    https://htmx.org/test/0.1.2/test/#foo
  • m

    mysterious-toddler-20573

    09/18/2020, 6:19 PM
    almost 250 tests
  • m

    mysterious-toddler-20573

    09/18/2020, 6:20 PM
    not bad
  • b

    big-airline-13935

    09/18/2020, 6:35 PM
    Well done @User !! ☕
  • g

    gorgeous-ghost-95789

    09/18/2020, 6:55 PM
    @User - thanks for the tip. I hadn't heard of either one of those until recently 🙂
  • l

    lively-beach-14291

    09/18/2020, 7:08 PM
    For what it's worth "DOM processing should be fast" always fails on my older i7 desktop, it takes 156ms. I like the other tests that show the time in ms in red. Most of the timing tests are in red.
1...343536...1146Latest