-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
refactor(core): refactor API of Tokens #2757
Merged
Merged
Commits on Jun 5, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 5fb1153 - Browse repository at this point
Copy the full SHA 5fb1153View commit details -
Configuration menu - View commit details
-
Copy full SHA for f7611ee - Browse repository at this point
Copy the full SHA f7611eeView commit details -
fix(core): refactor use of Tokens
Tokens are now represented by the interface `IToken`. The class `Token` still exists, but it is used to hold static routines for token encoding (`Token.encodeAsString()`), and as a potential base class for `IToken` implementations so some default functionality is inherited (this inheritance is an implementation optimization, it is not a requirement!). Actual token use is split into 2 categories: - *Intrinsics*, represented by `Intrinsic` class: 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? Revert `Token.isToken()` to check if the passed object is literally an `IToken` (to match `Array.isArray()` and other related methods), and `Token.unresolved()` to check if the passed object might also be an encoded Token. Fixes #1933. BREAKING CHANGES: * `Token` can no longer be instantiated. Instead, instantiate `Intrinsic` or use `Lazy.stringValue` and others. * `Token.isToken()` will only return true if the object is a Token, for detecting arbitrary encoded tokens, use `Token.unresolved()`. * `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.
Configuration menu - View commit details
-
Copy full SHA for 1bef5fc - Browse repository at this point
Copy the full SHA 1bef5fcView commit details
Commits on Jun 7, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 62f2cc2 - Browse repository at this point
Copy the full SHA 62f2cc2View commit details -
Configuration menu - View commit details
-
Copy full SHA for a056546 - Browse repository at this point
Copy the full SHA a056546View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a6abbb - Browse repository at this point
Copy the full SHA 7a6abbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1faaffc - Browse repository at this point
Copy the full SHA 1faaffcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ea1251 - Browse repository at this point
Copy the full SHA 4ea1251View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1fe30ac - Browse repository at this point
Copy the full SHA 1fe30acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 245c82a - Browse repository at this point
Copy the full SHA 245c82aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e37bb4d - Browse repository at this point
Copy the full SHA e37bb4dView commit details
Commits on Jun 10, 2019
-
Rico Huijbers committed
Jun 10, 2019 Configuration menu - View commit details
-
Copy full SHA for cd0dfb6 - Browse repository at this point
Copy the full SHA cd0dfb6View commit details
Commits on Jun 11, 2019
-
Merge remote-tracking branch 'origin/master' into huijbers/token
Rico Huijbers committedJun 11, 2019 Configuration menu - View commit details
-
Copy full SHA for 8aaf905 - Browse repository at this point
Copy the full SHA 8aaf905View commit details -
Configuration menu - View commit details
-
Copy full SHA for c17e925 - Browse repository at this point
Copy the full SHA c17e925View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9494e58 - Browse repository at this point
Copy the full SHA 9494e58View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.