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

constructs: reduce API clutter from base class #1441

Closed
eladb opened this issue Dec 27, 2018 · 0 comments · Fixed by #1444
Closed

constructs: reduce API clutter from base class #1441

eladb opened this issue Dec 27, 2018 · 0 comments · Fixed by #1444
Labels
@aws-cdk/core Related to core CDK functionality pr/breaking-change This PR is a breaking change. It needs to be modified to be allowed in the current major version.

Comments

@eladb
Copy link
Contributor

eladb commented Dec 27, 2018

The surface area of the Construct base class is polluting the surface area of derived classes without adding much value to the derived classes' users (in most cases, users won't need to interact with the construct surface).

One of the ideas that came up is grouping most of this surface area under some property (e.g. construct.node so that the surface area will not be cluttered.

@eladb eladb added @aws-cdk/core Related to core CDK functionality pr/breaking-change This PR is a breaking change. It needs to be modified to be allowed in the current major version. labels Dec 27, 2018
eladb pushed a commit that referenced this issue Jan 3, 2019
- Rename "parent" to "scope" in all construct initializers and imports (fixes #1431)
- Group all members (besides `validate`) under a `node` property so they don't pollute the surface area of derived classes (fixes #1441)
- Define `IConstruct` and have all `IXxx` extend it
- Normalize construct ID to `id` across the board (fixes #189)

BREAKING CHANGE: Multiple breaking changes:

  - All the APIs of `cdk.Construct` are now available under `construct.node` (e.g. instead of `construct.path` use `construct.node.path`. See #1441 for details.
  - Construct `parent` was renamed to `scope`. See #1431 for more details.
  - First argument of `codepipeline.CrossRegionScaffoldStack` is now required.
  - `IPipeline.uniqueId` removed and can now be accessed via `pipeline.node.uniqueId`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality pr/breaking-change This PR is a breaking change. It needs to be modified to be allowed in the current major version.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant