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

feat: remove the construct compatibility layer #12054

Merged
merged 23 commits into from Jan 5, 2021

Conversation

eladb
Copy link
Contributor

@eladb eladb commented Dec 13, 2020

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

Elad Ben-Israel added 3 commits December 13, 2020 14:59
1. construct-compat.ts deleted
2. update core code & tests
3. update awslint
4. update pkglint
@gitpod-io
Copy link

gitpod-io bot commented Dec 13, 2020

@eladb eladb requested a review from rix0rrr December 13, 2020 18:48
@eladb eladb changed the base branch from master to v2-main December 13, 2020 18:48
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Dec 13, 2020
@eladb eladb changed the title feat: removal of @aws-cdk/core.Construct (and friends) in favor of constructs.Construct feat: removal of cdk.Construct in favor of constructs.Construct Dec 13, 2020
@eladb eladb requested a review from nija-at December 15, 2020 11:31
Copy link
Contributor

@nija-at nija-at left a 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.

@eladb
Copy link
Contributor Author

eladb commented Dec 21, 2020

I'm terribly worried about merge conflicts here.

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.

@eladb eladb added the pr-linter/exempt-readme The PR linter will not require README changes label Dec 29, 2020
@eladb eladb added the pr-linter/exempt-test The PR linter will not require test changes label Dec 29, 2020
@eladb eladb changed the title feat: removal of cdk.Construct in favor of constructs.Construct feat: removal the construct compatibility layer Dec 29, 2020
@eladb eladb requested a review from nija-at December 29, 2020 15:18
@rix0rrr rix0rrr changed the title feat: removal the construct compatibility layer feat: remove the construct compatibility layer Jan 4, 2021
@eladb eladb requested a review from rix0rrr January 4, 2021 16:16
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 648cdc2
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@mergify
Copy link
Contributor

mergify bot commented Jan 5, 2021

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 mergify bot merged commit 8d3c02c into v2-main Jan 5, 2021
@mergify mergify bot deleted the benisrae/v2/remove-construct-compat branch January 5, 2021 12:18
skinny85 added a commit to skinny85/aws-cdk that referenced this pull request Jan 19, 2021
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.
eladb pushed a commit that referenced this pull request Mar 30, 2021
Delete bunch of remaining APIs that are deprecated and available in constructs 10.x

Follow up of #12054
mergify bot pushed a commit that referenced this pull request Apr 6, 2021
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*
njlynch added a commit that referenced this pull request Sep 21, 2021
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.
mergify bot pushed a commit that referenced this pull request Sep 21, 2021
)

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*
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. pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-test The PR linter will not require test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants