Ash Weekly?
This is a super quick, informal update about the goings on in and around Ash Framework, each week. Don’t expect anything crazy 😁. This is primarily meant for folks who are using Ash professionally, or who really want to stay up to date on the project. I’ll also include things that interest me from the Elixir ecosystem at large. If you find something interesting and think it should make it on this newsletter, drop a message in the #ash-weekly channel in our Discord server.
Shameless Plugs
Read our book! (details below)
Check out Ash Premium Support from Alembic. Want to accelerate you or your company’s development with Ash? This is by far the best way.
If you need even more help, and want to work with a group of experts that can help you achieve anything, Alembic also offers services. We can build your software, augment your team, train your team, you name it!
Sponsor me if you like what I do. Ultimately, it is extra oomph to keep me going because Ash is pretty much 2 jobs. With that said, I don’t live on it, so don’t feel bad about not giving me money directly. There are creators others who need it more! Or maybe donate to a cause you believe in on my behalf 🫂.
Ash Framework book, beta release!
This has been a labor of love, and still three more chapters to come. We’ll be writing more about this soon, and will update everyone as more chapters are released. Everyone has been so supportive and kind, thank you all for all the kind words about the book!
New Website & Installer
Head over to the new website to try out our interactive installer! It is pretty slick 😎
Cool Igniter Changes
See the notes below, but here is a neat preview of what it looks like to generate a new app, and then subsequently what it looks like to add `ash_admin` and `ash_double_entry` to your app, now that they have igniter installers! Technically it shows getting a warning about installing `ash_postgres` and rerunning, but that kind of “smart help” is all part of it 😁
Releases
Ash: 3.4.55
Improvements
When managing relationships, destroy any missing records *first*. This prevents a case where unique constraints between the new records and the records that are going to be deleted conflict.
Add `start_of_day/2` function that converts a date or a datetime to the correspond start of its day (at 00:00 time). This has not yet been added to any of the data layers.
add `cast_dates_as` constraint to `Ash.Type.DateTime`
Fixes
Bug fixes around passing arguments to read actions using `Ash.can?`. If you’d hit this you’d know, as your calls to `Ash.can?` (but not Ash’s internal calls, they don’t use it this way) would not be using your argument values.
Various fixes for `Ash.Generator` (almost like the next chapter of the Ash book is about testing or something…)
AshAuthentication: v4.4.0 & v4.4.1
Improvements
Improve generators for `ash_authentication` to create swoosh email senders when generating into phoenix apps
Fixes
Fixed a bug where multiple generators would fail when multiple auth strategies are provided
Our version constraint on `assent` was too loose, and allowed us and others to upgrade to `assent` `v0.3` which contained a breaking change for google from oauth2 to oidc. We should make the same change and then upgrade, but that will likely be a while before we can do that. Volunteers welcome 🙏
Fix handling `UID` for user identity resources. Some providers would give it to us as an integer, but we store it as a string and needed to add `to_string/1` to make that work.
Fix for the recently added `require_confirmation` option in password strategy, whereby it was only applied on sign in but not registered. Not serious as the feature was only just introduced in the previous point release 😁
AshPostgres: v2.4.22
Fixes
fixed a bug with bulk destroys that were being generated with `distinct?`. In those cases, we use our “delete from where exists” logic on a subquery that contains the distinct.
fixed a bug in the migration generator that would cause issues generating unique indexes for identities when multiple resources use the same table. NOTE: we should probably show a warning if multiple resources use the same table. The migration generator is smarter than people typically expect and will generate the migrations for the “most restrictive but still compatible” table definition when multiple resources use the same table. This surprises people because, and they’re not wrong, who would be insane enough to put in all of the work to make it work that way.
AshSql: v0.2.45
For those that don’t know, this package is where lots of shared logic between SQL data layers live. Many fixes for `AshPostgres` and friends actually happen here.
Fixes
When we are joining to related aggregates, if the field of the aggregate is a calculation that references related data (also an insane thing to support 🤷) we needed to also join on anything required by that calculation.
AshAdmin: v0.12.6
Improvements
Added an `igniter` installer. Now you can just `mix igniter.install ash_admin` 🎉
Fixes
Fix cases where primary read actions were not pulled from the resource correctly.
AshDoubleEntry: v1.0.8 & 1.0.9
Improvements
Added an `igniter` installer. Now you can just `mix igniter.install ash_double_entry` 🎉