-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(core): facility to warn when deprecated APIs are used #9585
Conversation
Introduce `Annotations.addDeprecation()` which will attach a warning to the construct indicating that a deprecated API is used. At the moment, we only use this to warn when `.node` is used instead of `.construct`, but we will gradually use this to report the usage of all deprecated APIs as a preparation for v2.0. If the environment variable `CDK_BLOCK_DEPRECATIONS` is set (and it is set in `cdk-test`), it will cause usage of deprecated APIs to throw an error instead. Related: aws/aws-cdk-rfcs#192
Co-authored-by: Niranjan Jayakar <nija@amazon.com>
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Introduce
Annotations.addDeprecation()
which will attach a warning to the construct indicating that a deprecated API is used.At the moment, we only use this to warn when
.node
is used instead of.construct
, but we will gradually use this to report the usage of all deprecated APIs as a preparation for v2.0.If the environment variable
CDK_BLOCK_DEPRECATIONS
is set (and it is set incdk-test
), it will cause usage of deprecated APIs to throw an error instead.Related: aws/aws-cdk-rfcs#192
Build will be failing until #9584 is merged
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license