docs: move API -> Domain change to the top of upgrade doc (#971)

This commit is contained in:
Dmitrii 'Mamut' Dimandt 2024-04-03 21:36:35 +02:00 committed by GitHub
parent d4fcc7565b
commit f86c7f971b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,6 +19,17 @@ This section contains each breaking change, and the steps required to address it
If you use `Ash.Flow`, include `{:ash_flow, "~> 0.1.0"}` in your application.
### Ash.Api is now Ash.Domain
The previous name was often confusing as this is an overloaded term for many. To that end, `Ash.Api` has been renamed to `Ash.Domain`, which better fits our usage and concepts.
#### What you'll need to change
To make this change you will need to do two things:
1. replace `Ash.Api` with `Ash.Domain` in your application
2. replace places where an `:api` option is passed to a function with the `:domain` option. For example, `AshPhoenix.Form.for_create(..., api: MyApp.SomeApi)` should now be `AshPhoenix.Form.for_create(..., domain: MyApp.SomeDomain)`
### DSL Changes
- `code_interface.define_for` is now `code_interface.domain`. Additionally, it is set automatically if the `domain` option is specified on `use Ash.Resource`.
@ -161,19 +172,6 @@ Additionally, the following exceptions have had keys remapped:
## Significant Changes
### Ash.Api is now Ash.Domain
The previous name was often confusing as this is an overloaded term for many. To that end, `Ash.Api` has been renamed to `Ash.Domain`, which better fits our usage and concepts.
#### What you'll need to change
To make this change you will need to do two things:
1. replace `Ash.Api` with `Ash.Domain` in your application
2. replace places where an `:api` option is passed to a function with the `:domain` option. For example, `AshPhoenix.Form.for_create(..., api: MyApp.SomeApi)` should now be `AshPhoenix.Form.for_create(..., domain: MyApp.SomeDomain)`
---
### the `Domain` of a resource must now be known when constructing a changeset, query or action input
In order to honor rules on the `Domain` module about authorization and timeouts, we have to know the `Domain` when building the changeset.