Skip to content

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

@Janpot Janpot marked this pull request as ready for review September 13, 2024 13:44
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 scope: table Changes related to the table. 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.

@Janpot Janpot requested a review from DiegoAndai September 18, 2024 09:28
@oliviertassinari oliviertassinari added the type: regression A bug, but worse, it used to behave as expected. 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/[email protected]. God 3MB https://esm.sh/v135/@faker-js/[email protected]/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
docs Improvements or additions to the documentation. scope: table Changes related to the table. test type: regression A bug, but worse, it used to behave as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants