phoenixframework / phoenix

Peace of mind from prototype to production
https://www.phoenixframework.org
MIT License
21.45k stars 2.88k forks source link

Add Oban generator to phx.new #5970

Closed sorentwo closed 1 week ago

sorentwo commented 1 week ago

This adds Oban by default to phx.new with the following considerations:

Questions

It Works!

Here's a screenshot after running mix phx.new my_app; mix ecto.reset; iex -S mix phx.server and checking that Oban is up and running:

Screenshot 2024-11-09 at 17 03 56
SteffenDE commented 1 week ago

I am a big fan of Oban (also using Oban Pro at work), but I’m not sure how far we should go with including external libraries in the official generators, as those integrations need to be maintained. Maybe it would be better to improve extending the generators from external packages? There could be a mix oban.phx.new or mix phx.new --plugin oban (where the oban hex package would need to provide a specific module).

sorentwo commented 1 week ago

After some reflection, and some outside advice, I don't think this is a good fit. Oban shouldn't be in every Phoenix app, especially not by default. Aside from the slippery slope of "what belongs in Phoenix by default", there's too much separate education necessary to use it and understand what it is doing.

Now that I've gone through the exercise of seeing all the touch points, I'll revisit a simplified igniter based installer instead.

sorentwo commented 1 week ago

Maybe it would be better to improve extending the generators from external packages? There could be a mix oban.phx.new or mix phx.new --plugin oban (where the oban hex package would need to provide a specific module).

That's a nice idea. Making it possibly to auto-install commonly used packages seems helpful.