Open eamigo86 opened 2 years ago
It was a mistake on my part not to upload the static files. I'm going to check some backups these days in case I have any luck. However, I remember that there was nothing interesting. HTMX doesn't need any configuration, possibly it just started npregress which is a progress bar. If you replace HTMX and nprogress dependencies with their CDNs, you may not have any problems. Anyway I want to make my conclusions: it is not a good idea to use HTMX to manage WebSockets. It is quite limited and in many occasions I ran into dead ends. You can simplify it a lot with the native WebSockets client. I explore in some detail the HTML architecture over WebSockets, where I even give examples of how Stimulus is a better option than HTMX: https://www.amazon.com/Building-SPAs-Django-HTML-Over/dp/1803240199/ref=sr_1_1?crid=FZ6CVSVYU7MG&keywords=andros+fenollosa&qid=1660514831&sprefix=andros+fenollos%2Caps%2C158&sr=8-1 I hope you find it helpful.
Hi @tanrax, thanks for your quick and great response. The book looks very good, congratulations !!! Really only with the main.js file would be enough.
There is another developer who has also published a book and who proposes this Django + Hotwire (Turbo + Stimulus) solution, instead of using Django + HTMX + Alpine.js (https://www.accordbox.com/blog/ebook-the-definitive-guide-to-hotwire-and-django/).
Thanks in advance
Hi @eamigo86 My humble opinion: I have been investigating the reference you mention and it is not a good solution, as it works with AJAX requests instead of using the WebSocket protocol. There is a classic delay when working with asynchronous requests, it is not realtime. The same is happening with the PHP community, which is limited by the lack of this technology. It also uses a lot of external technology, inherited from Ruby, which is not necessary if the architecture is good. The ideal is to connect the client with Channels and for there to be bidirectional communication. Best regards and thanks for the recommendation.
You can check other examples of projects, apart from this one, where I implement from scratch.
Blog
https://github.com/tanrax/django-blog-for-html-over-the-wire
Multipage with Stimulus, Login, registration and many enhancements
https://github.com/tanrax/django-multipage-template-for-html-over-the-wire
Slack clone using Django with Channels and HTML over the Wire architecture
https://github.com/tanrax/slack-clone-using-HTML-over-the-Wire
Simple social network using HTML over the Wire architecture in Django with Channels
https://github.com/tanrax/simple-HTML-over-the-Wire-social-network
Simple template HTML over the Wire (HTML over WebSockets) in Django using Channels and Docker
https://github.com/tanrax/template-HTML-over-the-Wire-Django
Hi @tanrax, thanks for sharing with me your experience on this topic and for warning me about the downsides of the other approach. Thanks for sharing repositories' links with me. I'll take a look at all of them. Greetings
Hello, searching the web I have found this repository, the proposal you make is very interesting. I have tried to recreate the project, but the "static" folder is not in the repository, so the loading of some library js files fails, in addition to another custom .js file. Could you upload these files? Thank you very much in advance. Greetings