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

[docs][table] Stabilize random series in virtualized table demo #43744

Merged
merged 8 commits into from
Sep 19, 2024

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Sep 13, 2024

Make sure we always generate the same list so that it stays stable during screenshot testing. Changes the demo to something that's more suitable to generate with chance and uses new Chance(42) to seed its random number generator to make it produce a stable sequence.

In X this is seeded it with () => 0.5 and it has a DISABLE_CHANCE_RANDOM, but this feels highly unnecessary, I've left it out for the core implementation.

Before: https://deploy-preview-43740--material-ui.netlify.app/material-ui/react-table/#virtualized-table
After: https://deploy-preview-43744--material-ui.netlify.app/material-ui/react-table/#virtualized-table

@Janpot Janpot added the docs Improvements or additions to the documentation label Sep 13, 2024
@Janpot Janpot changed the title [docs] Stabilize random series in viryualized table [docs] Stabilize random series in virtualized table demo Sep 13, 2024
@mui-bot
Copy link

mui-bot commented Sep 13, 2024

Netlify deploy preview

https://deploy-preview-43744--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against ac90b9f

Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

@oliviertassinari oliviertassinari added the component: table This is the name of the generic UI component, not the React module! label Sep 13, 2024
@oliviertassinari oliviertassinari changed the title [docs] Stabilize random series in virtualized table demo [docs][table] Stabilize random series in virtualized table demo Sep 13, 2024
@Janpot
Copy link
Member Author

Janpot commented Sep 13, 2024

would be nice to have this abstracted, but compared to what I wrote here, it feels a bit excessive to pull in as a dependency in the docs 🤔

Edit: There's an open issue for quite some time 🙂

I'll update the test, not going to do DISABLE_CHANCE_RANDOM, we can just seed the random number generator, there is no harm doing this always.

@oliviertassinari oliviertassinari added the regression A bug, but worse label Sep 18, 2024
@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 18, 2024

True, chance.js a big dependency but look at that https://bundlephobia.com/package/@faker-js/faker@9.0.1. God 3MB https://esm.sh/v135/@faker-js/faker@9.0.1/es2022/faker.mjs at that point it's a joke 😂.

Looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: table This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation regression A bug, but worse test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants