Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP β€” Realign boilerplate with mix phx.new #249

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

gcauchon
Copy link
Contributor

@gcauchon gcauchon commented Feb 8, 2023

πŸ“– 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:

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:

  • Added Tailwind alongside Esbuild;
  • 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.
  • 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;
  • 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;
  • Updated the Absinthe configuration and added the missing dependency to support Subscription over web socket;
  • 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;
  • Added a default Ecto schema and it corresponding migration so we are using --binary_id.

πŸ¦€ Dispatch

  • #dispatch/elixir

@willjleong
Copy link

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?

@gcauchon
Copy link
Contributor Author

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
Copy link
Contributor Author

I just submitted an update to the latest Debian release : #324

As soon as it gets πŸ‘πŸ» I’ll do the rebase…

@gcauchon gcauchon marked this pull request as ready for review June 21, 2023 13:31
@mirego-builds
Copy link

πŸ¦€ 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)

@remi
Copy link
Member

remi commented Aug 15, 2023

⚠️ I am breaking up #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)

@gcauchon
Copy link
Contributor Author

Yes!

@remi remi changed the title Migrate to Phoenix 1.7 WIP β€” Realign boilerplate with mix phx.new Aug 15, 2023
@remi remi marked this pull request as draft August 15, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants