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: remove the construct compatibility layer #12054
Conversation
1. construct-compat.ts deleted 2. update core code & tests 3. update awslint 4. update pkglint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm terribly worried about merge conflicts here.
How about we first change all these files on master
to look like -
import ...
import * as cdk from '@aws-cdk/core'
import ...
import { Construct } from '@aws-cdk/core';
We have our own linter now that we can use to enforce this. I'm happy to help with the linter rule.
When the change to v2-main occurs, it's just a change to the import statement. Since it's separate from the rest of the imports, git can better resolve these changes.
I don't think 3 deleted lines are going to be a problem, but I will make sure to monitor the merges after this is merged to v2 and see what we can do to make sure we have no conflicts from this change. If it means to restore these lines, I'll do it. |
…-construct-compat
…-construct-compat
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). |
The monocdk packages in the V2 branch were [recently switched](aws#12054) to using constructs in version 10.0.0-pre.5. However, our e2e-tests always [install the latest constructs](https://github.com/aws/aws-cdk/blob/12868a2ac9c7016e47633045fb0c00be7eeb5092/packages/aws-cdk/test/integ/helpers/cdk.ts#L124), which is 3.2.108 currently, as pre-release versions are not considered when installing the latest (and if they were, that would break the tests on the 'master' branch anyway). Make the version of 'constructs' used configurable through an environment variable. We will then need to update the tests in the v2 branch to set that to 10.0.0-pre.5.
Delete bunch of remaining APIs that are deprecated and available in constructs 10.x Follow up of #12054
Delete bunch of remaining APIs that are deprecated and available in constructs 10.x Follow up of #12054 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When the constructs compatibility layer was removed on the v2 branch (#12054), a change was made to the init templates to support a flexible constructs version (either ^3 or ^10). These changes were never back-ported to v1, leading to the situation where there are (unnecessary) differences on the v2 templates between the v1 and v2 branches. Backported these changes manually (for package.json and init.ts), and then by diffing the init templates directory between master and v2-main.
) When the constructs compatibility layer was removed on the v2 branch (#12054), a change was made to the init templates to support a flexible constructs version (either ^3 or ^10). These changes were never back-ported to v1, leading to the situation where there are (unnecessary) differences on the v2 templates between the v1 and v2 branches. Backported these changes manually (for package.json and init.ts), and then by diffing the init templates directory between master and v2-main. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
After we extracted the constructs programming model into the
constructs
module, in order to maintain backwards compatibility in the v1.x release line, we had to include a compatibility layer between the AWS CDK and constructs.One of the goals of 2.0 was to remove this redundant layer and directly use
constructs.Constructs
within the AWS CDK.This RFC describes this activity in detail.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license