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

    mysterious-toddler-20573

    09/29/2020, 4:46 PM
    https://github.com/bigskysoftware/htmx/commit/7a7401aa9712dc01c35c106b9e7743810971fa53
  • m

    mysterious-toddler-20573

    09/29/2020, 4:48 PM
    What are you using to test this @User ?
  • m

    most-jelly-15242

    09/29/2020, 4:49 PM
    Great. I'll grab the update and re-test. I am building a PHP framework similar to Laravel Livewire, but powered by htmx and can be used on any PHP project. That's what you see in the above gif. Also similar to Sprig. In fact i am adding integrations for a couple of different templating engines (Blade, Twig) and a built-in simple php templating option as well.
  • m

    most-jelly-15242

    09/29/2020, 4:57 PM
    @User This line prevents the multipart upload from working, at least in PHP
    Copy code
    js
    headers['Content-Type'] = encoding;
    When left empty, the browser automatically sets it to something like this:
    Copy code
    multipart/form-data; boundary=----WebKitFormBoundaryOV8C7NaFyB4mvYQp
    Otherwise $_POST and $_FILES are empty on the server-side.
  • m

    mysterious-toddler-20573

    09/29/2020, 5:16 PM
    interesting
  • m

    mysterious-toddler-20573

    09/29/2020, 5:16 PM
    OK, I will update that
  • m

    most-jelly-15242

    09/29/2020, 5:25 PM
    btw, tested in chrome, safari and firefox without that line and it works on all 3.
  • m

    mysterious-toddler-20573

    09/29/2020, 5:28 PM
    excellent
  • m

    mysterious-toddler-20573

    09/29/2020, 5:28 PM
    pushed up a fix
  • m

    most-jelly-15242

    09/29/2020, 5:30 PM
    All good now πŸ‘
  • m

    mysterious-toddler-20573

    09/29/2020, 5:30 PM
    Sweet, thank you!
  • m

    mysterious-toddler-20573

    09/29/2020, 5:31 PM
    I will write some docs and merge it back into dev soon
  • m

    mysterious-toddler-20573

    09/29/2020, 5:32 PM
    there are also events I'm now firing around the request:
    Copy code
    js
                forEach(['loadstart', 'loadend', 'progress', 'abort'], function(eventName) {
                    xhr.addEventListener(eventName, function(event){
                        triggerEvent(elt, "htmx:xhr:" + eventName, mergeObjects({}, event.detail));
                    })
                });
  • m

    mysterious-toddler-20573

    09/29/2020, 5:32 PM
    so you can listen for the
    htmx:xhr:progress
    event for example and show a progress bar
  • m

    most-jelly-15242

    09/29/2020, 5:34 PM
    That's great. Would there be a way to show a preview image before upload? Or would that fall more into hyperscript land? or a custom extension?
  • b

    big-airline-13935

    09/29/2020, 6:22 PM
    > Great. I'll grab the update and re-test. I am building a PHP framework similar to Laravel Livewire, but powered by htmx and can be used on any PHP project. That's what you see in the above gif. Also similar to Sprig. In fact i am adding integrations for a couple of different templating engines (Blade, Twig) and a built-in simple php templating option as well. @most-jelly-15242 Fascinating, would love to see something when you’re far enough along.
  • m

    most-jelly-15242

    09/29/2020, 6:23 PM
    @User I am already far enough πŸ˜‰ I'll give you access so you can take a look. I would love some feedback.
  • b

    big-airline-13935

    09/29/2020, 6:25 PM
    Brilliant!
  • b

    big-airline-13935

    09/29/2020, 6:27 PM
    Yoyo, nice name!
  • m

    most-jelly-15242

    09/29/2020, 6:29 PM
    Glad you like it, I am terrible at naming products. It's also the first package I am writing, so any feedback would be useful. I am more used to creating products for end users, not devs.
  • m

    mysterious-toddler-20573

    09/29/2020, 10:20 PM
    integration w/ the HTML validation framework:
  • m

    mysterious-toddler-20573

    09/29/2020, 10:20 PM
    https://github.com/bigskysoftware/htmx/commit/a01fac40a2fd60d8d6a6efb5bf18a7109643e588
  • m

    mysterious-toddler-20573

    09/29/2020, 10:21 PM
    including an example using hyperscript to give a custom error message
  • m

    mysterious-toddler-20573

    09/29/2020, 10:28 PM
    So, in the next release of htmx, you can say stuff like this:
  • m

    mysterious-toddler-20573

    09/29/2020, 10:29 PM
    (or use alpine, or regular html 5 validations, or whatever)
  • b

    big-airline-13935

    09/30/2020, 3:27 PM
    Excellent!!
  • m

    mysterious-toddler-20573

    09/30/2020, 4:23 PM
    Does anyone see any APIs in here that would be good to surface in htmx? https://developer.mozilla.org/en-US/docs/Web/API
  • g

    gorgeous-ghost-95789

    09/30/2020, 5:19 PM
    I'll look through this document in a much more thorough way, and get back to you. One (complete brainstorm) that comes to mind is this:
  • g

    gorgeous-ghost-95789

    09/30/2020, 5:20 PM
    HTMX can hook in to many natural browser events already. But some of those events come with additional parameters. Would it be possibly to include those in HTMX syntax, so that AJAX requests could be filtered based on the event values.
  • g

    gorgeous-ghost-95789

    09/30/2020, 5:22 PM
    Here's a cheesy example: The document you linked to includes Ambient Light Events, along with a value for the relative intensity of the ambient light. Could this be filtered by HTMX to trigger only when the light
    event.value is > 50
    , or be modified for when
    event.value < 25
    ?
1...424344...1146Latest