Contribute to the DSpace Development Fund

The newly established DSpace Development Fund supports the development of new features prioritized by DSpace Governance. For a list of planned features see the fund wiki page.

Why did we choose TypeScript?

When building an Angular (v2) application, you have a choice of using TypeScript, Javascript or Dart. Here's why we chose TypeScript:

  1. TypeScript is the recommended language to use for Angular. See https://angular.io/ which defaults to TypeScript examples (unless you request otherwise)
  2. Angular (v2 and above) is itself written in TypeScript. One of the Angular developers describes why they made that decision is in post Writing Angular 2 in TypeScript
  3. TypeScript is gaining a strong following. It was written by Microsoft. But Google is now recommending it and using it over their own competitor Dart. More info: https://jaxenter.com/angular-typescript-dart-115426.html
  4. TypeScript is a superset of Javascript itself and can be compiled into clean Javascript code. This means that if it should ever go away, we could migrate easily to Javascript. See http://www.typescriptlang.org/ for more.
  5. TypeScript supports the latest features of Javascript (again see http://www.typescriptlang.org/)
  6. Code in TypeScript is more similar to Java (i.e. DSpace backend) than it would be if we used Javascript or Dart. It also make more easily readable code than Javascript.

Other references on this question:

How do we recommend writing TypeScript code for this app?

  • Because TypeScript is a superset of Javascript, you could simply write Javascript and save it into a file with a .ts extension (because any valid Javascript is also valid TypeScript). We recommend AGAINST writing Javascript code in TypeScript files!
    • Why? If you write Javascript in your TypeScript files you are bypassing the distinct advantages of TypeScript, namely using Types and Type Definitions. You also may be working against many TypeScript IDE tools, and potentially writing more complex code overall.
  • No labels