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

    refined-waiter-90422

    12/08/2022, 10:35 AM
    you'd be surprised at how many libraries do not take the whitelist approach and just remove
    onEVENT=
    which isn't enough lol.
  • t

    thankful-addition-60522

    12/08/2022, 10:35 AM
    this is from the mind of the developer that didn't implement that yet
  • c

    clever-activity-24633

    12/08/2022, 1:45 PM
    Is there a resource that demonstrates how to implement virtualisation `with HTMX`/`_hyperscript`?
    d
    m
    • 3
    • 5
  • j

    jolly-kite-167

    12/08/2022, 2:12 PM
    There might be clues to that in any infinite scrolling examples, maybe?
  • c

    clever-activity-24633

    12/08/2022, 2:16 PM
    Is there a resource that demonstrates
  • l

    lemon-rocket-71964

    12/08/2022, 4:10 PM
    Thanks for the reply. We are using swap-innterHTML. This prototype is simple page with one button. On every button click we will swap the innterHTML with fragment received from api response. I have attached the prototype index.html, chrome-profile.json and network-capture.har. The following is the snippet from chrome profile capture: 1. First button click - Duration: 41.47 ms (34.37 ms network transfer + 7.10 ms resource loading) 2. Second button click (Same api called as first button click) - Duration: 216.55 ms (29.24 ms network transfer + 187.31 ms resource loading) Second time resource loading is high. But API response/html fragment is same for both the calls refer network-capture.har. Please help. For more information please refer the attached files. I am not able to upload the chrome-profile.json as file. I uploaded as zip file. Thank you !!!
  • l

    lemon-rocket-71964

    12/08/2022, 4:15 PM
    chrome-profile as zip file
  • r

    rich-church-18505

    12/08/2022, 5:10 PM
    Hello everyone! Has anyone successfully accomplished a standalone frontend app with htmx? Like it will consume from hypermedia api, but use auth tokens (JWT) and all? So we can finally drop vue and react???
  • m

    mysterious-toddler-20573

    12/08/2022, 5:22 PM
    typically in htmx auth is done on the server side and then a session cookie is maintained
  • m

    mysterious-toddler-20573

    12/08/2022, 5:36 PM
    two things: 1) are you doing anything in
    htmx:beforeCleanupElement
    ? 2) can you run this w/ the non-minimized version of htmx?
  • l

    late-king-98305

    12/08/2022, 5:43 PM
    This is a small-ish application that used to use Vue; the HTML is generated on the server, and all the refreshing / updates are handled via htmx interaction. The server stuff is specific to the .NET / F# environment, but the files under
    Views
    use something that very closely resembles HTML. https://github.com/bit-badger/myPrayerJournal/tree/main/src/MyPrayerJournal
  • l

    late-king-98305

    12/08/2022, 5:43 PM
    I also wrote a lot about the initial Vue application... https://bitbadger.solutions/blog/2018/a-tour-of-myprayerjournal/introduction.html
  • l

    late-king-98305

    12/08/2022, 5:44 PM
    ...and changes that I implemented as part of the version that uses htmx. https://bitbadger.solutions/blog/2021/a-tour-of-myprayerjournal-v3/introduction.html
  • l

    late-king-98305

    12/08/2022, 5:45 PM
    Both use authentication via Auth0 - but, as Carson said, v3 uses a session cookie, while v1 used JWTs.
  • l

    lemon-rocket-71964

    12/08/2022, 5:50 PM
    1) We are not doing anything in the in htmx:beforeCleanupElement 2) I have attached chrome-profile w/ the non-minimized version of htmx
  • r

    rich-church-18505

    12/08/2022, 5:58 PM
    Thanks a lot! Am gonna give it a view!!
  • m

    mysterious-toddler-20573

    12/08/2022, 6:21 PM
    hmm, I'm confused by this profile:
  • m

    mysterious-toddler-20573

    12/08/2022, 6:21 PM
    it looks like the event dispatch is taking up a ton of time (and calls
    cleanupElement
    within it)
  • m

    mysterious-toddler-20573

    12/08/2022, 6:21 PM
    are you using any extensions?
  • r

    red-farmer-97020

    12/08/2022, 6:31 PM
    This looks like chatGPT lol
  • r

    red-farmer-97020

    12/08/2022, 6:31 PM
    Seeing as it invented some hx- attributes
  • t

    thankful-addition-60522

    12/08/2022, 6:32 PM
    duh
  • r

    red-farmer-97020

    12/08/2022, 6:33 PM
    It also assumes that you'd allow users to set the value of attribute, which would require some vaguely convoluted JavaScript. Interesting that it correctly pointed out XSS being a possible avenue for attacks, but that the method it proposed is very strange
  • j

    jolly-kite-167

    12/08/2022, 6:34 PM
    never, ever take anything a machine says as legit. not even 0 or 1.
  • m

    mysterious-toddler-20573

    12/08/2022, 6:34 PM
    htmx is just like any other server-driven approach: you have to escape your content on the server side properly. It's all outlined here: https://htmx.org/docs/#security, which is where our friendly AI grabbed most of this from.
  • t

    thankful-addition-60522

    12/08/2022, 6:34 PM
    i'm also trying to whip it into writing a mini-htmx
  • l

    lemon-rocket-71964

    12/08/2022, 6:35 PM
    No we are not using extensions. Is there anyway we can swap-innterHTML without performing the cleanupElement? Yes it is pretty straight forward app which does on every button click swap the response/fragment. For testing purpose we are using 10K+ entries in the response/fragment. Even the 10K+ entries at first time faster only sub sequent calls it is slow due the cleanupElement recursive call. I have attached the response(/prizes)/fragment.html for your reference. Main html snippet: Click me
  • m

    mysterious-toddler-20573

    12/08/2022, 6:36 PM
    Ah, so this is a huge DOM
  • m

    mysterious-toddler-20573

    12/08/2022, 6:36 PM
    OK, that makes some sense
  • t

    thankful-addition-60522

    12/08/2022, 6:36 PM
    > our friendly AI just you wait when openai will paywall the fuck outta it
1...936937938...1146Latest