adamu

adamu

What libraries do you pull in for a fresh project?

When starting a new project, do you have any go-to libraries you pull in out of habit/preference?

For example, Ash, Credo, Mox, ExMachina, etc.

Most Liked

eahanson

eahanson

I’m a co-author of Moar and I agree with your statement :slight_smile: … check out the very first line in its readme:

A dependency-free utility library containing 100+ useful functions. Add the library to your project, or just copy and paste the bits that you want.

The library was extracted from a bunch of code that I copied and pasted between projects (I’ve built 20+ Phoenix projects by now) and putting it in a public library is the easiest way to reuse it.

Moar and similar libraries probably have at least a few functions that are useful for others, so I’d recommend perusing the docs to see if anything jumps out at you, and then consider copying that code (and modifying it as needed), or adding the library to your project (Moar is dependency-free, and I assume most other utility libraries are). Moar’s docs have a short list of other utility libraries; if you are the author of such a library, feel free to add it to Moar’s docs.

10
Post #9
sodapopcan

sodapopcan

If you aren’t Ash’ing then Flop along with Flop.Phoenix along with Let Me covers all of pagination/filtering/sorting/authz in a pretty nice way. Ash was, in part, born out of not having these basic necessities but if you aren’t going to use Ash (which is of course totally fine) then these help a lot (and play nicely together). I really don’t like to ping but these libs are all by @woylie who has another very helpful one in ecto_nested_changeset. Really, I wish Phoenix had out-of-the-box solutions for all of these thing, even just as generators (a la phx_gen_auth) as it’s all stuff every project needs.

There’s also Sobelow.

To be a little catty and flip the question, I intentionally shun any type of “helper” libraries (I’ll pick on Moar as an example) and argue loudly against them in a team situation. At best they are unnecessary.

adamu

adamu

Thanks for the responses all, it’s useful to see what people find useful, there were a few in there that were new to me, and I’m sure this thread will be helpful for others starting new projects too :slight_smile:

This one made me :face_with_raised_eyebrow: - I usually try to remove Timex from legacy projects unless there is some specific functionality it’s providing that can’t easily be replaced by built-in functionality.

mudasobwa

mudasobwa

Creator of Cure

I tend to include blindly dev/test deps only

      {:mox, "~> 1.0", only: [:dev, :test]},
      {:stream_data, "~> 1.0", only: [:dev, :test]},
      {:doctest_formatter, "~> 0.2", only: [:dev], runtime: false},
      {:enfiladex, "~> 0.3", only: [:dev, :test]},
      {:excoveralls, "~> 0.14", only: [:test], runtime: false},
      {:credo, "~> 1.0", only: [:dev, :test]},
      {:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
      {:ex_doc, ">= 0.0.0", only: [:dev]}

Usually I also use some of my libs, such as estructura, finitomata, rambla, telemetria and antenna.

cmo

cmo

CompareChain!

Where Next?

Popular in Discussions Top

heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
adamu
When starting a new project, do you have any go-to libraries you pull in out of habit/preference? For example, Ash, Credo, Mox, ExMachin...
New
lud
Hello, I just extracted the boilerplate management code that I used to work with in previous years: It is yet another generic input d...
New
tristan
First announced on the Erlang Forum, BEAMup is a tool for installing a managing the active instance of BEAM languages. It has support for...
New
Sergiusz
Hello everyone, I don’t know if my post is appropriate. If it isn’t, you can delete it. After a year of designing and defining the requ...
New
dogweather
I’ve been brainstorming about ways to solve the N-dimensional code organization problem, and am thinking about developing a Smalltalk-lik...
New
New
ronindev
Hey everyone! :waving_hand: I just wanted to recommend https://seenode.com/ for deploying Phoenix apps. I’ve been using it recently and ...
New
gushonorato
Hey everyone, I’ve been working with Elixir for over 5 years and I’m a big enthusiast of the language. However, when starting new projec...
New
PragTob
:wave: I’m currently extracting the statistics calculation part from benchee and stumbled upon how to present error conditions. In the c...
New

Other popular topics Top

lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

We're in Beta

About us Mission Statement