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: more stable hash calculation for depsOptimize #15337

Merged
merged 2 commits into from Dec 13, 2023

Conversation

antfu
Copy link
Member

@antfu antfu commented Dec 13, 2023

Description

Plugins could contribute to that list by simply pushing new items. While the order of them and duplicated items do not affect how deps works. We do a unique and sort, to make the hash calculation more stable.

Additional context

related: nuxt/nuxt#24196 (comment)


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 Dec 13, 2023

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

include: optimizeDeps?.include,
exclude: optimizeDeps?.exclude,
include: Array.from(new Set(optimizeDeps?.include)).sort(),
exclude: Array.from(new Set(optimizeDeps?.exclude)).sort(),
Copy link
Member

Choose a reason for hiding this comment

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

Nice one! Sounds good to me. We should still keep it as undefined if the option wasnt set though to avoid changing the hash for all the projects without explicit include/exclude and trigger a cold start for them

@patak-dev patak-dev merged commit 2b39fe6 into main Dec 13, 2023
14 of 15 checks passed
@patak-dev patak-dev deleted the fix/optimization-hash-stable branch December 13, 2023 11:53
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.

None yet

2 participants