Open sodic opened 2 months ago
This is some nice, easy to understand analysis, love it! What did you use to make the diagrams?
Users indirectly requesting this (they're requesting simpler imports or tsconfig
aliases, but solving this issue is how we make that happen):
I recall many similar requests, but we didn't record them. Still, I'm certain that the lack of support for import aliases is a common hurdle.
Problem
The user code is currently type-checked and built in four different contexts, each with its own errors and reporting.
See the table or graph below for details.
/tsconfig.json
.wasp/out/sdk/wasp/tsconfig.json
[Wasp]
wasp start
andwasp build
.wasp/out/server/tsconfig.json
[Server]
wasp build
*.wasp/out/web-app/tsconfig.json
[Webapp]
wasp build
** I don't think the server and web app do any type-checking during development. See #1718 for details.
Solution
We should explore how to always process the user's code exclusively under the rules specified in their
tsconfig.json
. This is most likely doable with project references: https://github.com/wasp-lang/wasp/issues/1827#issuecomment-2133815538.We must do this for all three of our framework's modules (SDK, client, server), and I believe project references are a solution in all three cases.