-
Notifications
You must be signed in to change notification settings - Fork 4k
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(core): implicit app for root stacks #9342
Conversation
When a stack is created as the root of the construct tree, we now implicitly create an `App` that serves as its parent scope. The root stack is created with the ID `Default`, which ensures that `node.uniqueId` of constructs within that stack is preserved. BREAKING CHANGE: in unit tests, the `node.path` of constructs within stacks created the root of the tree via `new Stack()` will now have a prefix `Default/` which represents an implicit `App` root. Related: aws/aws-cdk-rfcs#192
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.
Just making sure Im not missing something in the context of this PR. ConstructNode.synth
was replaced with synthesize
in several location, but it seems like this was possible before this PR, is that true?
test.equal(stack.node.findChild(p.node.id), p); | ||
test.equal(stack.node.findChild(o.node.id), o); | ||
test.equal(stack.node.findChild(c.node.id), c); |
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.
Just to make sure I understand, this was broken before? The test name is still Stack.getByPath
but it's not verifying that anymore?
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.
yap
Co-authored-by: Neta Nir <neta1nir@gmail.com>
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). |
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
When a stack is created as the root of the construct tree, we now implicitly create an `App` that serves as its parent scope. The root stack is created with the ID `Default`, which ensures that `node.uniqueId` of constructs within that stack is preserved. BREAKING CHANGE: in unit tests, the `node.path` of constructs within stacks created the root of the tree via `new Stack()` will now have a prefix `Default/` which represents an implicit `App` root. Related: aws/aws-cdk-rfcs#192 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When a stack is created as the root of the construct tree, we now implicitly create an
App
that serves as its parent scope.The root stack is created with the ID
Default
, which ensures thatnode.uniqueId
of constructs within that stack is preserved.BREAKING CHANGE: in unit tests, the
node.path
of constructs within stacks created the root of the tree vianew Stack()
will now have a prefixDefault/
which represents an implicitApp
root.Related: aws/aws-cdk-rfcs#192
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license