How does gulp-typescript incremental compilation work?

gulp-typescript's README says it&nbsp;<a href="https://github.com/ivogabe/gulp-typescript#incremental-compilation" target="_blank">supports incremental compilation</a>&nbsp;but doesn't explain what is meant by that term in this context.

gulp-typescript's README says it supports incremental compilation but doesn't explain what is meant by that term in this context.

There's an issue discussing how gulp-typescript incremental compilation is slower than tsc, but it doesn't explain why, or what the difference is.

What is gulp-typescript doing when it does "incremental compilation"?

What I tried

I'm looking at gulp-typescript's source code and it looks like gulp-typescript isn't doing any incremental compilation at all. When a Project is created, it closes over an instance of ProjectInfo, which has an input member which is a FileCache. A FileCache is pretty much a mapping from file names to source strings. There isn't much other state that is maintained in a gulp-typescript Project.

In order to do actual incremental compilation (reusing products of the compilation process in subsequent builds) using the TS compiler API, I would expect to see one of the following:

But I don't see either of those in the source.

Learn TypeScript | TypeScript Crash Course | TypeScript Tutorial for Beginners

Learn TypeScript | TypeScript Crash Course | TypeScript Tutorial for Beginners

Learn TypeScript | TypeScript Crash Course | TypeScript Tutorial for Beginners: My goal with this courses is just give your the fundamentals of the language, show you what TypeScript is and how to use it. We as developers don't have time neither can we afford to spend too much time on any tehcnology.

TypeScript is a superset of JavaScript, which means that is language that was created to add features to JavaScript. You might be asking yourself why it was created and why not just add those features directly to JavaScript.

Sometimes language foundatons take time to implement features because the committee has to approve it, test and get feedback before requests are answered. The soultion for that is to create another language that adds functionality to the language we need, and thats where TypesScript comes in.

TypeScript has many advanced features that plain JavaScript doesnt have yet but the good news is that we can start using it now since TypeScript compiles JavaScript ES5 which at this moment is the most compatible version of JavaScript for all browsers.

Most people that want to learn TypeScript its because they need the skills to use with some Frameworks like Angular.

My goal with this courses is just give your the fundamentals of the language, show you what TypeScript is and how to use it. We as developers don't have time neither can we afford to spend too much time on any tehcnology.

Thanks for reading

If you liked this post, please do share/like it with all of your programming buddies!

Follow us on Facebook | Twitter

Further reading about JavaScript and TypeScript

The Complete JavaScript Course 2019: Build Real Projects!

Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)

JavaScript Bootcamp - Build Real World Applications

The Web Developer Bootcamp

New ES2019 Features Every JavaScript Developer Should Know

Best JavaScript Frameworks, Libraries and Tools to Use in 2019

Using Typescript with modern React (i.e. hooks, context, suspense)

WebSocket + Node.js + Express — Step by step tutorial using Typescript

From Javascript to Typescript to Elm

Angular + Typescript = Powerful Web Apps

React + TypeScript : Why and How

How to use TypeScript with Vue.js

TypeScript Tutorial for Beginners | Introduction to TypeScript Basics

TypeScript Tutorial for Beginners | Introduction to TypeScript Basics

In this TypeScript tutorial video will provides in-depth knowledge about typescript and its basics and fundamentals. it also talks about the different advantages and features of Typescript and explains each concept with an example. Below are the topics covered in this TypeScript Basics Video:

In this TypeScript tutorial video will provides in-depth knowledge about typescript and its basics and fundamentals. it also talks about the different advantages and features of Typescript and explains each concept with an example. Below are the topics covered in this TypeScript Basics Video:
1:28 Introduction to TypeScript
6:54 Types of TypeScript
7:31 Variables
9:50 Operators
21:47 Loops
33:17 Functions
36:52 Strings
42:38 Arrays
46:36 Interfaces
47:42 Classes
50:27 Objects
51:28 TypeScript use case

TypeScript 3.7 has Been Released

TypeScript 3.7 has Been Released

The TypeScript team announced the release of TypeScript 3.7, including optional chaining, nullish coalescing, assertion functions

Recently, Microsoft announced the latest version of TypeScript i.e. 3.7. The new release brings new language, compiler, and tooling features.

Well, TypeScript is a language based on JavaScript that provides static type-checking along with type syntax. It powers things like completions, quick fixes, and refactorings for both TypeScript and JavaScript in many of the editors.

You can get the latest version through NuGet, or using npm - npm install typescript

3.7 brings some great features like Optional Chaining, Nullish Coalescing, Better Support for never-Returning Functions, and Assertion Signatures

You can check out the TypeScript playground where you will find an entire menu for learning what’s new.

Source: Microsoft

New feature Optional chaining allows you to write code where you can immediately stop running some expressions if you run into a null or undefined. Consider the following code:

let x = foo?.bar.baz();  

that means when foo is defined, foo.bar.baz() will be computed, but incase foo is null or undefined, it will stop and return undefined.

And, the nullish coalescing operator(??) is a feature that goes hand-in-hand with optional chaining. ?? operator is a way to fall-back to a default value when dealing with null or undefined. So if you write a code like:

let x = foo ?? bar();  

it means the value foo will be used when it’s present; but if it is null or undefined, it will calculate bar() in its place.

TypeScript 3.7 brings a new concept - assertion signatures - which model the assertion functions.

Here, one type of assertion signature models the way that Node’s assert function works. It makes sure that whatever condition is being checked must be true for the remainder of the containing scope. While, the other type of assertion signature, instead of checking for a condition, tells TypeScript that a specific variable or property has a different type.

Other important features, included in 3.7 are:

  • --declaration and --allowJs
  • (More) Recursive Type Aliases
  • The useDefineForClassFields Flag and The declare Property Modifier
  • Build-Free Editing with Project References
  • Uncalled Function Checks
  • Flatter Error Reporting
  • // @ts-nocheck in TypeScript Files
  • Semicolon Formatter Option
  • Website and Playground Updates

_And breaking changes include DOM Changes, Class Field Mitigations, Local and Imported, _Type Declarations Now Conflict, Function Truthy Checks, and API Changes

You can visit the official announcement here.

Thank you !