Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal (4.0): Inline global preparations into actions at compile time #1830

Open
sevenseacat opened this issue Feb 28, 2025 · 0 comments
Open
Labels
enhancement New feature or request needs review
Milestone

Comments

@sevenseacat
Copy link
Contributor

Is your feature request related to a problem? Please describe.

We ran into an issue where we were loading data in a preparation for a default read action, which caused other issues, but we weren't getting the new warning advising not to do that (introduced in e5656b6).

The reason is because the preparation was a global one, ie. in a preparations block, not in a specific action. These preparations aren't inlined into the action at compile time, meaning calling Ash.Resource.Info.action(MyResource, :read) won't list the preparation even though it will apply.

Describe the solution you'd like

These preparations should be added to each of the actions they apply to, at compile time. For now this will be all actions, as preparations can't have conditions, but later on conditions may be added.

@sevenseacat sevenseacat added enhancement New feature or request needs review labels Feb 28, 2025
@sevenseacat sevenseacat added this to the Ash 4.0 milestone Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs review
Projects
None yet
Development

No branches or pull requests

1 participant