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: remove the "comments rewriter" #3368

Merged
merged 3 commits into from Feb 7, 2022
Merged

fix: remove the "comments rewriter" #3368

merged 3 commits into from Feb 7, 2022

Conversation

RomainMuller
Copy link
Contributor

The comments rewriter was used to prefix documentation comments with the
stability level of the associated API (e.g: (experimental) or
(deprecated)). This was introduced to palliate insufficient IDE
support for @deprecated and the mixing of @stable and
@experimental APIs in CDK v1.

Since then, the TypeScript language server has added support for
@deprecated IDE features, and CDK v2 moved all @experimental APIs to
separate packages, removing the risk for people to inadvertently take
experimental dependencies.

In profiling, this feature alone was attributed between 50% and 60% of
the total time spent compiling aws-cdk-lib. The impact is likely
comparable on other large construct libraries.

The benefits from this feature are not sufficient to justify the cost to
make it happen. Instead of trying to optimize it (which could prove
impossible), decision was made to simply drop it.


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

The comments rewriter was used to prefix documentation comments with the
stability level of the associated API (e.g: `(experimental)` or
`(deprecated)`). This was introduced to palliate insufficient IDE
support for `@deprecated` and the mixing of `@stable` and
`@experimental` APIs in CDK v1.

Since then, the TypeScript language server has added support for
`@deprecated` IDE features, and CDK v2 moved all `@experimental` APIs to
separate packages, removing the risk for people to inadvertently take
experimental dependencies.

In profiling, this feature alone was attributed between 50% and 60% of
the total time spent compiling `aws-cdk-lib`. The impact is likely
comparable on other large construct libraries.

The benefits from this feature are not sufficient to justify the cost to
make it happen. Instead of trying to optimize it (which could prove
impossible), decision was made to simply drop it.
@RomainMuller RomainMuller requested a review from a team February 7, 2022 10:25
@RomainMuller RomainMuller self-assigned this Feb 7, 2022
@mergify
Copy link
Contributor

mergify bot commented Feb 7, 2022

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 added the contribution/core This is a PR that came from AWS. label Feb 7, 2022
@@ -761,7 +761,7 @@
{
"docs": {
"stability": "stable",
"summary": "(deprecated) String representation of the value."
Copy link
Contributor

Choose a reason for hiding this comment

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

So many trees are going to be saved!

Copy link
Contributor

Choose a reason for hiding this comment

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

Could be cool to calculate the negative carbon footprint of this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree but don't you try to nerd snipe me into sinking days or weeks into this. I'd first need to have representative telemetry for "cumulative compile times" + roughly what kind of hardware is in use (to estimate average power consumption of that build), and a ballpark idea of where that is geographically (to estimate the carbon intensity of the power supply there).

But I'd lie if your initial reaction to this did not make me think "oh jeez, it'd be sweet if the PRs had an automated comment telling you what the impact of the change is on the carbon footprint of the codebase"...

@mergify
Copy link
Contributor

mergify bot commented Feb 7, 2022

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 Feb 7, 2022
@mergify
Copy link
Contributor

mergify bot commented Feb 7, 2022

Merging (with squash)...

@mergify mergify bot merged commit 50dd3b0 into main Feb 7, 2022
@mergify mergify bot deleted the rmuller/remove-rewriter branch February 7, 2022 13:16
@mergify
Copy link
Contributor

mergify bot commented Feb 7, 2022

Merging (with squash)...

@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Feb 7, 2022
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.

None yet

2 participants