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

fix(esbuild): update to tsconfck 3.0.1 to fix edge cases when resolving tsconfig.extends #15502

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

dominikg
Copy link
Contributor

@dominikg dominikg commented Jan 3, 2024

update to tsconfck@3.0.1

Changes:

Example:

tsconfig.base.json
a/tsconfig.json #extends tsconfig.base.json
a/b/tsconfig.json #extends a/tsconfig.json
a/foo.ts
a/b/bar.ts
const a_b_tsconfig = await parse('a/b/bar.ts'); 
// both 3.0.0 and 3.0.1 return correctly extended result from tsconfig.base.json to a/b/config.json, shallow parsing a/tsconfig.json in the process.

const a_tsconfig = await parse('a/foo.ts'); 
// 3.0.0 returns content of a/tsconfig.json without applied values from tsconfig.base.json if it was previously shallow parsed
// 3.0.1 recognizes that a/tsconfig.json has not been extended yet and does it lazily before returning the value

Unfortunately with this change we can no longer use the direct cache access optimization as the extends parsing is done lazily to avoid the performance penalty if the intermediate tsconfig is never used apart from being extended

Description

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

stackblitz bot commented Jan 3, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@bluwy bluwy mentioned this pull request Jan 8, 2024
9 tasks
@patak-dev patak-dev merged commit 1fcebeb into vitejs:main Jan 8, 2024
10 checks passed
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.

extends in tsconfig.json should prefer tsconfig.json over package.json
3 participants