Until we support output-conditional code (pulumi/lumi#170), we run into cases where we want to make a decision based on a computed property if it is available, but can't possible know the value. In such cases, we get an error ("Unexpected computed value"). In fact, our generated code currently includes client side validation of properties, since it leads to a(n admittedly only slightly) better developer experience. But that triggers the error for required properties that are computed, basically hosing our ability to plan. This change introduces a defaultIfComputed intrinsic to the lumirt library that can be used to work around this. It takes two arguments, obj and def, and returns the actual property value obj if it is NOT computed; if it is computed, def will be substituted in its stead. The generated code changes to use this. It's possible it will miss validation, of course, if a computed property turns out not to match the precondition. But this is strictly better than the alternative of not trying to validate any of them to begin with. |
||
---|---|---|
.. | ||
aws | ||
lumi | ||
lumijs | ||
lumirt | ||
mantle | ||
README.md |
lumi/lib
This directory contains some libraries that Lumi programs may depend upon.
Overview
The Lumi standard library underneath lumi/
is special in that every program will ultimately use it directly or
indirectly to create resources.
Similarly, lumijs/
is the LumiJS compiler's runtime library, and so most LumiJS programs will on it.
Note that these are written in the Lumi subsets of the languages and therefore cannot perform I/O, etc.
Installation and Usage
Eventually these packages will be published like any other NPM package. For now, they are consumed only in a development capacity, and so there are some manual steps required to prepare a developer workspace.
For each library <lib>
you wish to use, please see its install.sh
script in its root directory. This performs
installation so that it can be used simply by adding a dependency to it.
We currently use NPM/Yarn symlinks to ease the developer workspace flow. As such, you will need to run:
yarn link <lib>
In a project that intends to consume <lib>
before actually using it. For example, yarn link @lumi/lumi
.