Skip to content
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

2026: Better tsconfig breakdown #2526

Merged
merged 4 commits into from
Nov 6, 2023
Merged

Conversation

sarahsporck
Copy link
Contributor

Short description

One idea of yarn > 2 includes not hoisting dependencies. This means that e.g. jest/typescript/eslint is not hoisted to child dependencies. However we also don't want (and most of the time don't need) to install these dependencies in every workspace. Instead yarn berry allows to use global scripts, which can be accessible from anywhere. To ease the workflow with those global scripts it often helps alinging the configs to their framework specific monorepo setup.
For typescript this is described in the docs here.

Proposed changes

  • Each tsconfig.json specifies exactly what files it includes
  • Every reference (in a tsconfig file) will only be built if it has not yet been built before
    • This speeds up tsc --build command visibly

Side effects

  • I had trouble with eslint running into oom in 2026: Update to yarn berry #2484. This is a known issue and can be fixed by removing enforceConsistentCasingInFilenames from the tsconfig and adding --max-old-space-size=1535 to the lint:ci command. If I see the builds failing for this PR I'll add this change.

Resolved issues

Relates: #2026


@sarahsporck sarahsporck changed the title 2026: better tsconfig breakdown 2026: Better tsconfig breakdown Oct 17, 2023
@sarahsporck sarahsporck force-pushed the 2026-better-tsconfig-setup branch from b0a58f1 to b8e4d06 Compare October 17, 2023 14:48
native/tsconfig.json Show resolved Hide resolved
tools/tsconfig.json Show resolved Hide resolved
Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, nice!

Copy link
Contributor

@LeandraH LeandraH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, and I can finally run yarn ts:check in the main directory 🥳

@sarahsporck sarahsporck enabled auto-merge November 6, 2023 07:28
@sarahsporck sarahsporck disabled auto-merge November 6, 2023 07:31
@sarahsporck sarahsporck enabled auto-merge November 6, 2023 07:39
@sarahsporck sarahsporck merged commit 93f18e0 into main Nov 6, 2023
4 checks passed
@sarahsporck sarahsporck deleted the 2026-better-tsconfig-setup branch November 6, 2023 07:48
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.

3 participants