3 ms·
LiveView Is Not a Zero-JS Framework, It's a Zero-Boring-JS Framework
- johnisgood 2y agoIs it possible to use Elixir with Phoenix (with or without Liveview) without ANY JavaScript though? If so, how to go about it?
- tylrbrkr 2y agoNot sure I understand exactly what you mean, but yeah generally speaking. You really don't need JS beyond what any of the project generators give you for a tonne of use cases. A lot can be handled where you need by the LiveView.JS module. Phoenix without LiveView definitely doesn't need JS.
- johnisgood 2y agoSo, I could build an e-commerce website in Elixir using Phoenix, similarly to how I could do this in PHP? Would something like: $ mix archive.install hex phx_new $ mix phx.new your_project_name --no-html --no-webpack work? With all the JavaScript removed if it still creates any.[1] [1] I think it does create a .js file at the very least but that is just a configuration file.
- tylrbrkr 2y agoYes, you can build fully server rendered web apps with Phoenix. You'd need HTML templates for that though, so you shouldn't use the --no-html option. --no-webpack is deprecated as Phoenix uses esbuild now but see the docs: "--no-esbuild - do not include esbuild dependencies and assets. We do not recommend setting this option, unless for API only applications, as doing so requires you to manually add and track JavaScript dependencies"
- johnisgood 2y agoIf I intend to create an e-commerce website without any JavaScript, may I use "--no-esbuild" given that I do not want to add any JavaScript dependencies? I am trying to replace the e-commerce website I have built using PHP & HTML & CSS (without any JavaScript at all). I was even considering "--no-assets" and add Tailwind (or whatever else) manually.
- johnisgood 2y agoI hope a core developer of Phoenix could help me out here. :/ https://news.ycombinator.com/item?id=35928648 https://news.ycombinator.com/item?id=35928648