svelte: hydration takes way too long

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

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 12th Gen Intel(R) Core(TM) i7-12650H
    Memory: 7.97 GB / 15.63 GB
  Binaries:
    Node: 23.7.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.1.0 - C:\Program Files\nodejs\npm.CMD
    bun: 1.1.3 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (129.0.2792.52)
    Internet Explorer: 11.0.22621.3527

Severity

blocking an upgrade

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (9 by maintainers)

Commits related to this issue

Most upvoted comments

goddammit, yes this is the culprit - my suggestion on that PR was just wrong, opened another PR with a fix.

@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 5.17.5 => Json file. I’m not sure how, But I hope it can be useful. For comparison this is the performance output from version 5.17.4 thats works fine. 5.17.4 => Json file