Skip to content

Split pow project into 2 projects (one for ecto stuff, other to the rest) #603

@sezaru

Description

@sezaru

Phoenix allows us to create a project with or without Ecto support, the idea is that if you can better separate your project into multiple libraries. This is exactly what I do, I have a BusinessDB library that contains all about my business database, including the user's table which I use pow helper functions to create its fields.

This project is used in multiple other projects, some of them have the Phoenix framework, and some not. But since pow itself depends on phoenix, all these projects end up with phoenix as a dependency too.

This doesn't have any problems, but it is annoying since the release will be bigger and I will receive runtime warnings like this one:

warning: Phoenix now requires you to explicitly list which engine to use
for Phoenix JSON encoding. We recommend everyone to upgrade to
Jason by setting in your config/config.exs:

    config :phoenix, :json_library, Jason

And then adding {:jason, "~> 1.0"} as a dependency.

If instead you would rather continue using Poison, then add to
your config/config.exs:

    config :phoenix, :json_library, Poison

  (phoenix 1.5.7) lib/phoenix.ex:38: Phoenix.start/2
  (kernel 7.2) application_master.erl:277: :application_master.start_it_old/4

So I was wondering what would be your opinion to split pow into 2 projects, pow_ecto and pow.

pow_ecto would contain all Ecto dependencies, functionality, queries, and helper functions.
pow would contain all the rest and would depend on pow_ecto.

That way I would be able to make BusinessDB depend on pow_ecto instead of pow and not have phoenix as a dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions