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: move package.json cache into ResolvedConfig #5388

Merged
merged 3 commits into from
Nov 19, 2021

Conversation

aleclarson
Copy link
Member

@aleclarson aleclarson commented Oct 22, 2021

Description

This PR moves the (previously global) package.json cache into ResolvedConfig, so the file watcher can do cache invalidation when a package.json file is changed (which can happen in the case of linked packages).

This also fixes an issue with sideEffects support, where the package.json resolutions done with preserveSymlinks: true were not disambiguated from preserveSymlinks: false, leading to false negatives when checking sideEffects for a matched path.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@aleclarson aleclarson added the p4-important Violate documented behavior or significantly improves performance (priority) label Oct 22, 2021
bluwy
bluwy previously approved these changes Oct 24, 2021
@aleclarson aleclarson force-pushed the feat/package-cache branch 3 times, most recently from 2542c4e to fa78284 Compare November 17, 2021 03:16
…so changes to package.json invalidate the cache.

This is useful for linked packages and when a dependency is upgraded.

This commit also fixes a bug with `pkg.sideEffects` handling by including `preserveSymlinks` in the cache key.
@patak-dev patak-dev changed the title feat: move package.json cache into ResolvedConfig fix: move package.json cache into ResolvedConfig Nov 19, 2021
@patak-dev patak-dev merged commit 650b56e into vitejs:main Nov 19, 2021
@aleclarson aleclarson deleted the feat/package-cache branch February 25, 2022 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants