You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw mention of "tscserver" - but I am not sure if that still exists - it sounds like that became tsc --watch?
What I want to do:
Compile a .tsx file on demand, and when it's done compiling, send a socket message to the browser, telling the browser that the file is compiled and ready to be loaded into the browser.
The problem:
The problem is thattsc --watchdoes not allow me to listen for when the compilation is finished.
Temporary solution:
So what I am currently doing now - instead of using tsc --watch, I am just running tsc as a child process on demand. When the child process closes, and exits with 0, I know compilation is done. And the problem is that it's a little bit slower this way, maybe 100 ms slower.
Longer term solution proposal:
As a better solution, it would be great to pre-start a Node.js process with tsc loaded already - essentially creating a tscserver, but I am not sure if this is possible. Alternatively, tsc --watch would allow me to somehow listen for compilation completion events.
To re-iterate, I am looking for:
(a) a way to hook into tsc --watch, to create actions that occur after compilation completes,
and/or
(b) a way to create tscserver that can process requests on demand, and where I can listen for compilation completion events.
Any help much appreciated, thanks.
The text was updated successfully, but these errors were encountered:
ORESoftware
changed the title
Support/feature - tscserver / hooking into tsc --watch results
Support/feature - tscserver and/or hooking into tsc --watch results
Jan 21, 2017
ORESoftware
changed the title
Support/feature - tscserver and/or hooking into tsc --watch results
Support/feature - tscserver / hooking into tsc --watch results
Jan 21, 2017
tsc is just a command line tool, so running costume actions after it is done is really not in scope.
All the pieces that allow tsc --watch to work are available to you through the compiler API, so you should be able to build a process that watches changes, and calls the compiler when needed.
There are already existing tools like tsb that does more or less what you are asking for, i would recommend investigating these before building you own.
With these issues in mind:
#10879
#13588
I saw mention of
"tscserver"
- but I am not sure if that still exists - it sounds like that becametsc --watch
?What I want to do:
Compile a .tsx file on demand, and when it's done compiling, send a socket message to the browser, telling the browser that the file is compiled and ready to be loaded into the browser.
The problem:
The problem is that
tsc --watch
does not allow me to listen for when the compilation is finished.Temporary solution:
So what I am currently doing now - instead of using
tsc --watch
, I am just runningtsc
as a child process on demand. When the child process closes, and exits with 0, I know compilation is done. And the problem is that it's a little bit slower this way, maybe 100 ms slower.Longer term solution proposal:
As a better solution, it would be great to pre-start a Node.js process with tsc loaded already - essentially creating a
tscserver
, but I am not sure if this is possible. Alternatively,tsc --watch
would allow me to somehow listen for compilation completion events.To re-iterate, I am looking for:
and/or
Any help much appreciated, thanks.
The text was updated successfully, but these errors were encountered: