feat(core): IEnvironmentAware interface to retrieve a construct's environment#35817
feat(core): IEnvironmentAware interface to retrieve a construct's environment#35817mergify[bot] merged 19 commits intomainfrom
IEnvironmentAware interface to retrieve a construct's environment#35817Conversation
Previously, `construct.env` was declared in the `IResource` interface. Downside is that `IResource` also: - requires providing `stack: Stack` (which is a bit pointless to begin with since we can always call `Stack.of(x)`); and - `applyRemovalPolicy()` which doesn't belong on this interface but now is required to implement. Therefore, we extract `IResource#env` out to its own interface, `IEnvironmentable`, make `IXxxRef` extend that interface.
IEnvironmentAware interface to retrieve a construct's environment
IEnvironmentAware interface to retrieve a construct's environmentIEnvironmentAware interface to retrieve a construct's environment
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
IEnvironmentAware interface to retrieve a construct's environmentIEnvironmentAware interface to retrieve a construct's environment
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks:You may have to fix your CI before adding the pull request to the queue again. |
|
Thank you for contributing! Your pull request will be updated from main 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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Previously,
construct.envwas declared in theIResourceinterface.Downside is that
IResourcealso:stack: Stack(which is a bit pointless to begin with since we can always callStack.of(x)); andapplyRemovalPolicy()which doesn't belong on this interface but now is required to implement.Therefore, we extract
IResource#envout to its own interface,IEnvironmentAware; makeIXxxRefextend that interface, simplifyIResourceWithPolicyto only beIEnvironmentAwareand not an entireIResource.Lessening the requirements on
IResourceWithPolicyalso lessens its guarantees, which makes that a breaking change. In order to make this code change, we do the following:IResourceWithPolicyV2to be the version ofIResourceWithPolicywe should have had.IResourceWithPolicyV2everywhereIResourceWithPolicyextendIResourcWithPolicyV2By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license