-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
hydration takes way too long #15262
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
Comments
I tried setting hmr to false in compilerOptions and the issue still persists, Apparently its on each re-render and not hmr's fault. |
chrome's devtools says its a microtask called _hydrate that is taking incredibly long so its the hydration process. unfortunately until this hydration microtask finishes, everything is frozen. Now the question is, what did version 5.17.5 do to make this _hydrate function take so much longer to run? |
Maybe @trueadm knows something since he worked on 5.17.5 version? |
Are you saying the performance issue came in 5.17.5? Are you sure it's this exact version, as pinpointing it would be helpful here. |
The performance issue came in 5.17.5 and is present afterwards. I'm sure 5.17.4 is fine because if I install it the issue goes away and hydration becomes instant. As of 5.19.10 the issue is still present. |
Looking at the release, there's nothing related to hydration https://github.com/sveltejs/svelte/releases/tag/svelte%405.17.5. So I'm stumped as to what could be causing it without being able to see a full profile. Can you export the Chrome performance profile please? |
Guessing it's #14989 because a loop was introduced there, so it seems something is causing that to run many times? But yeah, a reproduction is crucial or else we're just guessing and can't fix. |
The above shows |
I found two cases that we can skip doing the work for in that PR, but without a reproduction it's hard to know what more we can do #15275. |
@trueadm I'm not using any web components. The output from chrome's devtools is a big json and I can't upload it here. This time I only rendered 5 instances of the component that is causing the issue. So here is a link to it |
Yep the culprit is |
Also make sure events dispatched via transition/animation logic runs outside event context Related to #15262
@HighFunctioningSociopathSH Can you try the latest release please? |
@trueadm I'm sorry for the delayed respond but thankfully the issue is fixed in the latest release. Great work. |
@trueadm Hello again, It seems like a similar issue has risen again after updating to [email protected] version. Everything works fine on [email protected] but after upgrading to [email protected] and as of version [email protected] hydration takes a few seconds. [email protected] => https://drive.google.com/file/d/1ex4B0FCxaa1t8u8-Eq23KsdVCcjn_6TI/view?usp=sharing |
At this point we really need a minimum reproducible |
Describe the bug
I noticed my codebase's hmr not working as fast as before so after checking previous versions to see whether I'm hallucinating or not, I figured out that for some reason from version 5.17.5 forward the hmr takes 3 or more seconds, depending on how many instances of a component where rendered, to kick in. The delay duration goes up for each components instance that is rendered. Unfortunately I was unable to find the exact reason why this is happening; Taking away props passed to components reduces the delay of hmr But I don't think its any single prop that is responsible.
Reproduction
Since I can't reproduce it properly and the issue seems to become noticeable when there are a number of components being rendered, I was wondering If any knowledgeable individual can explain what the 5.17.5 patch actually does and what could be causing this issue. The exact same codebase works fine if I move back to 5.17.4 patch and hmr becomes instant. I was also wondering If anyone else is experiencing the same issue.
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: