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.

Last Post!

l3nz

l3nz

I always add my little baby GitHub - l3nz/say_cheez_ex: Say Cheez! for Elixir · GitHub that lets me grab the build hash / build time / environment variables at compile time, plus lets me add graphs to the docs in an easy-peasy way.

Where Next?

Popular in Discussions Top

AstonJ
Are there any Elixir or Erlang libraries that help with this? I’ve been thinking how streaming services like twitch have exploded recentl...
New
und0ck3d
Hello everyone! A few days ago I’ve created a topic here about how people were creating CMSs with Elixir and Phoenix. I’ve been studying...
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 14350 124
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
fireproofsocks
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement