It's been a while I wanted to play with TypeScript as the technology seems to get a descent traction from the web development community. So here it is! You can check it out on the following github repository: TypeView
It's live version can be tested here. Don't expect anything crazy yet, it's simply loading a predefined model.Big thanks to Jan Liska, my colleague from Autodesk Consulting, who put together the initial version of that sample. The View & Data client side API is rather big already so Jan created the type definition file only for the few methods that were needed in that specific sample. Hopefully over the time we will make that file bigger adding some more declarations to it. You could also use it as a boiler plate if you decide to start a Node.js + View & Data project or simply experiment on TypeScript as I did.
I am using WebStorm for my web projects which has some level of TypeScript support. However I find the file watcher approach not really flexible, without saying that it won't help you if you are not using WebStorm obviously. So I added to the project a gulp file that will automatically handle the transpiling of .ts files. All you have to do to build the project is a "npm install" followed by "gulp" commands. The gulp task also generates the sourcemaps, so it looks better in my WebStorm IDE: it will automatically gather generated files .js and .js.map files under the .ts so it reduces the mess:After running command npm install for the required node modules, running gulp or gulp ts-build should automatically build the project, ready to run through your IDE or using start server.js from the app directory. Run ts-clean to remove all typescript generated files (.js and .js.map):
Comments
You can follow this conversation by subscribing to the comment feed for this post.