zachdaniel

zachdaniel

Creator of Ash

Ash 3.1 Released!

Major themes

Generators! These are just the first entries into a powerful new suite of tools. Check out the generator docs for more! Ash and AshPostgres now have installers and generators powered by Igniter. We think that igniter is going to be a very big deal, expect to see a blog post, more updates to igniter, and installers & generators for each Ash package!

Built in UUIDv7 support: the type :uuid_v7 has been added to core, in addition to a uuid_v7_primary_key :name attribute builder. Thanks @moissela!

In addition, we’ve been hard at work cleaning up bugs, improving DX and smoothing out sharp edges.

Big Picture

One thing I wanted to touch on as part of this announcement, is the idea of “Ash 4.0”. Before those of you who have just done the 3.0 upgrade jump out of your seats, I’d like to explain that there are no current plans for a 4.0 version of Ash. It may happen in the future, if there are breaking changes that absolutely must go in, but if it ever does it will be 5-10% as big as the update from 2.0 → 3.0.

Ash core is, for the most part, now “feature complete”. There are tons of improvements that can be made to various subsystems, optimizations, nobs and dials added, etc. But the general shape of Ash as of 3.0 will be the general shape of Ash for many years to come.

Now we get to focus our efforts more on the Ash & Elixir ecosystem!

We hope this comes as good news to our users :slight_smile:

Changelog

Features:

  • [Generators] add mix ash.install (call with mix igniter.install ash)

  • [Generators] add mix ash.gen.resource

  • [Generators] add mix ash.gen.base_resource

  • [Generators] add mix ash.gen.domain

  • [Generators] add mix ash.extend

  • [Ash.Type.UUIDv7] Add built in Ash.Type.UUIDv7 type, and uuid_v7_primary_key builder

Bug Fixes:

  • [atomics] sort primary key changes ahead of others in atomic changes

  • [Ash.Changeet] fix typespec for Changeset.around_transaction/2 (#1292)

  • [multitenancy] ensure tenancy is always enforced on create/update/destroy actions

  • [loading relationships] lateral join on from_many? true relationships

  • [calculations] don’t reuse calculations/aggregates if authorize? is true

  • [aggregates] ensure aggregate context is fully configured in Ash.aggregate

  • [bulk actions] properly transfer changeset.context on streamed batch changesets

  • [bulk actions] ensure notifications are dispatched from bulk actions

  • [lazy loading] lazy-loading logic for calculations/aggregates was inversed (#1275)

  • [error handling] properly match on async task exceptions

  • [policies] ensure context is available in policy template expressions

  • [policies] ensure forbidden errors behave the same when using implicit bulk version of code interface functions

  • [manual relationships] compare keys in manual relationships when using ‘complex’ types (#1270)

  • [Ash.Filter] cover more cases in filter input parsing (#1261)

  • [has_one relationships] automatically set from_many? if a has_one has a sort applied

  • [Ash.Filter] fix match error when synthesizing joins across data layers

  • [Ash.DataLayer.Ets] properly support multitenancy when referencing relationships

  • [Ash.Type.Union] initialize & validate each subtype of a union

Improvements:

  • [Ash.Type.Enum] allow overriding cast_stored/2 and dump_to_native/2

  • [Ash.DataLayer.Simple] support offset in the simple data layer

  • [Ash.Changeset] allow after_action hooks in fully atomic changesets

First 10 of 14 Posts Switch mode

sevenseacat

sevenseacat

Author of Ash Framework

Awesome! The generators are really nice - they’ll save a lot of initial set up time, and copying and pasting boilerplate for things like new resources :star_struck:

arcanemachine

arcanemachine

Nice work! The book should be coming out pretty soon then?

zachdaniel

zachdaniel OP

Creator of Ash

Still a few months at least :slight_smile:

moissela

moissela

Awesome :fire:

IMO, Igniter will be a game changer, especially if in the future it will be adopted also in phoenix and liveview :star_struck:

netProphET

netProphET

I get the feeling that this isn’t a terrible time to be starting my Ash journey :flying_saucer:

ken-kost

ken-kost

I made the update and ElixirLS stopped working for me. Did anybody else experience this issue?

zachdaniel

zachdaniel OP

Creator of Ash

From 3.0 to 3.1?

EDIT: it seems to work well for me. You may want to try rm -rf .elixir_ls and letting it rebuild potentially?

ken-kost

ken-kost

Yes. I tried deleting deps and such, no luck. Made an issue on elixir ls but response was that it’s related to ash.

edit: okay, will try, didn’t try that.

mudspot

mudspot

I was just trying to figure out how to get uuid7 working with Ash yesterday!!!

Questions

  1. What’s the impact of changing uuid_primary_key :id to uuid_v7_primary_key :id in existing resources?
  2. currently in my postgres section, I have migration_defaults id: "fragment(\"uuid_generate_v4()\")" set. Is there a uuid7 equivalent?

Thanks for the awesome work!

zachdaniel

zachdaniel OP

Creator of Ash
  1. Should just work :slight_smile: Make sure to run ash.codegen
  2. This is done automatically for you. The "ash-functions" extension (as of the latest version of ash_postgres) includes a function to generate v7 uuids.

EDIT: Keep in mind though that the ordering of those converted from uuids to uuidv7s will be random.

Where Next? Top

Trending in News & Updates Top

kip
I’m a bit excited to announce that Localize and friends are now at release 1.0. Even though it’s a 1.0 release, it stands on 8 years of w...
New
bartblast
After building Hologram and sharing updates across various places, I’ve realized there’s a lot happening that doesn’t always make it to t...
New
bartblast
Hologram v0.11 is out! Two headline features this release. First, Elixir regexes now run in the browser. They were server-only until now,...
New
nseaSeb
Just published search_ash 0.5.0 (with search_core 0.4.0) on Hex. What’s new: synonyms You can now declare a synonym dictionary per lang...
New
mudasobwa
After years of struggling I made StreamData dependency optional. Finitomata.ExUnit got testing primitives for Persistence. Full back co...
New
sullyMusty
ActiveMemory 0.8.0 — in-memory tables that speak Ecto ActiveMemory 0.8.0 is now on Hex. ActiveMemory is an in-memory store built on ETS ...
New
mudasobwa
MdexMultilineCells is an MDEx plugin enabling multi-line cells in Markdown tables with full inline/block Markdown rendering and automati...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New

We're in Beta

About us Mission Statement