WIP — Realign boilerplate with `mix phx.new`
📖 Description
Now that the official release of Phoenix 1.7 have seen multiple maintenance releases, here is an open discussion about how we could adapt our boilerplate project to follow the community conventions to simplify future evolution as things are moving forward rapidly in the Erlang/Elixir/Phoenix ecosystem.
📓 References
I used the community tool to highlight the gap between 1.6 and 1.7:
- https://www.phoenixdiff.org/?source=1.6.15&source_variant=default&target=1.7.6&target_variant=default
I had to change a few things because we diverged from the community patterns a few version back and it doesn't fit well in the new functional component approach. Especially if we want to leverage component reusability between dead and live views:
- [x] Added Tailwind alongside Esbuild;
- [x] Completed the migration to
heexwith the new "view-module-less" approach;- I had to disable
CredoNaming.Check.Consistency.ModuleFilenamefor now since the validation rule do not match the new file structure convention with functional components.
- I had to disable
- [x] I merged every routers back to a single
ElixirBoilerplateWeb.Routermodule.- Using multiples
routerand a customplugto catch an haltedConnwas a red flag in my mind;
- Using multiples
- [x] Re-introduced the
ElixirBoilerplateWebmodule and the__using__macro to encapsulate the router/controller/html/live_view and live_component boilerplate likephx.newand the generators does; - [x] Updated the
Absintheconfiguration and added the missing dependency to supportSubscriptionover web socket; - [x] Introduce a
Sessionmodule which pulls the sessionkeyandsigning_salffrom environment variable at runtime. So we can use it right in both dead and live views; - [x] Added a default
Ectoschema and it corresponding migration so we are using--binary_id.
🦀 Dispatch
-
#dispatch/elixir
Thanks for your work on the elixir-boilerplate template, I really love the template and have used it in the past. I'm about to start a new phoenix/graphql project and wanted to use this but hopefully start with the most recent version of Phoenix. Do you plan on merging this in soon or should I just use this PR's branch as a template to create my next project if I want to use Phoenix 1.7?
Hey @willjleong, we are glad the templates is valuable to you ❤️
Let me rebase first as a few things changed between the last RC and the latest GA versions. We also merges a few minor tweaks in the main branch since I last worked on this PR…
I just submitted an update to the latest Debian release : https://github.com/mirego/elixir-boilerplate/pull/324
As soon as it gets 👍🏻 I’ll do the rebase…
🦀 Requesting reviewers for this pull request:
- @gingman (contributor with
0commits in the last 90 days and3commits overall) - @kevincote (reviewer for the
elixirstack)
⚠️ I am breaking up https://github.com/mirego/elixir-boilerplate/pull/249 in smaller chunks to simplify open discussion on the many aspect where our boilerplate project diverted from phx.new to realign our use of Phoenix, Absinthe and many libraries with the ongoing effort of the Elixir community.
@gcauchon Since you mentioned this ☝️ in #359, we can close this PR? (Or at least put it back in draft mode)
Yes!