You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Tokens implement a method resolve which is called to resolve the token during synthesis, but users are tempted to invoke this method in various situations (i.e. to "resolve" the value in runtime, to "resolve" the value so they can reason about it, etc).
We should hide this method and/or signal that it shouldn't be called by users.
I propose that:
We rename this method _resolve.
We make it private and use duck-typing to identify the token (public/private is just a typescript annotation, doesn't apply at runtime).
The text was updated successfully, but these errors were encountered:
That's a good point, but what is the use case for actually extending tokens by non-framework code? I think it is very limited and maybe even something we want to block, because it's extremely error prone. If there will be a clear use case, we can always provide a base class such as CustomToken that exposes a method to override.
moofish32
added a commit
to moofish32/aws-cdk
that referenced
this issue
Aug 28, 2018
Currently, Tokens implement a method
resolve
which is called to resolve the token during synthesis, but users are tempted to invoke this method in various situations (i.e. to "resolve" the value in runtime, to "resolve" the value so they can reason about it, etc).We should hide this method and/or signal that it shouldn't be called by users.
I propose that:
_resolve
.private
and use duck-typing to identify the token (public
/private
is just a typescript annotation, doesn't apply at runtime).The text was updated successfully, but these errors were encountered: