react icon indicating copy to clipboard operation
react copied to clipboard

Bug: TBT of website increased after migrating to react 18

Open sachTyagi opened this issue 3 years ago • 7 comments
trafficstars

After upgrading to react18 total blocking time of website has been increased as per the reports of lighthouse. url used to check performance: https://pagespeed.web.dev/ Following packages were updated to latest: "react": "^18.2.0", "react-dom": "^18.2.0", "react-redux": "^8.0.2",

React version: 18.2.0

Steps To Reproduce

  1. Update the above mentioned packages to latest.
  2. Use react new hydrateRoot api

Link to code example:

Attaching screenshots for performance analysis:

react18: Screenshot 2022-08-04 at 5 16 58 PM Screenshot 2022-08-04 at 5 17 09 PM Screenshot 2022-08-04 at 5 19 07 PM

react17:

Screenshot 2022-08-04 at 5 19 48 PM Screenshot 2022-08-04 at 5 20 33 PM Screenshot 2022-08-04 at 5 20 41 PM

sachTyagi avatar Aug 05 '22 09:08 sachTyagi

We can’t help or guess without a complete reproducing example.

gaearon avatar Aug 05 '22 10:08 gaearon

it does,t work if i didn,t get full reproducing example

Mayank-sudo avatar Sep 07 '22 04:09 Mayank-sudo

FWIW Our site saw this too. It's an entirely client-side rendered application. Some core pieces of it are React Router, Apollo, Final Form, Redux, and deep in our component library is JSS (which I'm trying to remove). I'm posting this mainly in the hope that someone else will see this and recognize a commonality, as this issue was the top result on Google. image

alanmoo avatar Feb 24 '23 14:02 alanmoo

Do you have a live site I could debug?

gaearon avatar Feb 24 '23 14:02 gaearon

@sachTyagi Same question to you. I only just realized that there's a URL in your report. Can you deploy the two versions on two domains side by side again? Then I could dig into this.

gaearon avatar Feb 24 '23 14:02 gaearon

Hi all. So what happened? What was the root cause?

GRboss avatar Jul 17 '23 06:07 GRboss

We are also facing the same issue, and i have noticed that framework.js is taking much time. also it's random sometime it takes less and sometimes it too high PageSpeed-Insights (9)

"react": "^18.2.0", "react-dom": "^18.2.0",

also we are using it with Nextjs 14.0.0

shailesh108 avatar Dec 06 '23 11:12 shailesh108

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Apr 10 '24 02:04 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

github-actions[bot] avatar Apr 17 '24 12:04 github-actions[bot]