Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Oct 27, 2025

This PR contains the following updates:

Package Change Age Confidence
@vitest/browser (source) ^3.2.4 -> ^4.0.6 age confidence
@vitest/coverage-v8 (source) ^3.2.4 -> ^4.0.6 age confidence
@vitest/ui (source) ^3.2.4 -> ^4.0.6 age confidence
vitest (source) 3.2.4 -> 4.0.6 age confidence

Release Notes

vitest-dev/vitest (@​vitest/browser)

v4.0.6

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v4.0.5

Compare Source

   🐞 Bug Fixes
   🏎 Performance
    View changes on GitHub

v4.0.4

Compare Source

   🐞 Bug Fixes
   🏎 Performance
    View changes on GitHub

v4.0.3

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v4.0.2

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v4.0.1

Compare Source

   🐞 Bug Fixes
    View changes on GitHub

v4.0.0

Compare Source

Vitest 4.0 is out!

To stay updated, read our blog post and check the migration guide.

   🚨 Breaking Changes
   🚀 Features
   🐞 Bug Fixes
   🏎 Performance
    View changes on GitHub

Configuration

📅 Schedule: Branch creation - Between 12:00 AM and 04:59 AM, only on Monday ( * 0-4 * * 1 ) in timezone UTC, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Update of dependencies. label Oct 27, 2025
@mui-bot
Copy link

mui-bot commented Oct 27, 2025

Deploy preview: https://deploy-preview-20102--material-ui-x.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 776f446

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 27, 2025
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@renovate renovate bot force-pushed the renovate/major-vite-and-vitest branch from 765e2cc to 8970abc Compare October 27, 2025 03:36
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Oct 27, 2025
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@renovate renovate bot force-pushed the renovate/major-vite-and-vitest branch from 8970abc to 1f1d928 Compare October 27, 2025 08:24
@github-actions github-actions bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Oct 27, 2025
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@renovate renovate bot force-pushed the renovate/major-vite-and-vitest branch 2 times, most recently from 152b001 to dee8247 Compare October 27, 2025 08:46
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 27, 2025
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 27, 2025
@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@renovate renovate bot force-pushed the renovate/major-vite-and-vitest branch from d8c5142 to a82f2c9 Compare October 27, 2025 09:49
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 27, 2025
@renovate
Copy link
Contributor Author

renovate bot commented Oct 27, 2025

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 27, 2025
package.json Outdated
"@types/babel__core": "^7.20.5",
"@types/babel__traverse": "^7.28.0",
"@types/chai-dom": "^1.11.3",
"@types/mocha": "^10.0.10",
Copy link
Member

Choose a reason for hiding this comment

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

Our tsconfig depends on the monorepo's, which references types: ["mocha"], so we need to add them as a dev dependency even if we don't use them.

The build was failing because of it.

Building types for /tmp/mui/packages/x-internal-gestures/tsconfig.build.json in /tmp/code-infra-build-tsc-z0IZk8
error TS2688: Cannot find type definition file for 'mocha'.
  The file is in the program because:
    Entry point of type library 'mocha' specified in compilerOptions
code-infra build

Copy link
Member

Choose a reason for hiding this comment

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

We don't, just override types in tsconfig.json to types: ["node", "react"]

Copy link
Member

Choose a reason for hiding this comment

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

Ah, makes sense 👍

I've added an empty array instead to let the consumers of this tsconfig define the types they need and avoid too many changes.

@bernardobelchior bernardobelchior force-pushed the renovate/major-vite-and-vitest branch from 2373a74 to 7afb818 Compare October 27, 2025 10:27
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Oct 27, 2025
Comment on lines 24 to 27
launchOptions: {
// Required for tests which use scrollbars.
ignoreDefaultArgs: ['--hide-scrollbars'],
},
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to move this to the shared config now I believe, which would simplify this file 😆

Copy link
Member

Choose a reason for hiding this comment

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

This isn't used in all files tests, so I didn't want to move it there if we don't use it. Would the other packages benefit from this?

Copy link
Member

Choose a reason for hiding this comment

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

We can probably just make the sharedConfig a func that accepts arguments, so we can simplify this file

Copy link
Member

Choose a reason for hiding this comment

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

In CI the --hide-scrollbars is always ignored because it is defined here: https://github.com/JCQuintas/mui-x/blob/f8b4a73db5df88af3e443a3176d0af625492b736/scripts/playwrightLaunchServer.mjs#L16

So we probably can drop it here too

Copy link
Member

Choose a reason for hiding this comment

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

What if we run the tests locally? In that case we don't call playwrightLaunchServer, right? In that case, I suppose we would like the tests to be similar to CI

Copy link
Member

Choose a reason for hiding this comment

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

That is my point, o CI it always runs with that ignore flag, so we should probably move it to the shared config

@JCQuintas
Copy link
Member

Or is it just that when we're running projects in order there's only one test running at a time?

Yeah I guess that not running them in isolation mode is sharing the same "runner", if each project has a different config, it might causes issues.

Though this is theory crafting 🤷

That's a bit of a brittle workaround.

Why would it be specially brittle? Having tests out of isolation is the real problem I guess, but we can't solve that. The vitest@v3 behaviour was to run tests in sequence, so it only makes sense that we define the sequence ourselves.

I went all in and added a order for every project(since i suspect this might solve some issues we have had with browser tests), but it is very possible there are only a few offenders that need to be ran on their own.

@bernardobelchior
Copy link
Member

Why would it be specially brittle?

I think it's brittle because we each config to define its own order with a number that is global. A collision in numbers could cause tests to fail. It would be nice if we could set the projects order from the root config instead.

However, it'll probably only cause issues when adding new projects and it'd probably be caught by CI, so not a blocker for me.

Having tests out of isolation is the real problem I guess, but we can't solve that. The vitest@v3 behaviour was to run tests in sequence, so it only makes sense that we define the sequence ourselves.

Yeah, but I don't see any mention of that change in the changelog. I'll open an issue in Vitest's repo to understand if this is intentional and left out of the migration guide accidentally or if it's actually a bug.

@bernardobelchior bernardobelchior changed the title Bump Vite & Vitest to 4.0.5 (major) Bump Vitest to v4 (major) Oct 31, 2025
@bernardobelchior
Copy link
Member

Vitest bug confirmed: vitest-dev/vitest#8894 (comment)

Will subscribe to be warned when it's fixed so we can revive this PR.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 3, 2025
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@bernardobelchior bernardobelchior force-pushed the renovate/major-vite-and-vitest branch from 987c1f7 to 9124bfe Compare November 3, 2025 13:17
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 3, 2025
@bernardobelchior
Copy link
Member

The remaining tests are failing because An update to GridCell2 inside a test was not wrapped in act(...) is being logged as an error and tests that have expect().not.toErrorDev() are failing. It's true that it's calling a console.error, but I'm not sure why this wasn't failing before.

Excerpt of successful tests (3914ec5)

Workflow

stderr | src/tests/rowSpanning.DataGridPremium.test.tsx > <DataGridPremium /> - Row spanning > should not throw when initializing an aggregation model
An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act GridCell2
stderr | src/tests/rowSpanning.DataGridPremium.test.tsx > <DataGridPremium /> - Row spanning > should not throw when initializing an aggregation model
An update to %s inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act GridCell2
 ✓  x-data-grid-premium (chromium)  src/tests/rowSpanning.DataGridPremium.test.tsx (1 test) 248ms

@bernardobelchior
Copy link
Member

rowSpanning.DataGridPremium.test.tsx seems to be failing when run in isolation in v3 and v4 (pnpm test:unit:browser --coverage rowSpanning.DataGridPremium.test.tsx), but passes when run among other tests in v3 (pnpm test:unit:browser --coverage). In v4, it correctly fails. It seems some bug has been fixed in v4.

);

// Fixes act warning
await act(() => Promise.resolve());
Copy link
Member

Choose a reason for hiding this comment

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

Tried using await act(() => clock.runAll()) and await act(() => vi.runAllTimers()) but they didn't work. This was the only solution that I could make work.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, the timers wouldn't really work here.
I suspect this works because it turns the act flag on until the next loop

Copy link
Member

@JCQuintas JCQuintas left a comment

Choose a reason for hiding this comment

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

Nice work, thanks for taking care of this.

Left some suggestions for improvements/questions

export default defineConfig({
test: {
environment: 'node',
maxWorkers: 1,
Copy link
Member

Choose a reason for hiding this comment

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

do we need this here? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Yes. We need maxWorkers to be consistent across all projects, otherwise we'll get an error:

Error: Projects "docs" and "eslint-plugin-mui-x" have different 'maxWorkers' but same 'sequence.groupOrder'.
Provide unique 'sequence.groupOrder' for them.

Copy link
Member

Choose a reason for hiding this comment

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

ah ok, this is not importing the sharedConfig

Copy link
Member

Choose a reason for hiding this comment

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

Exactly

'The above error occurred in the <UseSvgRef> component',
];
const expectedError = reactMajor < 19 ? errorMessages : errorMessages.slice(0, 2).join('\n');
const expectedError = ['The above error occurred in the <UseSvgRef> component'];
Copy link
Member

Choose a reason for hiding this comment

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

What happened to these errors? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

It seems the way errors are reported now has changed. I don't understand why. It also seems to have changed in different ways in React 18 vs React 19. I suspect it was the JSDOM integration that changed slightly in v4 and it has caused changes in the way these errors are logged.

This is indeed weird because these errors are being logged as "uncaught" by JSDOM (search here for "Error: Uncaught [Error: MUI X Charts: Could not find the Chart context."), but they're being caught by the ErrorBoundary otherwise the test would fail because it's asserting on caught errors. It seems something has changed in Vitest's integration with JSDOM and now only the final error in the cause chain is being logged.

);

// Fixes act warning
await act(() => Promise.resolve());
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, the timers wouldn't really work here.
I suspect this works because it turns the act flag on until the next loop

Comment on lines 24 to 27
launchOptions: {
// Required for tests which use scrollbars.
ignoreDefaultArgs: ['--hide-scrollbars'],
},
Copy link
Member

Choose a reason for hiding this comment

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

In CI the --hide-scrollbars is always ignored because it is defined here: https://github.com/JCQuintas/mui-x/blob/f8b4a73db5df88af3e443a3176d0af625492b736/scripts/playwrightLaunchServer.mjs#L16

So we probably can drop it here too

@JCQuintas
Copy link
Member

think we are good to go

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 7, 2025
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@bernardobelchior bernardobelchior force-pushed the renovate/major-vite-and-vitest branch 2 times, most recently from 7b184f9 to c343d7d Compare November 7, 2025 10:24
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 7, 2025
@renovate renovate bot force-pushed the renovate/major-vite-and-vitest branch from c343d7d to 7c23db6 Compare November 7, 2025 10:26
@renovate renovate bot changed the title Bump Vitest to v4 (major) Bump Vite & Vitest to ^4.0.6 (major) Nov 7, 2025
@bernardobelchior bernardobelchior changed the title Bump Vite & Vitest to ^4.0.6 (major) Bump Vite & Vitest to ^4.0.7 (major) Nov 7, 2025
@renovate renovate bot force-pushed the renovate/major-vite-and-vitest branch from 5205191 to fe250c6 Compare November 7, 2025 10:35
@renovate renovate bot changed the title Bump Vite & Vitest to ^4.0.7 (major) Bump Vite & Vitest to ^4.0.6 (major) Nov 7, 2025
@bernardobelchior bernardobelchior force-pushed the renovate/major-vite-and-vitest branch from 1f23372 to 776f446 Compare November 7, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Update of dependencies.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants