Skip to content
AdvancedDocs 1.3.x

TypeScript ​

Applications can execute erasable TypeScript directly on the documented Node.js line. Connectum packages ship compiled ESM JavaScript and declarations; supported versions and tested Bun behavior are in Runtime Compatibility.

TypeScript source, generation and execution Erasable application source and regenerated proto enums feed runtime execution and separate type checking, while published framework packages provide executable ESM and declarations for the development workflow. Application source and generated protobuf codeErasable syntax · explicit type imports · source import extensionsProto enums: regenerate with protoc-gen-es erasable_syntax=true ExecuteNode stripping / tsx / BunLoads compiled ESM .js Check and developtsc --noEmit + declarationsPatterns · generation · watch workflow Published Connectum packagesCompiled ESM JavaScript + .d.ts type declarations
Runtime execution consumes JavaScript; type checking consumes declarations. Native stripping requires erasable source, including generated proto enums, and does not replace tsc.

Quick Start ​

bash
# Node.js >=25.2.0 -- run erasable TypeScript directly
node src/index.ts

# Development with auto-reload
node --watch src/index.ts

No loaders, no compilation step, no tsc required to run your code. TypeScript is used for type checking only (tsc --noEmit).

Key Concepts ​

Native type stripping only removes erasable syntax. Use const objects rather than runtime enums, and keep tsc --noEmit in your development checks.

Syntax and import rules
ConstraintRule
No enumUse const objects with as const
No namespaceOnly type-only namespaces allowed
No parameter propertiesUse explicit property declarations
Explicit import typeverbatimModuleSyntax: true
Import extensionsRelative source imports use .ts; generated imports match buf.gen.yaml
node: prefixRequired for Node.js built-in modules

The syntax restrictions follow erasableSyntaxOnly: true: stripping types must leave valid JavaScript. Explicit type imports, import extensions, and the node: prefix are the project's import conventions; the node: prefix is not a TypeScript type-stripping requirement.

Learn More ​