-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
Tokens are now represented by the interface `IResolvable`. The class `Token` still exists, but it is used to hold static routines for token encoding (`Token.asString()`). Actual token use is split into 2 categories: - *Intrinsics*, represented by static methods on `Token`: these are to represent values that will be understood by the deployment language formalism (e.g. CloudFormation), and can be used to escape language type checking. - *Lazy values*, represented by a `Lazy` class with static factories: these will be used to represent type-checked but lazily-produced values (evaluated at synthesis time). In order to be JSII-compatible (which does not currently support lambdas), `Lazy.stringValue()` et. al. take an interface with a single method instead of a function. Also changed in this commit: shoring up property names for encoded tokens in classes like `CfnParameter` and `CfnElement`. * `.stringValue` => `.valueAsString`, etc so `.value`, `.valueAsString`, `.valueAsList` etc. group together in autocomplete. * `.ref` now returns a Token, `.refAsString` returns the stringified version that token. To match the other standard the latter should actually be `.refAsString` but `.ref` is used in so many places that this might be uncomfortable? Fixes #1933. BREAKING CHANGES: * `Token` can no longer be instantiated. You probably want to use `Lazy.stringValue` and others, or `Token.asString()` and others. * `Token.isToken()`/`Token.unresolved()` => `Token.isUnresolved()`. * `CfnOutput`: remove `.ref`, since they can't be referenced anyway. * `CfnParameter`: rename `.stringValue` => `.valueAsString` (and similar for lists and numbers). * `.ref` now returns an `IToken`, use `.refAsString` to get a string-encoded Token. * `TokenMap` is now no longer exported, some parts of its functionality are available through the static `Tokenization` class. * `IResolvedValuePostProcessor` => `IResolvableWithPostProcess`.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.