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: apply development|production condition on Vite 6 #7301

Merged

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Jan 20, 2025

Description

2nd try for #7070. Thanks @thebanjomatic for the initial PR 🙏

As discussed (see #7070 (comment)), Vite 6 now allows excluding module conditions from their resolve API, so we can go with that on Vitest 3 + Vite 6.

Our current conditions: ["node"] would also drop Vite's default development|production condition, so we can use defaultServerConditions and just filter out module.

todo

  • fix pool level --conditions
  • test
  • test with Vite 6
  • docs (breaking change)

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:.

Copy link

netlify bot commented Jan 20, 2025

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 5658a69
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/6792436347e68900083fc4df
😎 Deploy Preview https://deploy-preview-7301--vitest-dev.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.

@hi-ogawa hi-ogawa force-pushed the fix-condition-development-production branch from 4b3c12f to 68fae01 Compare January 21, 2025 09:19
@hi-ogawa hi-ogawa force-pushed the fix-condition-development-production branch from 77e7da3 to b105765 Compare January 21, 2025 09:37
@hi-ogawa hi-ogawa force-pushed the fix-condition-development-production branch from 68824e9 to 62bb62e Compare January 21, 2025 09:49
@hi-ogawa hi-ogawa marked this pull request as ready for review January 21, 2025 09:57
sheremet-va
sheremet-va previously approved these changes Jan 21, 2025
@sheremet-va
Copy link
Member

@hi-ogawa feel free to merge if this is ready

@sheremet-va sheremet-va merged commit ef1464f into vitest-dev:main Jan 23, 2025
13 checks passed
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Jan 23, 2025
##### [v3.0.4](https://github.com/vitest-dev/vitest/releases/tag/v3.0.4)

#####    🐞 Bug Fixes

-   Filter projects eagerly during config resolution  -  by [@sheremet-va](https://github.com/sheremet-va) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7313 [<samp>(dff44)</samp>](vitest-dev/vitest@dff4406d)
-   Apply `development &nbsp;-&nbsp; by @hi-ogawa and @sheremet-va [<samp>(produ)</samp>](https://github.com/vitest-dev/vitest/commit/production` condition on Vite 6 ([#7301](vitest-dev/vitest#7301)))
-   **browser**: Restrict served files from `/__screenshot-error`  -  by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7340 [<samp>(ed9ae)</samp>](vitest-dev/vitest@ed9aeba2)
-   **deps**: Update all non-major dependencies  -  by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7297 [<samp>(38ea8)</samp>](vitest-dev/vitest@38ea8eae)
-   **runner**: Timeout long sync hook  -  by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7289 [<samp>(c60ee)</samp>](vitest-dev/vitest@c60ee27c)
-   **typechecking**: Support typechecking parsing with Vite 6  -  by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7335 [<samp>(bff70)</samp>](vitest-dev/vitest@bff70be9)
-   **types**: Fix public types  -  by [@mrginglymus](https://github.com/mrginglymus) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7328 [<samp>(ce6af)</samp>](vitest-dev/vitest@ce6af70c)

#####     [View changes on GitHub](vitest-dev/vitest@v3.0.3...v3.0.4)
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Jan 24, 2025
##### [v3.0.4](https://github.com/vitest-dev/vitest/releases/tag/v3.0.4)

#####    🐞 Bug Fixes

-   Filter projects eagerly during config resolution  -  by [@sheremet-va](https://github.com/sheremet-va) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7313 [<samp>(dff44)</samp>](vitest-dev/vitest@dff4406d)
-   Apply `development &nbsp;-&nbsp; by @hi-ogawa and @sheremet-va [<samp>(produ)</samp>](https://github.com/vitest-dev/vitest/commit/production` condition on Vite 6 ([#7301](vitest-dev/vitest#7301)))
-   **browser**: Restrict served files from `/__screenshot-error`  -  by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7340 [<samp>(ed9ae)</samp>](vitest-dev/vitest@ed9aeba2)
-   **deps**: Update all non-major dependencies  -  by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7297 [<samp>(38ea8)</samp>](vitest-dev/vitest@38ea8eae)
-   **runner**: Timeout long sync hook  -  by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7289 [<samp>(c60ee)</samp>](vitest-dev/vitest@c60ee27c)
-   **typechecking**: Support typechecking parsing with Vite 6  -  by [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7335 [<samp>(bff70)</samp>](vitest-dev/vitest@bff70be9)
-   **types**: Fix public types  -  by [@mrginglymus](https://github.com/mrginglymus) and [@sheremet-va](https://github.com/sheremet-va) in vitest-dev/vitest#7328 [<samp>(ce6af)</samp>](vitest-dev/vitest@ce6af70c)

#####     [View changes on GitHub](vitest-dev/vitest@v3.0.3...v3.0.4)
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.

Vite 6 compatibility issue resolve.conditions
2 participants