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(optimizer): always queue run at least once (fixes #8750) #8760

Closed

Conversation

sapphi-red
Copy link
Member

Description

getDepsOptimizer(config)?.run() is added to queue by runOptimizerWhenIdle through delayDepsOptimizerUntil.
But when entrypoints are all going to be optimized, all load hooks won't end so none of the transform hook will be called. This means that delayDepsOptimizerUntil is never called.

This PR adds queueFirstOptimizerRun function and call that on buildStart hook. This will ensure runOptimizerWhenIdle to be called at least once.

fixes #8750

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.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • 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).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) feat: deps optimizer Esbuild Dependencies Optimization labels Jun 24, 2022
@netlify
Copy link

netlify bot commented Jun 24, 2022

Deploy Preview for vite-docs-main canceled.

Name Link
🔨 Latest commit 8cfa974
🔍 Latest deploy log https://app.netlify.com/sites/vite-docs-main/deploys/62b59c3b1ccf4900093fa0fb

@sapphi-red sapphi-red marked this pull request as ready for review June 24, 2022 11:27
Copy link

@MYavuzYAGIS MYavuzYAGIS left a comment

Choose a reason for hiding this comment

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

lgtm

@patak-dev
Copy link
Member

Closing as we merged #8775, thanks again @sapphi-red

@patak-dev patak-dev closed this Jun 26, 2022
@sapphi-red sapphi-red deleted the fix/always-queue-optimizer-run branch June 26, 2022 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: deps optimizer Esbuild Dependencies Optimization p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vite 3 - npm package as rollupOptions.input fails when package is unused by other inputs
3 participants