TanStack / table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table
https://tanstack.com/table
MIT License
25.12k stars 3.07k forks source link

React sorting example is extremely slow in docs #5153

Open giantrobotbee opened 11 months ago

giantrobotbee commented 11 months ago

Describe the bug

In the Docs for V8, the Sorting example for React is slow to the point of being unusable. I've tested in Firefox and Safari. Safari crashes outright, FF struggles. Other examples load snappy and quick. Launching the page externally on Codesandbox incurs the same issue.

Not sure if there is a bug in the example that may be causing unnecessary load on CS making the example clunky.

Your minimal, reproducible example

https://tanstack.com/table/v8/docs/examples/react/sorting

Steps to reproduce

Go to this example in the docs Watch as your browser screams in agony

Expected behavior

The example should load relatively quickly and not struggle to render.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Mac OS X Sonoma Firefox (latest stable)

react-table version

Latest

TypeScript version

No response

Additional context

No response

Terms & Code of Conduct

ashirbad29 commented 11 months ago

I think this is due to faker, faker.datatype.datetime({ max: new Date().getTime() }) is depcrecated and throwing warning for each data item, this seems the reason for the slowdown. I tried running the example locally with faker.date.anytime() and it's working fine.

ashirbad29 commented 11 months ago

@tannerlinsley @KevinVandy can I make a PR for the same, replacing faker.datatype.datetime with faker.date.anytime ?