Skip to content

chore: fix build break caused by exported deprecated functions - #17719

Merged
mergify[bot] merged 1 commit into
v2-mainfrom
njlynch/fix-deprecated-functions
Nov 25, 2021
Merged

mergify[bot] merged 1 commit into
v2-mainfrom
njlynch/fix-deprecated-functions

Conversation

@njlynch

@njlynch njlynch commented Nov 25, 2021

Copy link
Copy Markdown
Contributor

Functions (not member methods) aren't acknowledged by jsii, so they are not
stripped out of the compiled source, even when deprecated. These two functions
are deprecated and reference deprecated interfaces. When running the init
template tests against JS/TS, the tests fail with:

node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(110,62): error TS2304: Cannot find name 'FixedResponse'.
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(116,68): error TS2304: Cannot find name 'RedirectResponse'.

By -- on v2 only -- un-exporting the functions and inlining them in their
secondary usages, we can effectively "strip" these functions from the JS/TS.


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

Functions (not member methods) aren't acknowledged by jsii, so they are not
stripped out of the compiled source, even when deprecated. These two functions
are deprecated and reference deprecated interfaces. When running the init
template tests against JS/TS, the tests fail with:

```
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(110,62): error TS2304: Cannot find name 'FixedResponse'.
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(116,68): error TS2304: Cannot find name 'RedirectResponse'.
```

By -- on v2 only -- un-exporting the functions and inlining them in their
secondary usages, we can effectively "strip" these functions from the JS/TS.
@njlynch
njlynch requested a review from a team November 25, 2021 18:19
@njlynch njlynch self-assigned this Nov 25, 2021
@gitpod-io

gitpod-io Bot commented Nov 25, 2021

Copy link
Copy Markdown

@mergify mergify Bot added the contribution/core This is a PR that came from AWS. label Nov 25, 2021
@github-actions github-actions Bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Nov 25, 2021
@rix0rrr

rix0rrr commented Nov 25, 2021

Copy link
Copy Markdown
Contributor

@Mergifyio backport v2-release

@mergify

mergify Bot commented Nov 25, 2021

Copy link
Copy Markdown
Contributor

backport v2-release

🟠 Waiting for conditions to match

Details
  • merged [:pushpin: backport requirement]

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 4dafd7d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
mergify Bot merged commit 12f60f5 into v2-main Nov 25, 2021
@mergify
mergify Bot deleted the njlynch/fix-deprecated-functions branch November 25, 2021 18:53
@mergify

mergify Bot commented Nov 25, 2021

Copy link
Copy Markdown
Contributor

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).

mergify Bot pushed a commit that referenced this pull request Nov 25, 2021
Functions (not member methods) aren't acknowledged by jsii, so they are not
stripped out of the compiled source, even when deprecated. These two functions
are deprecated and reference deprecated interfaces. When running the init
template tests against JS/TS, the tests fail with:

```
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(110,62): error TS2304: Cannot find name 'FixedResponse'.
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(116,68): error TS2304: Cannot find name 'RedirectResponse'.
```

By -- on v2 only -- un-exporting the functions and inlining them in their
secondary usages, we can effectively "strip" these functions from the JS/TS.

----

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

(cherry picked from commit 12f60f5)
@mergify

mergify Bot commented Nov 25, 2021

Copy link
Copy Markdown
Contributor

backport v2-release

✅ Backports have been created

Details

mergify Bot added a commit that referenced this pull request Nov 25, 2021
…ort #17719) (#17720)

This is an automatic backport of pull request #17719 done by [Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the [documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>
njlynch added a commit that referenced this pull request Nov 26, 2021
* chore: fix build break caused by exported deprecated functions (#17719)

Functions (not member methods) aren't acknowledged by jsii, so they are not
stripped out of the compiled source, even when deprecated. These two functions
are deprecated and reference deprecated interfaces. When running the init
template tests against JS/TS, the tests fail with:

```
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(110,62): error TS2304: Cannot find name 'FixedResponse'.
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(116,68): error TS2304: Cannot find name 'RedirectResponse'.
```

By -- on v2 only -- un-exporting the functions and inlining them in their
secondary usages, we can effectively "strip" these functions from the JS/TS.


----

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

* chore: duplicate enum values not usable (#17731)

There is an outstanding bug with `jsii`
(aws/jsii#2782) where duplicate enum values are not
available to the non-JS/TS languages. In these cases, only the first enum value
defined is present in the assembly.

For these cases, the first value was the deprecated one. This meant that only
the deprecated values were present, and once we stripped the deprecated
elements, we were left without values. For *v2 only*, we can reorder these enums
so the non-deprecated values appear in the assembly. Note that we *cannot*
backport this to `master` (v1), because it would introduce breaking changes to
our Java/Go/Dotnet/Python customers.

* chore(release): 2.0.0-rc.33

Co-authored-by: Nick Lynch <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: AWS CDK Team <[email protected]>
ali-n4i pushed a commit to ali-n4i/aws-cdk that referenced this pull request Jul 29, 2026
…ort aws#17719) (aws#17720)

This is an automatic backport of pull request aws#17719 done by [Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the [documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>
ali-n4i pushed a commit to ali-n4i/aws-cdk that referenced this pull request Jul 29, 2026
…7719)

Functions (not member methods) aren't acknowledged by jsii, so they are not
stripped out of the compiled source, even when deprecated. These two functions
are deprecated and reference deprecated interfaces. When running the init
template tests against JS/TS, the tests fail with:

```
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(110,62): error TS2304: Cannot find name 'FixedResponse'.
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(116,68): error TS2304: Cannot find name 'RedirectResponse'.
```

By -- on v2 only -- un-exporting the functions and inlining them in their
secondary usages, we can effectively "strip" these functions from the JS/TS.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
ali-n4i pushed a commit to ali-n4i/aws-cdk that referenced this pull request Jul 29, 2026
* chore: fix build break caused by exported deprecated functions (aws#17719)

Functions (not member methods) aren't acknowledged by jsii, so they are not
stripped out of the compiled source, even when deprecated. These two functions
are deprecated and reference deprecated interfaces. When running the init
template tests against JS/TS, the tests fail with:

```
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(110,62): error TS2304: Cannot find name 'FixedResponse'.
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener-rule.d.ts(116,68): error TS2304: Cannot find name 'RedirectResponse'.
```

By -- on v2 only -- un-exporting the functions and inlining them in their
secondary usages, we can effectively "strip" these functions from the JS/TS.


----

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

* chore: duplicate enum values not usable (aws#17731)

There is an outstanding bug with `jsii`
(aws/jsii#2782) where duplicate enum values are not
available to the non-JS/TS languages. In these cases, only the first enum value
defined is present in the assembly.

For these cases, the first value was the deprecated one. This meant that only
the deprecated values were present, and once we stripped the deprecated
elements, we were left without values. For *v2 only*, we can reorder these enums
so the non-deprecated values appear in the assembly. Note that we *cannot*
backport this to `master` (v1), because it would introduce breaking changes to
our Java/Go/Dotnet/Python customers.

* chore(release): 2.0.0-rc.33

Co-authored-by: Nick Lynch <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: AWS CDK Team <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@aws-cdk/aws-lambda Related to AWS Lambda contribution/core This is a PR that came from AWS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants