zachdaniel

zachdaniel

Creator of Ash

Hey folks! I’ll be teasing some interesting bits going into Ash 3.0 while I work on it, and this is post #1!

You can follow along with the changes, if you are interested in the 3.0 branch of Ash. Please do not use this branch :laughing:. If you find issues, I will not help you with them until an actual release candidate is published.

So, on to teaser #1!

Timeline

The current plan is to have a release candidate ready in March, so we are not far off from 3.0!

picosat_elixir Installation Issues

Some of our users (especially those on windows) experience installation issues with picosat_elixir. picosat_elixir is an excellent package, and we suggest that everyone starts there, we have published an alternative, called simple_sat. You can now select one of the two when following the getting started guide, and Ash will use whichever one is present.

We strongly suggest that folks eventually figure out their installation issues with picosat_elixir (our experience is that this is primarily isolated to windows users, and that folks eventually find a workaround). However, we didn’t want that to get in the way of people trying out Ash!

Registries are no more

Registries are no longer necessary, and as such are being removed for 3.0. This simplifies set up overall, and helps avoid a point of confusion that existed in 2.0, as registries were still supported but provided no tangible benefit.

Thats it!

There is tons more already done for 3.0, and more to come, but I’ll talk more about those in upcoming posts.

I hope you’re all as excited as I am!

Teaser #2: Ash 3.0 Teasers! - #9 by zachdaniel
Teaser #3: Ash 3.0 Teasers! - #23 by zachdaniel
Teaser #4: Ash 3.0 Teasers! - #28 by zachdaniel
Teaser #5: Ash 3.0 Teasers! - #30 by zachdaniel
Teaser #6: Ash 3.0 Teasers! - #36 by zachdaniel

Showing Posts 1 to 10

cvkmohan

cvkmohan

Thanks @zachdaniel. I will be watching all the teasers. Probably the best teaser #1 would have been the timeline that you have in mind regarding 3.0 release. A specific date is not expected but, 1week/1month/1quarter/1year level of timeline also would make it interesting. :slight_smile:

BryanJBryce

BryanJBryce

Yay, no more Registries!

zachdaniel

zachdaniel OP

Creator of Ash

Hey @cvkmohan, I think I’ve said it elsewhere but yes I think but it makes sense to put it in the post. I’ll edit the post, but the timeline is for a release candidate to be available in march :slight_smile:

zachdaniel

zachdaniel OP

Creator of Ash

Just to be clear, we do still need a list of resources, but we don’t need them to be in a separate module from your api :slight_smile:

kingdomcoder

kingdomcoder

Hey, Zach!

Always excited to see Ash’s progress

I have experienced the picosat_elixir problem so I’m curious if there are tradeoffs between it and the simple_sat alternative

Explaining the function these libraries serve in Ash might be a nice extra

zachdaniel

zachdaniel OP

Creator of Ash

simple_sat is essentially just much slower :slight_smile: it’s not made for production level workloads. It produces the correct results of course, though.

BryanJBryce

BryanJBryce

Yeah, I’ve already switched over

zachdaniel

zachdaniel OP

Creator of Ash

Hey everyone, time for Teaser #2!

If you missed teaser #1, check out out here: Ash 3.0 Teasers!

This is a big one :slight_smile:

Ash.Api → Ash.Domain

Ash.Api as a name has caused users lots of confusion in the past. It is an overloaded term. Also, while we considered it the “API to a given bounded context” as in, you always interacted with a resource through an API, we’ve ultimately decided to change the conceptual role of what we call an API. With that change, comes a name that is more representative of its function. Shoutout to @lukasender for the suggestion that stuck.

Ash.Domain represents the configuration of a domain, which includes things like “what resources are available to this domain”, as well as other high level configurations. Instead of calling to an API module, we provide one standard interface, but that interface must always be able to determine what Domain it is interacting with, in addition to what Resource it is working with. Keep reading for more on what this looks like.

domain option to use Ash.Resource

When creating a resource, you pass the domain option. For example:

defmodule MyApp.Accounts.User do
  use Ash.Resource,
    domain: MyApp.Accounts
end

This static configuration can be used in various places where you would have previously had to specify an api. For example, you no longer need to specify define_for in the code_interface block.

You will get a warning if you don’t pass the domain option, as well as if the configured domain doesn’t know about the resource.

Which leads us to one of the more significant changes of 3.0:

Using Ash instead of MyApp.MyApi

We will be deprecating the functions that we typically on MyApp.MyApi, in favor of those same functions defined in the Ash module. This allows us to refactor resources and move them from one domain to another without having to hunt down the calling code that interacts with it. It also helps reduce the cognitive overhead of having to remember what Api you’re working with for any given resource in order to call an action on it.

For example:

MyApp.Helpdesk.Ticket
|> Ash.Changeset.for_create(:open, %{title: "halp"})
|> MyApp.Helpdesk.create

MyApp.Helpdesk.count!(MyApp.Helpdesk.Ticket)

MyApp.Helpdesk.Ticket
|> Ash.Query.for_read(:open)
|> MyApp.Helpdesk.read!()

Would become

MyApp.Helpdesk.Ticket
|> Ash.Changeset.for_create(:open, %{title: "halp"})
|> Ash.create

Ash.count!(MyApp.Helpdesk.Ticket)

MyApp.Helpdesk.Ticket
|> Ash.Query.for_read(:open)
|> Ash.read!()

How to make this change

Good news! You can make this change before upgrading to 3.0. You can do everything stated above by configuring the api option when calling use Ash.Resource, and switching your calls to the api to call Ash! The difference between 2.0 and 3.0 is that in 3.0 the functions defined on the api module will be deprecated, and api has been renamed to domain.

Teaser #3: Ash 3.0 Teasers! - #23 by zachdaniel

24
Post #8
TwistingTwists

TwistingTwists

I like the byte size releases. I can read them. Digest them.

One question - How to move to domain from api in Ash 2.0 ? A link / migation guide?

zachdaniel

zachdaniel OP

Creator of Ash

There will be a guide for upgrading that will include the steps, but it essentially boils down to a big find and replace for Ash.Api and then api to find variables and options that should be renamed, followed by looking for calls to each api and replacing them with Ash :slight_smile: it will likely be the most inconvenient part of the upgrade for users.

Where Next? Top

Trending in News & Updates Top

sorenone
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
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
I’ll be using this thread to share Hologram patch release announcements. Minor releases will continue to get dedicated threads with blog ...
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
MdexMultilineCells is an MDEx plugin enabling multi-line cells in Markdown tables with full inline/block Markdown rendering and automati...
New
sorenone
This release unifies configuration for queues, repos, and services, swaps opaque timing integers for readable durations, and backports pe...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
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
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews