Is there a way to use Pulumi with Typescript v4? I...
# typescript
a
Is there a way to use Pulumi with Typescript v4? I would like to use newer TS features, such as
import type
.
s
You can use yarn resolutions or npm overrides to force a version of ts-node that supports a more recent typescript version
👍 1
l
Status so far: this will be work for Pulumi v4, given Typescript v4 has breaking changes.
b
@aloof-leather-66267 Just use Javascript & everything is solved 😄
(but srsly - I don’t like TS because it bloats
node_modules
, slows down work because of the transpilation step, makes upgrades harder (you have to upgrade all TS dependencies), bloats Lambda functions etc. etc.) (I know that one of the Pulumi founders worked on TS, so that’s why Pulumi is forcing it, but sorry I just don’t find it that useful, if I want a strong/static typing system I’ll just use Go)
l
FYI, we aren’t forcing you to use Typescript. You can use any of our NPM packages without TypeScript at all. https://www.pulumi.com/blog/building-your-first-serverless-app-using-only-javascript/ There are a number of Javascript only examples here: https://github.com/pulumi/examples Search for
-js-
in the top level folder name.
b
@limited-rainbow-51650 sorry, wrong word, not
forcing
->
coercing
😄 (or some more softer word, sry English is not my native lang.)
s
coercing is still too strong of a word. They encourage TS but you have 100% freedom to use JS. There's no loss in features/support. Not all type systems are created equal though. Go's is (intentionally) very limited and not at all comparable to TS.
a
Then there is Go, Java, dotnet, python SDKs as well
b
@clean-football-9795 Yup, but I feel that vanilla Javascript/Node.js goes best with Pulumi, it’s very lightweight, flexible and expressive 🙂 On one of our biggest projects we properly set up the Pulumi projects with JS, and the Ops people loved it, as well as the Developers - it was awesome. (not to mention that we could write AWSLambdas (almost) seamlessly in the same codebase & they were extremely lightweight (<1kb most of the time). It was glorious :)