Skip to content

Commit

Permalink
docs(core): aspects with same priority are not guaranteed to be execu…
Browse files Browse the repository at this point in the history
…ted in the same order (aws#33596)

document that we don't guarantee the same order for aspects with the same priority level.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
kaizencc authored Feb 26, 2025
1 parent d9d3726 commit 4879c04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/aws-cdk-lib/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,10 @@ values must be non-negative integers, where a higher number means the Aspect wil

By default, newly created nodes always inherit aspects. Priorities are mainly for ordering between mutating aspects on the construct tree.

CDK provides standard priority values for mutating and readonly aspects to help ensure consistency across different construct libraries:
CDK provides standard priority values for mutating and readonly aspects to help ensure consistency across different construct libraries.
Note that Aspects that have same priority value are not guaranteed to be executed
in a consistent order.


```ts
/**
Expand Down
5 changes: 4 additions & 1 deletion packages/aws-cdk-lib/core/lib/aspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export interface AspectOptions {
* The priority value to apply on an Aspect.
* Priority must be a non-negative integer.
*
* @default - AspectPriority.DEFAULT
* Aspects that have same priority value are not guaranteed to be
* executed in a consistent order.
*
* @default AspectPriority.DEFAULT
*/
readonly priority?: number;
}
Expand Down

0 comments on commit 4879c04

Please sign in to comment.