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

(jsii) --add-deprecated-warnings flag should not add warning when a non-deprecated interface extends a deprecated interface #3111

Closed
nija-at opened this issue Nov 2, 2021 · 1 comment · Fixed by #3112
Assignees
Labels
bug This issue is a bug. p1

Comments

@nija-at
Copy link
Contributor

nija-at commented Nov 2, 2021

🐛 Bug Report

It is acceptable for a non-deprecated interface to extend a deprecated interface.
The --strip-deprecated flag correctly handles this, by not exporting the symbols around the deprecated interface.

However, the --add-deprecated-warnings flag does not account for this. It produces a warning when the non-deprecated interface is referenced.

Examples:

https://github.com/aws/aws-cdk/blob/db63fba358a5a8cc3d252156d14ead57d2b7560d/packages/%40aws-cdk/aws-ecr-assets/lib/image-asset.ts#L58

DockerImageAssetOptions is not deprecated whereas FingerprintOptions is.

https://github.com/aws/aws-cdk/blob/db63fba358a5a8cc3d252156d14ead57d2b7560d/packages/%40aws-cdk/aws-s3-assets/lib/asset.ts#L17

AssetOptions is not deprecated while CopyOptions is.

@nija-at nija-at self-assigned this Nov 2, 2021
@nija-at nija-at added p1 bug This issue is a bug. labels Nov 2, 2021
nija-at pushed a commit that referenced this issue Nov 2, 2021
… is extended

It is common in the AWS CDK for non-deprecated interfaces to extend
deprecated interfaces.
Currently, when this occurs and the non-deprecated subclass is
referenced, a warning is generated notifying the deprecation of its
superclass.

Modify the implementation such that the warning is produced only when
a property of the deprecated interface is referenced.

In the case when a deprecated interface with no required properties is
used without any of its properties set, a warning will not be generated.
This should occur rarely and the trade off is acceptable.

fixes #3111
nija-at pushed a commit that referenced this issue Nov 2, 2021
… is extended (#3112)

It is common in the AWS CDK for non-deprecated interfaces to extend
deprecated interfaces.
Currently, when this occurs and the non-deprecated subclass is
referenced, a warning is generated notifying the deprecation of its
superclass.

Modify the implementation such that the warning is produced only when
a property of the deprecated interface is referenced.

In the case when a deprecated interface with no required properties is
used without any of its properties set, a warning will not be generated.
This should occur rarely and the trade off is acceptable.

fixes #3111
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant