moxley

moxley

I’m trying to understand how to define a generic action, following the documentation. A generic action has a run option that appears to be where the work is done. There is a code example available that shows what using run with an anonymous function looks like for a happy path. All good so far.

The documentation for the run option gives a type spec of (any, any -> any) | module | module. What is any, any, and any supposed to be? What does the module in the type spec need to define? There’s no explanation under the “Doc” for run.

At the top of the actions.action documentation, it says “For calling this action, see the Ash.Domain documentation.”. Following that link goes to a fairly sparse page that has no mention of custom actions.

Is there another place in the documentation that talks about generic actions in more detail?

Showing Posts 1 to 9

barnabasJ

barnabasJ

Ash Core Team

Here is the behaviour you need to implement Ash.Resource.Actions.Implementation — ash v3.29.3

This should be referenced somewhere in the generic actions doc. If you’d like you could PR that.

The types should also clarify what the (any, any → any) should be. The anonymous function doesn’t take options.

moxley

moxley OP

Thank you. How do you return an error? The Ash.Resource.Actions.Implementation documentation only provides a spec of {:error, term()}.

barnabasJ

barnabasJ

Ash Core Team

The best thing to return there is either a built-in or custom exception.

But anything would potentially work and would be wrapped in an Ash.Error.Unknown exception.

moxley

moxley OP

Thank you

moxley

moxley OP

If you’d like you could PR that.

I’ve contributed documentation PRs to Ash before.

I’ve been using Ash for over a year in production now. The documentation has been a major pain point the entire time, every step of the way.

Ash’s documentation has been really, really, REALLY frustrating. It’s hard to hide that frustration as I ask question after question about how to use Ash on this forum. I’ve never had to ask questions on a forum to understand a software tool before, let alone ask a continuous string of questions over the course of a year. I still find myself asking after all this time, “should I tear Ash out of my application?”.

Are the maintainers aware of this, or is it just too big of a problem to address in the foreseeable future?

If I submitted a PR every time I ran into clearly missing documentation, I’d be spending all my time on writing documentation for the Ash Framework rather than on the software I’m using it for.

moxley

moxley OP

Here are some suggestions for improving the documentation:

  1. For documentation on topic A, if understanding of A requires familiarity with topic B, then mention, and provide a link, to topic B.
  2. Fill in the type specs. No more any() or term().
  3. Fill in empty spots where there should be text.
zachdaniel

zachdaniel

Creator of Ash

We are aware, and this is the next major item on the docket. All reference documentation on every package will be gone over, including ensuring every function has typespecs, every option to every function is documented, and cross links exist to relevant guides etc.

zachdaniel

zachdaniel

Creator of Ash

For context on “when” there isn’t a timeline so to speak, but this is labeled as “v3.5” in my notes. So literally the next thing that will happen.

moxley

moxley OP

Wonderful. That’s great to hear @zachdaniel! Thank you for providing this framework to the community.

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
subsaharancoder
I’ve followed the Phoenix LiveView file upload code here Uploads — Phoenix LiveView v1.0.0-rc.7 and so far everything works just fine wit...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
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
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
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
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
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

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews