typedb / typedb-docs

TypeDB Documentation
27 stars 72 forks source link

Rewrite JavaScript snippets in TypeScript #528

Open alexjpwalker opened 3 years ago

alexjpwalker commented 3 years ago

Problem to Solve

All of our client-nodejs examples are written in JavaScript. They should be written in TypeScript. We would strongly encourage users to use TypeScript for its type safety features; it will also result in a smoother dev workflow.

Current Workaround

People can read our TypeScript code in the BDD tests of typedb-client-nodejs repo.

Proposed Solution

We should replace our JS snippets in docs with TypeScript.

Additional Information

Verifying that a TypeScript example compiles is slightly more work than for JavaScript. You need to first transpile TypeScript to JavaScript using, for example, tsc.

izmalk commented 1 year ago

Why do we need it?

alexjpwalker commented 1 year ago

Given the strongly-typed structure of the TypeDB client that makes heavy use of typing and inheritance, there is no doubt that TypeScript will represent a sharply better experience for users than JS. We should encourage its use.