Good morning/afternoon/evening everybody! In the ...
# general
j
Good morning/afternoon/evening everybody! In the run-up to SST 1.0 Conf we wanted to show you a key part of what we are releasing. It’s called Functional Stacks and it simplifies sharing resources between stacks and supports async. We really wanted to think about CDK from a TS first perspective. Here’s a screencast @thdxr put together explaining how it works.

https://youtu.be/cqzgAJvUQCg

Btw, if you haven’t registered for SST 1.0 Conf yet, head over here: https://v1conf.sst.dev
r
Thanks @thdxr that’s an excellent explanation. I hadn’t really clicked that functional stacks were composable stacks, much like the Composition API in VueJS (and probs React hooks)
c
The Hooks/Composition API pattern is quite interesting for JS projects. I started doing something similar in the past when I needed async building of my lambdas. Will you promote this way of building the infra?
s
I migrated an 0.5.x SST app that used the class based approach to the new functional approach. The app had approximately six stacks, and I was passing stacks via props all over the place. Composing functions really clean up my stacks and makes it much easier to reason about. I'm a fan! The importance of this goes beyond aesthetics. In my current role, I spend a lot of time working on serverless advocacy. A big part of that role is addressing a skills gap and best practices when working with serverless technologies. Many times, I'm introducing developers to Infrastructure as Code for the first time. It can be daunting for newcomers to the space. With tooling like SST, demonstrating new principles has become a breeze. Not only does SST deliver a fast feedback loop, but the simplicity of stack definitions and higher level constructs is helping me introduce more people to serverless.
Thank you for coming to my Ted Talk 😆
c
Awesome overview thanks @thdxr. This is a huge painpoint for us atm, so think this might be the push we needed to finally move over to SST. QQ, because the properties are being returned, when this gets synthed into CFN does it still export the property even if its nots being consumed in another stack? I.E. would using functional stacks this way prevent us from the dreaded dependency hell?
t
the behavior ultimately is the same as with class stacks since this all uses class stacks under the hood but with sst 1.0 we do try to autodetect removed exports and solve that common issue for you