typescript.java icon indicating copy to clipboard operation
typescript.java copied to clipboard

TypeScriptBuilder vs TS Server Watch mode

Open PhaserEditor2D opened this issue 8 years ago • 12 comments

What features are provided by TypeScriptBuilder that are not provided by the TS Server Watch mode?

Probably to use tsserver -w could be a simpler solution to issues like for allowJs parameter .

PhaserEditor2D avatar Sep 22 '17 15:09 PhaserEditor2D

TS Server Watch mode seems beeing a new feature and perhaps VScode uses that? We must study that https://github.com/Microsoft/vscode/tree/master/extensions/typescript/src

Any PR are welcome!

angelozerr avatar Sep 22 '17 16:09 angelozerr

Yes, we should look at that because I think the Watch mode could simplify a lot TypeScript IDE, probably an Eclipse project builder is not going to be needed anymore. I think the idea behind this kind of language services (like tsserver and lsp) is that clients don't need to do any heavy stuff, all the state and computation should be on the server side.

PhaserEditor2D avatar Sep 22 '17 16:09 PhaserEditor2D

Yes, we should look at that because I think the Watch mode could simplify a lot TypeScript IDE, probably an Eclipse project builder is not going to be needed anymore.

The main problem with that is that you cannot see progress monitor and stop as soon as possible the compile process.

is that clients don't need to do any heavy stuff, all the state and computation should be on the server side.

It looks like that today, I don't compute dependencies or other complex things, I'm using tsserevr commands for that.

angelozerr avatar Sep 22 '17 16:09 angelozerr

But it think it is a problem of tsserver, not a problem of the IDE. The tsserver should provide a protocol for monitoring (compilation progress and cancelation).

PhaserEditor2D avatar Sep 22 '17 16:09 PhaserEditor2D

The tsserver should provide a protocol for monitoring (compilation progress and cancelation).

Not sure that TypeScript teams will implement that.

angelozerr avatar Sep 22 '17 16:09 angelozerr

I guess they should if they want to be IDE independent. In the meantime, to stop the compilation we can kill the process, and print the output messages to show the progress.

PhaserEditor2D avatar Sep 22 '17 16:09 PhaserEditor2D

In the meantime, to stop the compilation we can kill the process

No we cannot do that, because tsserver is used too for completion, hover, etc

and print the output messages to show the progress.

Perhaps tsserver watch supports that. The best mean is to study this feature, but I have no time to study that for the moment.

Any help are welcome:)

angelozerr avatar Sep 22 '17 17:09 angelozerr

Yes, the tsserver emits the files are being compiled.

I was looking into the VSCode TypeScript extension you pointed to me above and I did not find any related to the watch mode, however in the official tutorial about TypeScript development with VSCode they say the compiling is made via Tasks, traduced to the Eclipse world, via Run Configurations:

https://code.visualstudio.com/docs/languages/typescript#_transpiling-typescript-into-javascript

It means that the user is the one who executes the compiler, in watch mode or not. I think this is could be valid for TypeScript IDE, instead of implement a builder it can provides simpler ways of running the typescript compiler, for example, with Run Configurations or a TypeScript Compiler console.

A TypeScript Compiler console could be a kind of terminal that adds tsc to the exec path.

PhaserEditor2D avatar Sep 25 '17 14:09 PhaserEditor2D

with Run Configurations or a TypeScript Compiler console.

This launch already exists https://github.com/angelozerr/typescript.java/wiki/TypeScript-Compiler

You must not to use compileOnSave in this case.

angelozerr avatar Sep 25 '17 14:09 angelozerr

I have to test it :), actually, I see you mention there the watch mode.

PhaserEditor2D avatar Sep 25 '17 14:09 PhaserEditor2D

@boniatillo-com I think when you say tsserver watch mode, it's tsc watch mode. It's not the same thing.

The benefit with tsserver compile on save is that you avoid double parsing of ts files (one by tsserver and one by tsc). More with tsserver you can manage progress monitor.

angelozerr avatar Oct 04 '17 19:10 angelozerr

Hi @angelozerr, sorry, I am not collaborating more, I am preparing the papers myself for two conventions and my time is zero. As soon as I back from the travel I will return on this. I want to deliver the new major Phaser Editor version with typescript ide.

PhaserEditor2D avatar Oct 05 '17 12:10 PhaserEditor2D