by systemvoltage · 5y ago · 0 comments
Flask + HTML + jQuery = Classic simplicity
Flask + HTML + Alpine/Stimulus/Vue = Modern simplicity. No need to install node at all on the backend is absolutely liberating. Managing JS dependencies is a complete shitshow, an absolute horror, it has scarred me so much, I hate it with every ounce of passion I have. I don't want it on my backend at all. So, I am liberated by the fact that I can serve highlight.js or whatever JS lib just as a static file and use Jinja/Django templates with Flask/Django, sprinkle some plain JS logic if I can. If I need something more, I will use Alpine.js or in the case of the author, Stimulus.js.
With node, comes npm. Yarn. Gulp. Webpack. Rollup. All this nonsense which is so incredible fragile, it will change next week. It gives me a tremendous amount of anxiety just thinking about it.
This is simple to me.
My suggestion wasn't to run Node in the backend, it was no backend. Serve it as a static site. That generally works in 90% of the cases for me. I use Hasura as my API layer which is deployed alongside Postgres.