Skip to content

Add explicit exclude and include paths to tsconfig #130

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

huntie
Copy link
Collaborator

@huntie huntie commented May 15, 2025

Summary:

Intends to resolve #129.

See https://github.com/microsoft/Typescript/wiki/Performance#configuring-tsconfigjson-or-jsconfigjson recommendations.

Changelog:

[GENERAL][CHANGED] - Scope include paths in tsconfig.json

Test Plan:

Comparison:

image

@huntie huntie requested a review from cortinico May 15, 2025 13:18
@kraenhansen
Copy link
Contributor

Perhaps we would want to include (or actually move) the **/Pods/** from the config being extended? https://github.com/facebook/react-native/blob/ca764bb5115d2e7baa6e07c49e64d4806f5b3d4a/packages/typescript-config/tsconfig.json#L41

@huntie
Copy link
Collaborator Author

huntie commented May 15, 2025

@kraenhansen Wouldn't hurt — added. Probably best to leave in the base config for a while (existing projects).

@huntie huntie force-pushed the tsconfig-scope-paths branch from 33a4e92 to 3e501a9 Compare May 15, 2025 16:05
@kraenhansen
Copy link
Contributor

kraenhansen commented May 15, 2025

@huntie I actually don't think it's effective (based on the description and issue linked from facebook/react-native#42375) and I have a suspicion that facebook/react-native#42909 was never tested 🙈

@huntie huntie force-pushed the tsconfig-scope-paths branch from 3e501a9 to f1f20b8 Compare May 16, 2025 09:37
@huntie
Copy link
Collaborator Author

huntie commented May 16, 2025

@kraenhansen Hmm, good notes.

On an empty template:

  • *.ts, *.tsx — Significant, avoids over-including config files and resolving their dependencies.
  • **/node_modules — Useful in case of any conversion to a monorepo (TS will only ignore a root node_modules dir by default).
  • **/Pods — Useful once pods are installed, if they contain TS sources.

And it looks like tsc reaches into node_modules regardless, but only if depended on by the input program. As such, I'm not super sure we're solving the perf issue reported — unless this involved a monorepo setup (moderately likely!).

Test plan updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript compiler crashes due to unrestricted "includes"
2 participants