Was there a reason for not supporting the original...
# sst
j
Was there a reason for not supporting the original CDK types and instead just using strings for v1? E.g.
Copy code
// from
app.setDefaultRemovalPolicy(cdk.RemovalPolicy.DESTROY);
// to
app.setDefaultRemovalPolicy("destroy");
Instead of allowing both?
t
we optimized for typescript where enums aren't really necessary and it saves an import
is there a reason you want to use the enum?
j
Not particularly, was just curious on the decision. I guess it's because I've used some JS libs before that did this and when they updated their enums, they didn't update their typedefs so just a bit wary. Even though I know you guys write everything in TS so it should never come to that.
t
Yeah our recent shift was to commit to a TS first experience. And a TS first experience uses string unions and not enums. Functional stacks were also created for a similar reason
j
Yep cool! Btw, loving the typesafety on it all! It's so nice! Just updating all to v1 now. It even caught this lil bug in an old table.
Copy code
Error: Please define "departureDate" in "fields" to create the index in the "TripsTable" Table.
d
Thanks for the explanation @thdxr, I was wondering the same thing.