- Видео 1
- Просмотров 2 232
Christian Taylor
Добавлен 8 фев 2013
Award-losing web developer, visual artist, and Cool Technology Officer at Moonbase Labs
Alpine AJAX: The simplest way to build interactive web applications
An introduction & guide to building web applications using Alpine AJAX by the creator of the JavaScript library.
Alpine AJAX is the easiest way to turn your simple server-rendered web applications into robust, modern feeling, experiences. It allows you to work with the grain of the web instead of re-inventing browser behavior in JavaScript.
Alpine AJAX is inspired by concepts of Progressive Enhancement and Resilient Web Design (resilientwebdesign.com/) by Jeremy Keith.
Learn more at alpine-ajax.js.org
0:00 Intro
0:58 Core Functionality
1:58 Backend code
3:26 Installation
4:38 Plain Alpine
6:41 AJAX Forms (x-target)
9:43 AJAX Links
13:02 Confirmation Dialog
15:25 Notifications (x-sync)
17:18 Template P...
Alpine AJAX is the easiest way to turn your simple server-rendered web applications into robust, modern feeling, experiences. It allows you to work with the grain of the web instead of re-inventing browser behavior in JavaScript.
Alpine AJAX is inspired by concepts of Progressive Enhancement and Resilient Web Design (resilientwebdesign.com/) by Jeremy Keith.
Learn more at alpine-ajax.js.org
0:00 Intro
0:58 Core Functionality
1:58 Backend code
3:26 Installation
4:38 Plain Alpine
6:41 AJAX Forms (x-target)
9:43 AJAX Links
13:02 Confirmation Dialog
15:25 Notifications (x-sync)
17:18 Template P...
Просмотров: 2 237
Really great library, love it and great demonstration. Very well done.
Wow the library is really such a gem!! I was convinced to use htmx in my upcoming project but now I am not sure and would give Alpine Ajax a go. Really impressive work sir!
pls make full tutorial
Say more, what’s a full tutorial mean to you?
Great library and example... I'm guessing to then have this trigger an update in another user's browser (i.e. User X sees User Y's new comment appear in the feed without refreshing), you'd still then need to tap into web sockets and something like Laravel Echo? That seems to be the last thing to close the loop on typical "live" behaviour.
it is a lot more easier than htmx oob. pls share use case with Django as well
Thanks for creating this. I guess it might cover most of my HTMX cases so I can use only Alpine + plugin. 🎉
Man, this is so awesome, I'm really surprised that this has not been achieved before. But it's so cool to be able to make all of these changes with a handleful of html edits, boom, SPA feel. It's so cool to see even better implementation of the htmx library, and it's pretty lightweight too. Thanks, I'm gonna use it on all my projects.
Wow hope someday this library will get ❤ best of luck
Woah, this is huge! Thank you so much!
Thank you for the elegant work and this library. For my current pet project, I’m using AlpineJS + HTMX, but for the next one, I’ll definitely try AlpineJS + Alpine AJAX. Now I feel like starting it as soon as possible. Good thing the weekend is ahead :)
Im just amazed at how easy this is to implement on the front-end. Learned a lot about Alpine.
Wow, learned a lot of things about Alpine. Thanks!
I love this. Alpine is awesome.
I don't like the last part where you use session then create an element just to dispatch an event. It looks more like a trick than an actual solution. Why didn't you just listen to the ajax success event and dispatch the comment:changed there ?
@@youaskforit yeah you might be on to something with just using `ajax:success`. I honestly hadn’t considered that because I was thinking of approaches like Web Sockets or SSE. I’ll have to do some testing and maybe update the video.
I also do not understand why session? And not just return a div (or template) with an response from posting a form and add it to a dom to teigger an event?
That’s just a common patten in Laravel. It’s easy to push multiple messages into the session, and layouts are rendered from inside out, so you don’t have to carry your messages through multiple nested layouts to render them where you want.
I considered this more and decided it’s not a great solution: It could work in a very simple scenario, but as soon as you add validation to the mix things get complicated. If the request is invalid you don’t want `comment:changed` to be fired so you would have to inspect the response object in the `ajax:success` listener to determine what to do on the frontend. Setting a response header on the server isn’t a good option either because `fetch` can’t access headers on redirect responses. So I think triggering an event from the server is still the most bulletproof way to do this.
@@ima_crayon I haven't checked the alpine ajax source code, but does the library consider laravel's 422 response as ajax:success ?
Awesome! More examples please. I love the x-target.4xx functionality. This will save so much code.
Thanks! There’s written examples at alpine-ajax.js.org/examples/ but yeah I might try to record a few more too
@@ima_crayon Yes, I saw the examples before, they are very well explained! But unlike this video they are more micro UX patterns. Why this video is awesome is because it is a great example of how one would combine the UX patterns in those examples for a more broader page-level example (Blog page in this case). Future videos could cover examples like a "Product list page with category and price range filtering" and then maybe later extend it with a "Shopping Cart" popup, or how about a "Sortable Kanban style Todo list" page? Just throwing around ideas... Also, some constructive feedback for your video: a) I could not see the code sometimes because your face was in the way. Maybe move your face to a corner and make it smaller. b) Not everyone understands PHP in the back-end but everyone uses JS in the front-end so for more readability, it makes sense to keep it all JS for the back-end as well (e.g. NodeJS). This is not for me specifically by the way, I use Go in the backend. I just think everyone will relate more to the video that way. Please keep up the awesome work on Alpine AJAX! I'm really excited about it and I really think more exposure on how useful it really is will quickly increase adoption!
wowww very helpful tutorial, it seems to be more advanced/robust than HTMX, or maybe it is because of the alpine effect.
Its like htmx, thanks buddy
Thank you. Please create more tutorial on Alpine js
This is awesome, great work!
It is really cool, basically, it grabs the content based on the ID and replace it, really nice !