Starting out with Defold and TypeScript

The only big drawback to TS-Defold is that types aren’t automatically generated for Defold extensions. There is experimental support for parsing script_api files for this purpose, but it’s not built into the starter templates… yet.

Coding in TypeScript for Defold is pretty intuitive. As long as you use language features that are shared between Lua and TS (no enums, switch statements, etc), your output Lua code is very clean and easy to follow.

TypeScript has a great ecosystem for tools. A lot of the mental burden of thinking about code correctness can be automated away. Using an IDE like VSCode, you get real-time type safety checks, auto-completion, etc. with very little setup. For bigger projects, you can add real-time linting rules for code correctness and style, automatic formatting, etc.

If my changes aren’t too controversial, yes.

1 Like