elixir-boilerplate icon indicating copy to clipboard operation
elixir-boilerplate copied to clipboard

WIP — Realign boilerplate with `mix phx.new`

Open gcauchon opened this issue 3 years ago • 6 comments

📖 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 heex with the new "view-module-less" approach;
    • I had to disable CredoNaming.Check.Consistency.ModuleFilename for now since the validation rule do not match the new file structure convention with functional components.
  • [x] I merged every routers back to a single ElixirBoilerplateWeb.Router module.
    • Using multiples router and a custom plug to catch an halted Conn was a red flag in my mind;
  • [x] Re-introduced the ElixirBoilerplateWeb module and the __using__ macro to encapsulate the router/controller/html/live_view and live_component boilerplate like phx.new and the generators does;
  • [x] Updated the Absinthe configuration and added the missing dependency to support Subscription over web socket;
  • [x] Introduce a Session module which pulls the session key and signing_salf from environment variable at runtime. So we can use it right in both dead and live views;
  • [x] Added a default Ecto schema and it corresponding migration so we are using --binary_id.

🦀 Dispatch

  • #dispatch/elixir

gcauchon avatar Feb 08 '23 02:02 gcauchon

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?

willjleong avatar Jun 19 '23 12:06 willjleong

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…

gcauchon avatar Jun 19 '23 12:06 gcauchon

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

gcauchon avatar Jun 19 '23 14:06 gcauchon

🦀 Requesting reviewers for this pull request:

  • @gingman (contributor with 0 commits in the last 90 days and 3 commits overall)
  • @kevincote (reviewer for the elixir stack)

mirego-builds avatar Jun 21 '23 13:06 mirego-builds

⚠️ 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)

remi avatar Aug 15 '23 14:08 remi

Yes!

gcauchon avatar Aug 15 '23 16:08 gcauchon