4 votes

TypeScript For Umbraco

This package integrates TypeScript into Umbraco so you can write full OOP TypeScript objects and compile them to Javascript straight to your scripts folder... without ever leaving Umbraco!  No need for VS 2012 plugins or custom setup for VS 2010.

What is TypeScript?

TypeScript is a language for application-scale JavaScript development.  TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.  It provides static typing, classes, interfaces and inheritance. TypeScript can be used for cross-browser development and is an open source project (just like Umbraco!).  And if you're a C# developer like me, I'm sure you'll see the beauty of it when developing applications that would benefit from OOP client side.

Here is an example:

module Company {
    export class AccountManager {        firstName: string;        surname: string;        clients: Client[];        constructor (firstName: string, surname: string) {
            this.firstName = firstName;
            this.surname = surname;
        }        addClient(client: Client) {            this.clients.push(client);        }    }

    export class Client{        name: string    }
}//NOW USE IT!//note: I am not an account manager! :-)var accountManager = new Company.AccountManager("Craig", "Noble");var client = new Company.Client();client.name = "Somebody";accountManager.addClient(client);

[note: I have not tested the above code but it's an example off the top of my head!]

For a good sum up tutorial visit:

http://www.developer.com/lang/top-10-things-to-know-about-typescript.html

And the official site is here:

http://www.typescriptlang.org/

 

Version update 1.1 - Now compatible with Umbraco versions 4.9.x, 4.10.x, 4.11.x, and 6!  Fixed a compiler issue which required a DLL (it didn't need it) and when creating TypeScript files.

Screenshots

Package owner

Craig Noble

Craig Noble

Craig has 584 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions:

Package Information

  • Package owner: Craig Noble
  • Created: 26/03/2013
  • Current version 1.1.1
  • License MIT
  • Downloads on Our: 1.3K