-
Notifications
You must be signed in to change notification settings - Fork 154
chore(internal): revisit tsconfig
files
#1667
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
Merged
dreamorosi
merged 23 commits into
main
from
617-maintenance-simplify-and-revisit-tsconfig-files-settings
Sep 4, 2023
Merged
chore(internal): revisit tsconfig
files
#1667
dreamorosi
merged 23 commits into
main
from
617-maintenance-simplify-and-revisit-tsconfig-files-settings
Sep 4, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
tsconfig
filestsconfig
files
89edc53
to
6364b0e
Compare
Kudos, SonarCloud Quality Gate passed!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
automation
This item relates to automation
batch
This item relates to the Batch Processing Utility
commons
This item relates to the Commons Utility
dependencies
Changes that touch dependencies, e.g. Dependabot, etc.
documentation
Improvements or additions to documentation
internal
PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)
size/XXL
PRs with 1K+ LOC, largely documentation related
tests
PRs that add or change tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
This PR introduces changes to the TypeScript configuration of the project by revisiting and standardizing the configurations across packages. Before this PR each workspace was defining and maintaining its own TypeScript configuration, this defeated the purpose of using a monorepo structure and made maintenance time consuming.
In this PR we define the main
tsconfig.json
file at the root of the project and then use theextends
option to define a more specific one in each workspace package.This way the main settings for the project are defined centrally simplifying maintenance and enforcing increased consistency. At the same time, workspace packages can still override any of the settings locally ensuring customizability.
For example, given a
tsconfig.json
file at the project's root:we can define a more specific one in
packages/logger/tsconfig.json
by extending the main one:Starting from this PR we also introduce a dedicated
tsconfig.json
file in thetests
directory of each workspace, i.e.packages/logger/tests/tsconfig.json
:This allows us to finally include the tests as part of the TS configuration but still keep them excluded from the compilation.
In addition to the changes above, we have also reviewed every option available and considered its impact on the project. As a result of this work we have introduced a couple new options that should bring performance improvements at build time:
references
andcomposite
to the project: "Project references are a way to structure your TypeScript programs into smaller pieces. Using Project References can greatly improve build and editor interaction times, enforce logical separation between components, and organize your code in new and improved ways."incremental
setting to tell "TypeScript to save information about the project graph from the last compilation to files stored on disk. This creates a series of.tsbuildinfo
files in the same folder as your compilation output."The two changes above open the door to potential additional build performance improvements in the future by caching incremental build artifacts or parallelizing commands but still having TS figure out dependencies between modules.
In addition to the above, we have identified a few other areas that we'd like to experiment in the near future but that we have intentionally left out due to potential breaking changes, like:
importHelpers
,noEmitHelpers
, anddownlevelIteration
which would allow to move helpers to an externaltslib
module shared across files rather than emitting the same helpers multiple timesisolatedModules
which would allow to ensure that each file can be safely transpiled without relying on other imports, thus further improving build perfRelated issues, RFCs
Issue number: #617
Checklist
Breaking change checklist
Is it a breaking change?: NO
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.