Skip to content

Support/feature - tscserver / hooking into tsc --watch results #13608

Closed
@ORESoftware

Description

@ORESoftware

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions