I've been writing Elixir at work for a few weeks. Yesterday I dove into a friend’s JS codebase and immediately got confused by the async stuff. While I used to write JS full time, the past 6 months I've spent in Elixir-land has really spoiled me.
I haven't written a lot of async/await code. It's supposed to be simpler than Promises, which are also simpler than callback-soup.
Right.
It's a bit embarrassing, but after all these years of writing JavaScript code - I still trip over async stuff. Sometimes I'm hard on myself - mostly my interior dialogue thinks: You haven't written enough JS to have it be second nature. That might be true, but there might also be more to it.
>Note: This post was originally called "Why not use Elixir Streams all the time?" Half-way through the writing of that post, I started googling this question and realized that there was already some research done and I quickly got a variety of good answers. With that said, I think I'll leave this … >
In this post, I walk through learning about and creating my first GenServer for Galley.
While on vacation, I was able to return to Galley and work on a feature that I've been wanting to do for a while - adding… >
Today I want to share a fun refactor that finally "clicked" for me (and it was right there in plain view for quite some time!). Let me set the stage.
>I get to write Elixir at my new job! This is my first time writing it in a professional setting. I have written Clojure for work and while Clojure and Elixir share quite a few similarities, I am learning lots of new things. Most of my learnings are around Elixir idioms and growing my knowledge of the concepts that the syntax of the language wraps around.
In a sense, this post is sort of a follow up to my post on side projects vs work for learning. The previous post is pretty... vague and hand-wavey, but this one will be a bit more concrete on some of the things I've learned. Let's jump into it.
>At the end of last week, I had a bit of fun approaching how to migrate recipes from Ari's Garden to Galley The high-level problem is that Ari's Garden is an elm application that consumes a big JSON file whereas Galley needs recipe data to be input by form.
>Today I'm delighted to say that I've deployed Galley, making it the first project of my "4-projects-a-year" that has been completed (and with 2 weeks to spare). In this post, I'll write about why I think I was able to complete this project and about deployment. Let's start with the latter.
>Oh, hello again. It's the 9th of June already. How did that happen? I'm blaming part of the haze of the last few days of a bad chest cold I got that drowned me in a sea of Nyquil + sleeping + reading.
I have until the end of June until I move on to my next project. Galley is almost done; its MVP - what remains is to set up an email system and to import some recipes. I've been putting off setting up the email system because I know it will have to cover a lot - user registration and confirmation, email and password changes, as well as other stuff I'm sure. From my brief scanning, the Elixir libraries for email management have definitely improved since I last perused them sometime in 2018.
>I had a fairly productive refactoring session on a small function that I thought I would write about. In Galley, my recipe/cooking application, I have a home / index page where users can search and view recipes. At the current state, a user can search by recipe name and can filter by all recipes or their recipes. At the moment I am building out a tagging functionality such that a user can search by tags shared between recipes such as spicy, salad, or easy, for example.
With these three sources of permutation, I need to account for a database query that could have a mixed bag of search queries, tags, and filters.
>It's been a busy few weeks, and I haven't had a chance to check in. We returned from Vancouver about 10 days ago and had to jump back into the work and normal life stuff without missing a beat. After that, we moved to our new apartment in Toronto. We're settling down, which means this is the end of our put-everything-in-storage-and-go-where-we-want lifestyle. For the most part, this is good, but I will miss being able to travel without burning rent.
>I'm back with another post on Elixir. This one is about working with LiveView and building dynamic forms. When I talk about dynamic forms I'm referring to the ability to add or remove any number of form fields for a "embeds_many" data type. In the case of Galley, the recipe form has many parts to it, the pertinent ones here being the ingredients and the steps. Any recipe has a variable number of ingredients and instructional steps. I needed to enable users to add and/or delete form fields to fit their recipes.
This turned out to be a bit harder than I thought, as I waded into the world of LiveView and the mechanics of Ecto and Phoenix at the same time.
>I'm back with a post with some thoughts on Elixir & Phoenix after using it for a few weeks. It's been really fun. I'm using Elixir & Phoenix to build "Galley," a web app for storing recipes.
>It's a new quarter, so I'm working on a new project. This one will be a rebuilding of my old cooking site, Ari's Garden. The new project is tentatively called "Galley". This post is a bit of a long-winded ramble about what I would like Galley to be, the tech it would use, and how it will be different.
>