πŸ“š Agora node [[typescript]] β˜†
Agora nodes contain community contributions with titles or topics that match your search. x
πŸ“œ File typescript.md by @flancian β˜† πŸ“Ž οΈπŸ”— ✍️ β›Ά

TypescriptΒ§

  • A [[language]]
    • A language I don’t know it very well built to replace or complement another language I know little/badly/in an old school way (JS).
    • But I think I need to learn client side coding, so there you go; TS it is.
    • I started a 20% contribution at the day job in [[typescript]] and I learnt a bit; I liked what I learnt. It’s a better javascript with what I would call solid type inference (unsure if that’s the right technical term though, need to review.)
    • [[clojurescript]] could be an alternative. It is [[cojure]] for the browser. I started learning [[clojure]]. I start doing many things :)
    • [[agora ext]] uses [[typescript]].
    • [[agora bridge api]] uses [[typescript]].
    • [[agora server]] uses [[typescript]] for it’s client side code.
πŸ“œ File TypeScript.md by @bunnynabbit β˜† πŸ“Ž οΈπŸ”— πŸ€— β›Ά

Why not TypeScript?Β§

This is what I initially thought.

  • Higher barrier to entry.
    To a newcomer who might not know what strong typing is, TypeScript could feel confusing. As is the added amount of unfamiliar syntax or typing conventions.
  • Adds a build step.
    Before backend runtimes were able to use type stripping, TypeScript was usually executed after a compilation step. Though, for the frontend, a build step is always necessary.

I think convenience is to tell users to just run npm install. That’s just one common command when working with the [[JavaScript]] ecosystem.

Why TypeScript?Β§

TypeScript is pretty necessary for maintenance and reducing guess work.

  • Provides documentation.
  • Reliable editor hints.
  • Enforces restraint.

As JavaScript is dynamically typed. Putting some guardrails is only a natural step to better maintenance.

How I use itΒ§

I figured that to get the least number of problems when introducing TypeScript to a project, I continued to use JavaScript with added JSDoc comments. I only use TypeScript files for defining complex types. This maintains having no build step.

An issue with this may be verbosity. Since the JSDoc tags are to be in multiple lines, comments can be massive. Solutions to this are in editors:

An example of a JavaScript-only project using TypeScript is celaria-formats.

  • tsconfig.json.
    • Only checks JavaScript if explicitly marked for type checking using // @ts-check.
    • Emits type declarations but is not used for compiling.
  • Documentation generated from TypeDoc.
  • Release workflow emits type declarations for better support with TypeScript-based projects.
  • Complex types defined in TypeScript files. JavaScript imports these using the @import tag. TypeScript is never executed.
πŸ“œ File typescript.md by @goldfishlaser β˜† πŸ“Ž οΈπŸ”— β›Ά

typescriptΒ§

Core ideaΒ§

TypeScript is a strict, statically typed "superset" built on top of [[JavaScript]] by Microsoft to catch errors early during development.

https://www.typescriptlang.org/docs/

[[yaml datastore]]

πŸ“œ File typescript.md by @s5bug β˜† πŸ“Ž β›Ά

TypeScriptΒ§

πŸ“œ File typescript.md by @an_agora@twitter.com β˜† πŸ“Ž β›Ά

Loading pushes...

✨ AI Synthesis Mistral Gemini ChatGPT Claude x

Expanding this section will automatically generate an AI synthesis of the contributions in this node.

🌌 Agora context for [[typescript]]

Rendering context...

πŸ“š Agora node [[20210607203539 typescript]] (pulled by the Agora)
πŸ“œ File 20210607203539-typescript.org by @ryan β˜† πŸ“Ž