3 ms·
A new phoenix application is not a monolith. The `phoenix.new` generator generates a regular Elixir application for you that sets up a default Endpoint worker i
by chrismccord 10y ago
A new phoenix application is not a monolith. The `phoenix.new` generator generates a regular Elixir application for you that sets up a default Endpoint worker in your supervision tree, as well as a web directory to put phoenix related files (routers, controllers, etc). wrt to collective process, we add `worker(MyApp.Endpoint, [])` into your supervision tree, so we do exactly what you are wanting. Building a Phoenix application is building an Elixir application, not the other way around. Your phoenix dependency and related workers are just one component to your larger Elixir/OTP infrastructure. Note: Lance Halvorsen, who gave the "Phoenix is not your App" talk, is on the Phoenix core team. We have been pushing these ideas since the beginning and as Lance I and laid out in our ElixirConfEU talks, we're taking a stronger stance on isolation with upcoming changes to guides and phoenix resource generators.
- askyourmother 10y agoI said this before: phoenix is the new Rails, and that is not a good thing. Phoenix will end up bogged down with the same great "ideas", hex will end up chock full of crap like gems. Elixir ok, phoenix not so much.
- chrismccord 10y agoaskyourmother, while you're busy putting down other communities and folks' hardwork, we'll continue building the future. Comments like these aren't welcome and add zero value to the conversation.
- askyourmother 10y agoIf you want to rebuild Rails in elixir, go for it. Seems like a wasted opportunity though - to break away from all things Rails. And yes, phoenix will end up bogged down like Rails, and hex will end up chock full of crap, it is the Rails developer mentality I'm afraid, they just can't help themselves.
- maz-dev 10y agoHave you tried Phoenix? I can see some similarities with Rails, but Phoenix's components are way more decoupled. In my current app Phoenix is handling the websocket messaging stuff. All the real logic is handled by Elixir modules and apps that have nothing to do with Phoenix. I like to think of Phoenix as an interface to my app. It's less intrusive than Rails. You don't have to use Ecto (the "ORM" thingy that is actually not an ORM) to get get the full power of Phoenix, it's also decoupled. Regarding Hex, it's like every package managers out there. Sure you can publish anything. Rubygem is full of crap, npm is full of crap etc.. But I can also find some very small and focused libraries that wouldn't have been published, had a quality filter been setup to publish anything.
- deleted 10y ago[deleted]
- pmontra 10y agoUnderstood but to make me clear: I'd like to see Phoenix as part of an umbrella application and not it starting other applications as its workers. It should be a peer among peers and not the boss. However, as Rails demonstrated, the current approach is very convenient so I can hardly criticize it too much at this stage of Phoenix adoption. I think it helps the onboarding to the platform.
- chrismccord 10y agoPhoenix v1.3 is adding an `--umbrella` flag to the `phoenix.new` generator for first-class umbrella support out of the box. In the Phoenix book we also have the reader breakout their application in an umbrella for the domain bits and a web app for the phoenix bits. Umbrellas have been a little underserved in the community so far, but stay tuned for future improvements around this.
- pmontra 10y agoGreat news, thanks!