Skip to content

feat(mixins-preview): align Mixins API with latest RFC proposal#36825

Merged
mergify[bot] merged 1 commit into
mainfrom
mrgrain/feat/mixins-update
Jan 30, 2026
Merged

feat(mixins-preview): align Mixins API with latest RFC proposal#36825
mergify[bot] merged 1 commit into
mainfrom
mrgrain/feat/mixins-update

Conversation

@mrgrain
Copy link
Copy Markdown
Contributor

@mrgrain mrgrain commented Jan 30, 2026

Reason for this change

The RFC for CDK Mixins was updated with several changes. This PR aligns the implementation of the preview package with the latest changes. It also includes some other API improvements to make Mixins more intuitive and consistent.

Description of changes

  • Replace mustApply() with separate requireAll() and requireAny() methods that set expectations before calling apply(). This was a change to the RFC. To support this change, this also includes:
    • New report getter to track successful applications, returning an array of the new MixinApplication interface
    • New selectedConstructs getter to see which constructs were matched by the selector
  • Make .with() silently skip unsupported constructs instead of throwing, this is implementing an RFC change
  • Change applyTo() return type from IConstruct to void since mixins modify in place (RFC change)
  • Rename EnableVersioning to BucketVersioning for consistency with other S3 mixins
  • Add BucketVersioning constructor parameter to allow suspending versioning
  • Add aws-mwaaserverless service module (wasn't committed before for some reason)
  • Disable source maps in tsconfig, this aligns more with aws-cdk-lib which also doesn't emit sourcemaps.

Description of how you validated changes

Updated existing unit tests to reflect the API changes and added new tests for requireAll(), requireAny(), and the report getter.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team January 30, 2026 15:55
@github-actions github-actions Bot added the p2 label Jan 30, 2026
@mergify mergify Bot added the contribution/core This is a PR that came from AWS. label Jan 30, 2026
@mrgrain mrgrain changed the title feat(mixins-preview): improve Mixins API with requireAll/requireAny and void return type feat(mixins-preview): align Mixins API with latest RFC proposal Jan 30, 2026
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@mrgrain mrgrain added pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-test The PR linter will not require test changes pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-codecov The PR linter will not require codecov checks to pass pr-linter/exempt-size-check The PR linter will not check the size of the PR and removed pr-linter/exempt-size-check The PR linter will not check the size of the PR labels Jan 30, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 30, 2026 15:58

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@mrgrain mrgrain force-pushed the mrgrain/feat/mixins-update branch from d0625a7 to 1e334d1 Compare January 30, 2026 16:03
@mrgrain mrgrain removed pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-test The PR linter will not require test changes pr-linter/exempt-codecov The PR linter will not require codecov checks to pass labels Jan 30, 2026
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 30, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 30, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify Bot merged commit 82c2fdb into main Jan 30, 2026
40 of 41 checks passed
@mergify mergify Bot deleted the mrgrain/feat/mixins-update branch January 30, 2026 17:35
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 30, 2026

Merge Queue Status

✅ The pull request has been merged at 1e334d1

This pull request spent 6 seconds in the queue, with no time running CI.
The checks were run in-place.

Required conditions to merge

@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 30, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contribution/core This is a PR that came from AWS. p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants