Skip to content

[Chore] Upgrade examples to Vite v8 and stories to Storybook v10 - #11328

Merged
fzaninotto merged 4 commits into
masterfrom
vite-v8
Jul 30, 2026
Merged

[Chore] Upgrade examples to Vite v8 and stories to Storybook v10#11328
fzaninotto merged 4 commits into
masterfrom
vite-v8

Conversation

@fzaninotto

@fzaninotto fzaninotto commented Jul 30, 2026

Copy link
Copy Markdown
Member

Problem

Vite v7 has many dependencies with vulnerabilities, an do does Storybook v8 (which relies on good old webpack). So we often get notifications from dependabot that aren't significant (as we only use vite for the demos, the packages are built with zshy).

Solution

How To Test

  • Run and build all demos, test them.
  • Run the storybook, test it

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • [ ] The PR includes unit tests (if not possible, describe why)
  • [ ] The PR includes one or several stories (if not possible, describe why)
  • [ ] The documentation is up to date

@fzaninotto fzaninotto added the RFR Ready For Review label Jul 30, 2026
@fzaninotto fzaninotto changed the title [Chore] Upgrade examples to vite v8 [Chore] Upgrade examples to Vite v8 and stories to Storybook v10 Jul 30, 2026
Comment thread examples/tutorial/vite.config.ts Outdated
replacement: path.resolve(
__dirname,
'node_modules/@mui/icons-material'
'node_modules/@mui/icons-material/esm'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Question: Shouldn't we use resolve.dedupe: ['@mui/material', '@mui/icons-material'] instead ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, it works, but only in the tutorial, not in the other examples. In the CRM for instance, there is no direct dependency to MUI, so it uses the hoisted version of MUI V5 from RA, and that's where the CJS error arrives. So I changed it only in the tutorial.

Comment thread .storybook/main.ts
core: {
disableTelemetry: true,
},
viteFinal: async viteConfig => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Issue: With v10 the interactions panel is now dispay. I don't think we need it.

Suggestion: BTW, I think we can remove the actions panel too

Suggested change
viteFinal: async viteConfig => {
features: {
interactions: false,
actions: false,
},
viteFinal: async viteConfig => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed

Comment thread .storybook/main.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

With this new version of Storybook, the Code panel is no longer the first panel displayed. Now, Controls is the first one.

As a user, I'd like to see the code first, and then click on Controls for the few stories that require it.

To do that, could you create a file named .storybook/manager.ts with this content?

import { addons, types } from 'storybook/manager-api';

addons.register('react-admin/panel-order', () => {
    const panels = addons.getElements(types.PANEL);
    const controls = panels['addon-controls'];
    delete panels['addon-controls'];
    panels['addon-controls'] = controls;
});

It will re-order the tabs.
Unfortunately, Storybook doesn't expose the API to do this directly from main.ts, so we have to reorder it manually

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good suggestion! implemented.

@fzaninotto
fzaninotto merged commit f5119f8 into master Jul 30, 2026
15 checks passed
@fzaninotto
fzaninotto deleted the vite-v8 branch July 30, 2026 15:21
@fzaninotto fzaninotto added this to the 5.15.2 milestone Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants