Replies: 3 comments 6 replies
-
Currently no, not really. The closest thing I've looked at the documentation a few times and tried to figure out how I could provide something similar, but I'm not sure how easy it is going to be -- Livewire and Alpine.js are both made by the same person, so there are integration points he has created for the two projects to co-exist easily. |
Beta Was this translation helpful? Give feedback.
-
I'm interested in exploring this vector as well. |
Beta Was this translation helpful? Give feedback.
-
I'd like to bring up this old topic again because I encountered the same issue. We use Alpine for client-side changes like opening popups, and so on. We started using django-unicorn, but we quickly realized that updated HTML fragments lose the Alpine state and event handlers. HTMX solves this problem with their extensions. They have support for morphdom and Alpine morph plugins. The code for both is very simple. You can check out the alpine-morph and morphdom-swap files. I think it would be great to have a similar mechanism for django-unicorn. As an experiment, I implemented a proof of concept pull request that adds Alpine morph: #597 Please note that the PR is not ready to be merged. Specifically:
That being said, it could be a good starting point. What do you think, @adamghill? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the great library! Does Django-Unicorn provide any way to integrate with Alpine.js in a similar way to how LiveWire does (e.g. https://laravel-livewire.com/docs/2.x/alpine-js) with
$wire
andentangle
? It would be great to have support for performing the occasional client-only interaction that doesn't require a full-server roundtrip.Beta Was this translation helpful? Give feedback.
All reactions