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

fix: deprecated symbol stripping does not strip out heritage clause with imported type #2783

Merged
merged 7 commits into from
Apr 13, 2021

Conversation

nija-at
Copy link
Contributor

@nija-at nija-at commented Apr 9, 2021

When a non-deprecated class or interface inherits a deprecated class or
interface, the --strip-deprecated option does not strip out the
heritage clause.

This particularly affects cases where the inherited class or interface
is non-local, i.e., imported from another file.


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

…ith imported type

When a non-deprecated class or interface inherits a deprecated class or
interface, the `--strip-deprecated` option does not strip out the
heritage clause.

This particularly affects cases where the inherited class or interface
is non-local, i.e., imported from another file.
@nija-at nija-at requested review from RomainMuller and a team April 9, 2021 15:46
@nija-at nija-at self-assigned this Apr 9, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 9, 2021
Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Missing test

@nija-at
Copy link
Contributor Author

nija-at commented Apr 12, 2021

Testing

  • Ran run-against-dist with test-typescript-app.sh and verified that the tests succeed. Before this change, the run would fail with errors that classes are missing in the declaration file.
  • Ran jsii --strip-deprecated before and after the fix; verified the output. The changes are as expected with no regressions. See below.
⇒  diff -r aws-cdk-lib /tmp/aws-cdk-lib/ | tee /tmp/output
diff -r aws-cdk-lib/.jsii /tmp/aws-cdk-lib/.jsii
56c56
<   "jsiiVersion": "0.0.0 (build 80bdbab@dev)",
---
>   "jsiiVersion": "0.0.0 (build 82c6880@dev)",
880687c880687
<   "fingerprint": "+xpjYYvvlVnbhCzIV65R4tXpnnfDXKNWBGDc589sSbo="
---
>   "fingerprint": "7CXbooZDIeos0nZQXff852CWloBPc9rdoInObxyDWqc="
diff -r aws-cdk-lib/lib/aws-ecr-assets/lib/image-asset.d.ts /tmp/aws-cdk-lib/lib/aws-ecr-assets/lib/image-asset.d.ts
9c9
< export interface DockerImageAssetOptions {
---
> export interface DockerImageAssetOptions extends FingerprintOptions {
58c58
< export declare class DockerImageAsset extends Construct {
---
> export declare class DockerImageAsset extends Construct implements IAsset {
diff -r aws-cdk-lib/lib/aws-s3-assets/lib/asset.d.ts /tmp/aws-cdk-lib/lib/aws-s3-assets/lib/asset.d.ts
9c9
< export interface AssetOptions extends cdk.AssetOptions {
---
> export interface AssetOptions extends CopyOptions, cdk.AssetOptions {
diff -r aws-cdk-lib/lib/custom-resources/lib/provider-framework/provider.d.ts /tmp/aws-cdk-lib/lib/custom-resources/lib/provider-framework/provider.d.ts
101c101
< export declare class Provider extends Construct {
---
> export declare class Provider extends Construct implements ICustomResourceProvider {

@nija-at nija-at marked this pull request as ready for review April 12, 2021 15:43
@nija-at nija-at requested a review from a team April 12, 2021 15:43
@mergify
Copy link
Contributor

mergify bot commented Apr 13, 2021

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Apr 13, 2021
@mergify
Copy link
Contributor

mergify bot commented Apr 13, 2021

Merging (with squash)...

@mergify
Copy link
Contributor

mergify bot commented Apr 13, 2021

Merging (with squash)...

@mergify
Copy link
Contributor

mergify bot commented Apr 13, 2021

The title of this Pull Request does not conform with [Conventional Commits] guidelines. It will need to be adjusted before the PR can be merged.
[Conventional Commits]: https://www.conventionalcommits.org

@mergify mergify bot merged commit e87d879 into main Apr 13, 2021
@mergify mergify bot deleted the nija-at/fix-imports branch April 13, 2021 10:50
@mergify
Copy link
Contributor

mergify bot commented Apr 13, 2021

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants