HTMX and Astro Are An Amazing Combo!
Vložit
- čas přidán 17. 04. 2024
- HTMX and Astro provide a unique way of building applications. By combining HTMX with Astro partials, you can build interactive applications without having to write any frontend JavaScript!
HTMX - htmx.org/
Astro Partials - astro.build/blog/astro-340/#p...
Xata - xata.io/
Learn Astro (full course) - astrocourse.dev/
*Newsletter*
Newsletter 🗞 - www.jamesqquick.com/newsletter
*DISCORD*
Join the Learn Build Teach Discord Server 💬 - / discord
Follow me on Twitter 🐦 - / jamesqquick
Check out the Podcast - compressed.fm/
Courses - jamesqquick.com/courses
*QUESTIONS ABOUT MY SETUP*
Check out my Uses page for my VS Code setup, what recording equipment I use, etc. www.jamesqquick.com/uses
I GOTTA check this out 🎉
thanks James, can you tell me about security to avoid other websites using your api on htmx and Astro?
I find it better to serve the JS file for HTMX myself from my server. But CDN is the way most people prefer to do it
The purpose of the CDN is so that subsequent visitors have HTMX cached, so it loads faster.
What benefit is there to self-hosting? 🤔
htmx.min.js.gz is 15675 bytes btw.
@@jjaimealeman That's not entirely true. Subsequent visitors have nothing to gain from what another visitor did. At most, only visitors from the same POP may get a cached version from that CDN POP. But that's not all visitors, nor is it guaranteed. With self hosting you have an unaltered version of the library. External hosting allows for hijacking of that dependency. It's also an external dependency, so if that server or DNS has issues, you now have issues. Lastly, HTTP2 can actually serve the serve the file faster since your browser has already established a TCP connection to your site.
Jack Herrington has a 9 mins long video on HTMX + Astro where he shows how to npm install and configure htmx in Astro
Last 🥲
when people are saying back in the day I think they're talking about before 10 yrs ago.
First🎉