Relative Content

Tag Archive for typescript

Why are generics not working properly here?

class Token<T> { public name: T; constructor(name: T) { this.name = name; } } class LazyToken<T> { public callback: () => GenericToken<T>; constructor(callback: () => GenericToken<T>) { this.callback = callback; } public resolve() { return this.callback(); } } type GenericToken<T = unknown> = Token<T> | LazyToken<T> | Newable<T>; type Newable< TInstance = unknown, TArgs extends […]

Is it possible that we do incremental build based on symbols?

I’m trying to reduce incremental build time of tsc. In general when a file’s “shape”(it’s declaration file) is changed, tsc compiler will use “referenceMap” to find all files referencing it. And all of them will be checked.
Consider the following case:
If we modify a file, and just add a new export for it, even though no other file is using the exported element, we still need to check all files referencing it because it’s shape is changed. But actually we can just check this file only.
So, is it possible that we do incremental build more precisely, like: find the exported element that changed(or may be affected by our changes) and only check files that using this element in incremental build.

Is it possible that we do incremental build based on symbols?

I’m trying to reduce incremental build time of tsc. In general when a file’s “shape”(it’s declaration file) is changed, tsc compiler will use “referenceMap” to find all files referencing it. And all of them will be checked.
Consider the following case:
If we modify a file, and just add a new export for it, even though no other file is using the exported element, we still need to check all files referencing it because it’s shape is changed. But actually we can just check this file only.
So, is it possible that we do incremental build more precisely, like: find the exported element that changed(or may be affected by our changes) and only check files that using this element in incremental build.

Is it possible that we do incremental build based on symbols?

I’m trying to reduce incremental build time of tsc. In general when a file’s “shape”(it’s declaration file) is changed, tsc compiler will use “referenceMap” to find all files referencing it. And all of them will be checked.
Consider the following case:
If we modify a file, and just add a new export for it, even though no other file is using the exported element, we still need to check all files referencing it because it’s shape is changed. But actually we can just check this file only.
So, is it possible that we do incremental build more precisely, like: find the exported element that changed(or may be affected by our changes) and only check files that using this element in incremental build.

Is it possible that we do incremental build based on symbols?

I’m trying to reduce incremental build time of tsc. In general when a file’s “shape”(it’s declaration file) is changed, tsc compiler will use “referenceMap” to find all files referencing it. And all of them will be checked.
Consider the following case:
If we modify a file, and just add a new export for it, even though no other file is using the exported element, we still need to check all files referencing it because it’s shape is changed. But actually we can just check this file only.
So, is it possible that we do incremental build more precisely, like: find the exported element that changed(or may be affected by our changes) and only check files that using this element in incremental build.