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
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.
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 🫂.
Documentation Improvements
Prior to the most recent Ash release, you could not search for “options” in the autocomplete/search in HexDocs. Thanks to new features added (by us) in `ex_doc`, we can now support this 🎉 This is a small thing, but makes a huge difference when searching Ash docs.
Next week, this same treatment will be applied to all of the other Ash packages.
Releases
Ash: 3.4.56,3.4.57
Fixes
Fixed multiple bugs with calculation dependency loading in complex/multiply nested situations.
Improvements
for attribute multitenancy, when the attribute is also in the primary key, you could not use `Ash.get` without specifying both the tenant and that attribute value. Now you don’t need to specify both
Allow using atomic updates even in situations where the error expression is not supported.
Support nice shorthand syntax in `Ash.Query.add_error` just like `Ash.Changeset.add_error`.
Support for the `uses` option in `Ash.Generator` for `changeset_generator` and `seed_generator`. This allows depending on generated values that are needed for multiple inputs.
`autogenerate_enabled?` option for `Ash.Type`, allowing them to be used with Ecto schema’s `@autogenerate` option.
Warning when a domain has the policy authorizer on it but not all of its resources. This prevents a footman where you could believe that your domain policies were applying to resources when they are not.
Igniter: 0.5.9 - 0.5.16
Improvements
Add Owl & Inflex utility libraries. These tools are commonly used for code generation tasks, but due to the way that optional dependencies work, downstream packages can't have extra optional dependencies on those things. So they'd have to either add inflex/owl to their actual deps(bad, should be dev only) or force their end users to have two more optional deps to support their code generation.
Add a warning for a common windows arg parsing issue, which is that commas terminate tasks. So `mix igniter.new foo —install foo,bar` would end at `foo,`. Now if we detect a trailing comma in a csv argument, we raise an error.
Improve the Phoenix extension to know that `*Live` files go in the `/live` folder.
Default CLI confirmations to confirming if no option is selected `y → Y`
Add `Igniter.Libs.Phoenix.select_endpoint/3`
Fixes
Fix a crazy heisenbug that was resulting in incorrectly generated code. The resolution and rabbit hole investigation can be found on ElixirForum.
Various fixes for our deps compilation tasks.
Use `req` instead of `httpc` since we can’t actually guarantee that the httpc app was included in the host application
Don’t assume the path of the application module. Find it by module instead of by file path.
Handle comments better when adding, replacing or removing code.
`Igniter.Project.MixProject.update/4` now creates non-existing functions
Spark 2.2.37 - 2.2.40
Fixes
properly generate function type specs for info modules
Fix cases where certain DSL options were not having their parenthesis removed by `Spark.Formatter`
Improvements
Make sourceror and jason optional dependencies
Modify DSL docs so only top level sections are h2s
Add new utility for generating search data in ex_doc, using new ex_doc search data customization feature.
AshAuthentication 4.4.2 - 4.4.4
Improvements
improve the installers for magic link and hashed_password to automatically make `hashed_password` optional if both strategies are used.
Support sqlite in the installer. Great way to have a play w/o needing to set up a database.
The installer now generates emails with `<a ..` clickable links instead of just dumping links in as text. You still need to customize the generated emails, but it does look a bit nicer at least.
Fixes
Fix an accidental update of our `assent` dependency. Fun fact, Dependabot by default will update your actual `mix.exs` file. Set `versioning-strategy: lockfile-only` to tell it not to do that. Lesson learned, fixed across all our repos 😁
AshPostgres 2.5.0
Improvements
Add repo callbacks to disable atomic actions and error expressions. At the moment, citus users can’t leverage the `raise_ash_error` function, but should still be able to leverage atomic updates. This allows just disabling the `raise_ash_error` function.
Generate a repo in the resource installer if one does not already exist.
Add a repo callback for configuring how constraints are matched in one place. This is used for citus users to match out the integers that are suffixed to their indexes automatically.
Mark `ash_raise_error` as STABLE instead of VOLATILE
Use prettier SQL in `Ash.calculate`.
AshSQL 0.2.46 - 0.2.48
Fixes
Handle errors in query building when building certain nested many-to-many queries
Allow data layers to specify that a particular expression should not get type casting. Used to handle this kind of issue
AshSqlite 0.2.2
Improvements
Various installer improvements bringing it inline with `AshPostgres`
AshPhoenix 2.1.14
Improvements
Support for `_drop_*`, `_add_*` and `_sort_*` params. And a new corresponding guide on nested forms.
add new `AshPhoenix.Form.sort_forms` utility
Fixes
Print routes that you have to add on ash_phoenix.gen.live. This was accidentally removed in a recent refactor
Properly find matching forms by primary key instead of index when dealing with lists of nested forms that are being rendered.
Fix a case where you couldn’t read a nested form after deleting the last one
Fix a case where the last form couldn’t be deleted
Ensure code interfaces for update forms properly set the underlying data