typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

`System` vs `Host` vs `Program` layering

Open iisaduan opened this issue 10 months ago • 0 comments

In #241, we had quite a bit of discussion about whether certain fields belong to System vs Host vs Program layering, with all reviewers agreeing that the current setup "feels weird": discussion, comment

For example, which layers should have a compiler CompilerOptions object? What options should be shared, and what options can be changed? These layering considerations are something to keep in mind as more of the system is implemented (and also when CompilerOptions are eventually refactored to be generated)

I think the confusion comes from strada having compilerOptions be a one-and-all object to hold everything. At each level, not every option is used. For examples, incremental is only used in executeCommandLine and emitter, and I'm pretty sure that the separate watchOptions object gets combined into the compilerOptions object at some points, but because the watchoptions aren't used in places like checker, we don't really see that. So the CompilerHost would only need a subset of compilerOptions, and Program would need some overlapping subset.

iisaduan avatar Feb 03 '25 23:02 iisaduan