Skip to content

Comments

fix(vitest): disable optimizer by default until it's stable#5156

Merged
sheremet-va merged 1 commit intovitest-dev:mainfrom
sheremet-va:feat/disable-optimizer
Feb 12, 2024
Merged

fix(vitest): disable optimizer by default until it's stable#5156
sheremet-va merged 1 commit intovitest-dev:mainfrom
sheremet-va:feat/disable-optimizer

Conversation

@sheremet-va
Copy link
Member

Description

The optimizer is not stable enough at this point (some packages like react don't work with it and if all dependencies are not pre-bundled, there is a high chance users will get a "Cannot find module" error only in CI which is hard to debug). Since Vitest 1.3.0 focuses more on stability, we are disabling this option until we can figure out a good way to enable it without these hazards. If your tests are slower after this PR, you can always enable optimizer manually:

export default defineConfig({
  test: {
    deps: {
      optimizer: {
        web: {
           enabled: true,
        },
        ssr: {
          enabled: true,
        }
      }
    }
  }
})

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify
Copy link

netlify bot commented Feb 8, 2024

Deploy Preview for fastidious-cascaron-4ded94 ready!

Name Link
🔨 Latest commit 53654e6
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/65c4f491a5e1e70008b29d9e
😎 Deploy Preview https://deploy-preview-5156--fastidious-cascaron-4ded94.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@hi-ogawa hi-ogawa left a comment

Choose a reason for hiding this comment

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

Sounds good to me. Considering the issue with ssr.optimizeDeps #4910 is fixed since Vite 5.1 vitejs/vite#15561, I think this affects jsdom/happy-dom use cases mostly.

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.

2 participants