Ash Weekly: Issue #11
GigCity Elixir training tickets available, and a whole bunch of new useful tools across the board!
Ash Weekly!
This is a super quick, informal update about the goings on in and around Ash Framework each week. 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
Check out Ash Premium Support from Alembic.
Sponsor me if you like what I do.
GigCity Elixir Training
We’ve got a training coming up in Chattanooga for the illustrious GigCity Elixir conference in May! Tickets are not on sale for the training yet, but let me tell you: it is by far the best pricing we’ve ever had for a training, and there are only going to be a few slots available. Keep your eyes peeled for the announcement! You can also catch my talk about Igniter while you’re there 🎉.
Lots of useful stuff!
No major announcements this week, just a bunch of small-to-medium useful bits across the various packages. Not including bug fixes in these release notes has been great for my sanity, but it does also mean on weeks like this that you don’t get to see *just* how much is going on behind the scenes in making all the various packages and features work nicely together.
Releases
Ash: 3.4.71 - 3.5.1
Added `Ash.transaction/3`. We’ve had `Ash.DataLayer.transaction/3` as an escape hatch for running custom code in a transaction, but you always had to manually handle and dispatch notifications yourself.
A new context is available in `query.context.query_for` in preparations indicating if the query is being built for loading additional data (`:load`) or a bulk action (`:bulk_destroy` or `:bulk_update`).
A new template variable has been added, allowing you to refer to the tenant in expression templates.
A new constraint on the `:atom` type, called `unsafe_to_atom?` has been added. With that set to `true`, the atom will be created with `String.to_atom/1` instead of `String.to_existing_atom/1`. Only use this if strictly necessary.
A new expression, `exists/1` has been added, which is an alias of `exists(relationship, true)`.
More action types (specifically atomic action types) are supported in the generated code interfaces for `can_<name>`.
Igniter: v0.5.40
A host of new testing utilities have been added, like `assert_has_notice`, `assert_has_issue`, and `assert_has_warning`.
Added `Igniter.Code.Common.add_comment/2` for commenting code while patching.
Added `Igniter.Project.Config.configure_group/6`, for setting multiple configurations at once, and adding explanatory comments above the whole new config block.
AshJsonApi 1.4.23
More builtin types supported in the open api spec generated, including decimals and interval names.
AshAuthenticationPhoenix 2.5.2
Added a new function for nested LiveViews. Nested LiveViews inherit the session, but not assigns, unless you use `assign_new` with a callback to *maybe* refetch the user. You can read more here. We now provide a utility to have `AshAuthentication` do this for you. This is included in new installations by default, but you can this to your LiveUserAuth module, and then reference it in nested live views with `on_mount {LiveUserAuth, :current_user}`.
AshPaperTrail 0.5.2
A new DSL option `only_when_changed?` has been added, that instructs us to create a new version record even when no attributes have actually changed.