Get an email when a new release of TypeScript is available using Microsoft Flow

TypeScript evolves quickly. The TypeScript team publishes a new release every month. Some releases contain new features, some contain bug fixes. This means you have to update your version of TypeScript in your code every month if you want to be able to use the new features. But, it's very easy to miss the update news - you'll find announcements on their blog - so you don't know when you have to update… [read more]

Introduction to TypeScript modules

Web sites are turning into very complex applications, and the code complexity increases. You need to track the dependencies between JS files and includes them in the right order, otherwise the website won't work. Testing is also more complicated as the application grows. Modules helps you segmenting your application. Indeed, modules allows you to create small units of independent and reusable code. Plus,… [read more]

Detect common JavaScript errors with TypeScript

TypeScript can help you writing less bugs! Each version improve the detection of common errors. However, all the checks are not enabled by default. In this blog post, we'll see the differents compiler options and the kind of errors they help to catch. There are no specific order beacuse all of them are important. If you're still not using TypeScript, you can read my previous post: Still not using… [read more]

TypeScript - nameof operator equivalent

A lot of JavaScript frameworks involve computation based on the property name of an object. So, you end with magic strings in your code. Magic strings are bad because it makes your code hard to refactor, you cannot find all references, etc. In C# 6, you can use the nameof operator. This is very useful. However, this is not possible in TypeScript yet. There are many issues asking to support this operator.… [read more]

Compiling TypeScript using Gulp in Visual Studio

Nowadays, most of us are using TypeScript as a replacement of JavaScript. If you are not, maybe you should look at this previous post: Still not using TypeScript?. TypeScript files must be compiled before you can use them in the browser. Visual Studio does it automatically very great. However, if you want to have a more advanced build workflow, for instance to minify files or running tests, you may want… [read more]

Executing untrusted JavaScript code in a browser

Executing a JS script provided by a user is not an easy task. Indeed, a common security rule is to never trust user input (whatever the input is). In a browser, a JavaScript code can do lots of dangerous thinks. In our case we want to prevent the script from doing: DOM manipulation JavaScript context modification Stealing personal data by using http requests Too much resources consumption (such as… [read more]