-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rush-stack] Analyzing .ts files instead of .d.ts files #1379
Comments
Microsoft doesn't centrally dictate how a team should do their work. Each product group has quite a lot of autonomy in the approaches and tools that they choose. The Midgard developers aren't even in the same time zone as the Office group where Rush originated, so it's perhaps not directly on their radar, but I know they evaluated Rush and asked questions about it in the past. It's healthy for different teams to experiment with different approaches. Today Rush focuses on a fairly specific niche (the "scalable" monorepo servicing lots of teams and projects). This niche has its pros and cons. Personally, my own interest is to solve those engineering problems as best we can; the motivation isn't really about download statistics or adoption. If every monorepo at Microsoft ends up using Rush, that should happen because each team determined that Rush was the best tool for the job, not because they felt pressure to "align" with the rest of the company. Of course, I can only speak for myself. :-) |
We should use this issue to discuss the actual topic of the blog post, since it's very relevant to the proposed watch improvement for Rush / Rush Stack. Vincent's idea is summarized in this excerpt:
The Rush community proposed a somewhat different approach in #1151. Rather than launching a separate Having the compiler analyze .ts files instead of .d.ts files is an interesting alternative. What's particularly interesting is that they treat IntelliSense as a completely separate compiler configuration from the build+bundling (+ other stuff like API Extractor .d.ts rollup) that needs to happen for a "real" build. The advantage is that the VS Code refactoring can treat the entire repo as a single compiler analysis. The disadvantage seems to be that the analysis is overall more expensive. For example, a while ago we changed API Extractor to analyze .d.ts files instead of .ts files, and it greatly reduced the amount of work that the compiler has to do. The .d.ts files are very quick to process, because they contain only type signatures, and those signatures are in a nice normalized form. In my own work, I never open VS Code at the root of a monorepo. Instead, I open a separate VS Code window for each project that I want to edit. This limits each IntelliSense analysis to a single tsconfig.json for a single project. If you want to scale up to thousands of NPM packages (instead of 100), intuitively it seems that at some point the compiler would choke trying to analyze the entire monorepo. But this is just a speculation. We'd need to do some scientific measurements to know for sure. And "incomplete refactoring experience" is indeed a casualty of that approach. |
Thanks for the considered response, I look forward to hearing more about the approaches and also look forward to reading up on rush stack |
I'm curious as to why Midgard is looking for another solution to their mono-repo and how does that reflect on Rush?
see: https://medium.com/@vincentbailly/evolving-a-large-typescript-repository-4a32c61e94fd
The text was updated successfully, but these errors were encountered: