Hacker News new | ask | show | jobs
by johnisgood 1127 days ago
For anyone wondering, this is where I complain about Phoenix being bloated[1], and others have informed me that "There’s no JavaScript unless you write it into the template.", and that I can reduce the bloat in this way: "You pass the `--no-assets` flag when using `mix phx.new`"[2]

I do not know how true it is today.

[1] https://news.ycombinator.com/item?id=31317545

[2] https://hexdocs.pm/phoenix/Mix.Tasks.Phx.New.html

2 comments

As one of those others, I can confirm this is indeed still true as of Phoenix 1.7. `--no-assets` will not add any CSS or JS to the project other than empty `app.js` and `app.css` files in `/priv/static/assets` for you to fill in yourself if you want. You are completely on your own to implement an asset pipeline of your choosing. Of course, if you want LiveView you will have to bring some JS back in.
It depends what you do. If all you want is http requests and assets, no js needed. Being html or api.

If you want to handle a websocket and have a 2 way bindings, then no way around it. But that is not phoenix fault. It is the reality of the browsers api. It is pretty minimal js though.