table icon indicating copy to clipboard operation
table copied to clipboard

React sorting example is extremely slow in docs

Open giantrobotbee opened this issue 2 years ago • 2 comments

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

  • [X] I agree to follow this project's Code of Conduct
  • [X] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

giantrobotbee avatar Nov 06 '23 21:11 giantrobotbee

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 avatar Nov 24 '23 07:11 ashirbad29

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

ashirbad29 avatar Nov 24 '23 07:11 ashirbad29