Тёмный

Alpine AJAX - Alpine plugin (bringing HTMX-like functionality to Alpine!) 

BugBytes
Подписаться 27 тыс.
Просмотров 3,9 тыс.
50% 1

In this video, we'll explore the Alpine-AJAX plugin for Alpine.js
This enables you to build interactive websites that can request hypermedia content from the server, and swap the response content into the page at a given target element. Different swap strategies are also available, and demonstrated in the video.
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
ko-fi.com/bugbytes
▶️ Full Playlist:
• Django and Alpine.js -...
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: bugbytes.io/posts/
👾 Github: github.com/bugbytes-io/
🐦 Twitter: / bugbytesio
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Alpine-Ajax: alpine-ajax.js.org/
Alpine.js: alpinejs.dev/
#python #django #alpine

Опубликовано:

 

8 мар 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 32   
@TomOhle1
@TomOhle1 3 месяца назад
Great job - yet again. Thanks for your time putting all of these tutorials together.
@bugbytes3923
@bugbytes3923 3 месяца назад
Thanks for watching!
@DisabledCookie
@DisabledCookie 3 месяца назад
you explain this so well i hope i will be able to revisit your videos again
@robhafemeister3100
@robhafemeister3100 3 месяца назад
Pretty cool, another tool in the toolbox. Great explanation as always.
@iwswordpress
@iwswordpress 2 месяца назад
Excellent as ever! Thanks for demoing this as I wanted to avoid having to use both Alpine.js and HTMX - I would rather just use one that has all the features. Top job!
@bugbytes3923
@bugbytes3923 2 месяца назад
Thanks a lot, glad you liked it!
@repotranstech9614
@repotranstech9614 3 месяца назад
Cool video as always.
@bugbytes3923
@bugbytes3923 3 месяца назад
Thanks a lot!
@anouarben779
@anouarben779 3 месяца назад
straightforward like thanks for the awesome work !
@bugbytes3923
@bugbytes3923 3 месяца назад
Thanks a lot for the comment, appreciate it!
@CodyDostal
@CodyDostal 3 месяца назад
Excellent video! Currently learning go and decided to take that time to learn better front end dev. Always did Django with templates, kept JS to a minimum. Was looking at HTMX, but it looks like Alpine AJAX does the same thing basically. Might just go Go + Full AlpineJS/Alpine AJAX instead. Subbed to you as well! Thanks for the great content.
@bugbytes3923
@bugbytes3923 3 месяца назад
Thanks a lot, appreciate it!
@smyrnian_
@smyrnian_ 3 месяца назад
Can't wait for the Go video
@JorgeRodriguez-ck6cy
@JorgeRodriguez-ck6cy 17 дней назад
Very interesting take. It return HTML snippet with json data for alpine to process that json. Why not just straight HTML to the DOM?
@tjeerdhes1371
@tjeerdhes1371 3 месяца назад
The handling of the completed / is_completed is still not a boolean. In the UI is became a string with the python True of False value. 🤓 Great content though! 🙌
@frameff9073
@frameff9073 3 месяца назад
thank you
@bugbytes3923
@bugbytes3923 3 месяца назад
Thanks a lot!
@chrisbartolomei
@chrisbartolomei 3 месяца назад
Really informative video. Have actually been building a site using Django + HTMX and have been watching your series related to that. Am a little curious as to why one would use alpine ajax over just htmx with Django. It feels like there is maybe a feature nicety that alpine has to offer, but otherwise it feels pretty similar (if not a bit clunkier, perhaps). Do you intend to use this going forward in projects over just Django + HTMX? Would love to hear some of your opinions comparing these technologies in your videos, or even just explanations of the differences.
@Soul-Burn
@Soul-Burn 3 месяца назад
On the alpine ajax page there are comparisons to other libraries, mainly HTMX. Copied from there: Both HTMX and Alpine AJAX are server-agnostic, they'll integrate nicely with almost any server-side language and architecture. Even more, both Alpine AJAX and HTMX work with Alpine.js. In general the HTMX community encourages developers to use _hyperscript in place of Alpine.js, but Alpine.js is still considered a good option for adding client-side interaction. Since Alpine AJAX is designed as an Alpine.js plugin, it follows Alpine.js conventions; so if you're already building apps with Alpine.js, Alpine AJAX will feel more familiar. HTMX favors flexibility where as Alpine AJAX prefers convention over configuration. Beyond the low-level tooling that HTMX provides, the library isn't very prescriptive about how it should be used. The HTMX documentation for updating content is one example of the library's lack of opinion: It presents you with four different solutions and leaves it up to you to consider the trade-offs for each. In contrast, Alpine AJAX tries to provide you with more guidance so you can become productive faster without stumbling into common accessibility and progressive enhancement pitfalls. HTMX weighs in at 13kB of JavaScript compared to only 3kB for Alpine AJAX. --- Bottom line, alpine ajax is more opinionated, and has an expected way to things, compared to HTMX's versatility. In their eyes, less, but more obvious options are faster to build with.
@chrisbartolomei
@chrisbartolomei 3 месяца назад
@@Soul-Burn Hey thanks for your reply, this was helpful. I'm less experienced with this type of thing (backend engineer monkeying around in frontend land) but the difference of 13kB vs 3kB seems totally negligible to me. Am I wrong about that? Obviously less is better but that seems like practically the same to me.
@BosonCollider
@BosonCollider 2 месяца назад
Also if you are into reading the source code of the libraries you use, I found alpine ajax way easier to understand and extend, it only took me ten lines of code to add basic SSE support. The Alpine plugin system is really, really good. By contrast, the HTMX source code isn't bad, but it is a larger codebase with more random stuff going on without getting its structure from the alpine base
@tchappui
@tchappui 9 дней назад
What about the todos variable in the x-data of the current Alpine component ? After the first hypermedia request, you are appending the new todo to the list using the received html fragment. Now, the todos js variable does not reprensent the state of the todos anymore. I have the same kind of problems with htmx/alpine: how to keep x-data in sync after alpine ajax requests or hx requests.
@caglargulucan
@caglargulucan 2 месяца назад
There are so many alternatives on the Ui side. Obviously, this situation causes a lot of confusion. What is the frontend framework for Django that you would say is enough on its own?
@kushaldotel3147
@kushaldotel3147 3 месяца назад
Could you upload on now wagtail. Like a full playlist. I just explored its super awesome ❤
@fernandoacorreia
@fernandoacorreia 15 дней назад
How do you handle form submission errors, displaying error messages for server side validations?
@AliHassan-wc6nb
@AliHassan-wc6nb 3 месяца назад
Can you do click to edit and load more and inline update , adding new form like a row or inline formset with alpinejs like you did Playlist of htmx.
@akokkalis1
@akokkalis1 3 месяца назад
Amazing Content. Thanks. Make one step more and compare the values you get from requests and then present it. And Show messages also. Include modals for form delete a row using alpine ajax.
@siddharthakhanal9424
@siddharthakhanal9424 3 месяца назад
Can you do a video about unpoly.js
@abdelalitech4449
@abdelalitech4449 3 месяца назад
Sir please can you help me with the project i do in django ❤ ??
@Yarkanlaki
@Yarkanlaki 3 месяца назад
Next time we gonna use Vue 😂
@BosonCollider
@BosonCollider 2 месяца назад
I just played around a bit with forking petite-vue to make it a bit more hypermedia-friendly by adding a similar set of directives to alpine ajax while keeping Vue template compatibility and adding a way to create single file webcomponents with only slightly more boilerplate than standard vue. Overall I felt that the Alpine codebase is more extensible that petite-vue though, even though petite-vue is smaller
@Yarkanlaki
@Yarkanlaki 2 месяца назад
​@@BosonCollider That's Because peptie Vue used typescript while Alpine js uses vanilla script typescript ruined hello world programming