-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[code-infra] Migrate regression tests to vite #44964
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
Conversation
Netlify deploy previewhttps://deploy-preview-44964--material-ui.netlify.app/ Bundle size report |
Recently swapped out webpack for vite in the e2e/regressions setup here too 😬 |
test/regressions/index.js
Outdated
const importDemos = import.meta.glob( | ||
[ | ||
'docs/data/**/[A-Z]*.js', | ||
'docs/data/base/**/[A-Z]*/css/index.js', | ||
'docs/data/base/**/[A-Z]*/tailwind/index.js', | ||
'docs/data/base/**/[A-Z]*/system/index.js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to comment mentioning this is a include globs followed by exclude globs 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point, since now those are combined. 💡
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 did another pass over this patterns list and cleaned it up, sorted alphabetically and added a comment deliniating the inclusions from the exclusions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice evolution, great job! 👏 💯
Nitpick: Have you tried vite v5? 🤔
Currently all other deps are bringing/expecting vite v5 and with this change we introduce a new major of vite.
test/regressions/index.js
Outdated
const importDemos = import.meta.glob( | ||
[ | ||
'docs/data/**/[A-Z]*.js', | ||
'docs/data/base/**/[A-Z]*/css/index.js', | ||
'docs/data/base/**/[A-Z]*/tailwind/index.js', | ||
'docs/data/base/**/[A-Z]*/system/index.js', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point, since now those are combined. 💡
export default defineConfig({ | ||
plugins: [ | ||
{ | ||
// Unfortunatelly necessary as we opted to write our jsx in js files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's on my to do list. This has been causing trouble every time we try to introduce a tool that relies on esbuild.
I may be checking this wrong, but the only thing I see bringing in vite 5 is |
Avoid
React.lazy
, I don't feel like it brings a lot of benefit here as we're running through all the fixtures anyway and it causes throttled fallbacks in the suspense boundary.If the blacklist is too big, this may cause a lot of overhead in the bundle. Alternative would be to generate a virtual module that re-exports all desired fixtures and no more.just migrate regression tests to vite so we can encode the blacklist in the glob and avoid them in the bundle altogether
blocked on #44976
screenshot generation seems to run about ~30s (~15%) faster now
1 failing screenshot in joy theme viewer, caused by vitejs/vite#13727. We can ignore this for now