Replies: 3 comments 10 replies
-
The two examples given (esbuild externals and lambda layers) are not responsibilities of inflights themselves but rather the host, so it seems strange to expose them in there. "external" is debatable inflight responsibility but a cloud function in AWS vs Azure (depending on the lambda layers) don't necessarily have the same externals. |
Beta Was this translation helpful? Give feedback.
-
Interestingly this proposal has some parallels to Golang's struct tags (in the respect that both expose a stringly-typed annotation system of sorts) |
Beta Was this translation helpful? Give feedback.
-
I like the overall direction being sketched out! -- especially if we imagine the macro serving as a declarative way to specify host requirements or capabilities, which serves as a complement to the "onLift" and "onLiftType" hooks we have today which specify host requirements or capabilities in an imperative way. But IMO there is some details worth fleshing out - here are some questions on my mind: Primary (I think the answers to these may have a large impact on the developer experience):
Secondary (I think these are helpful to consider, but its also ok if we don't know the answer yet):
|
Beta Was this translation helpful? Give feedback.
-
We are seeing some requirements for supporting platform-level configuration in inflight "blocks".
Some examples are #3410 and #6761.
I believe that it might make sense to design dedicated support for each of the use cases above (and others in the future), but there will always be new cases where an inflight block needs to "communicate" with the platform during synthesis.
I'd like to propose that we experiment with a concept called "inflight metadata" which is basically a key/value bag associated with inflight closures and can be consumed by platform providers and respected by them.
Then, the
cloud.Function
implementation at the platform level will be able to reflect on the metadata and determine how to behave.The proposed API (accepting a struct of
key
andvalue
) allows exposing some type safe APIs by platform teams:Beta Was this translation helpful? Give feedback.
All reactions