-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the problem
The new hydration markers in Svelte 5 increases output size and causes messy HTML output. This leads to increased bandwidth and processing costs for the payloads.
Repro:
https://github.com/khromov/hydration-markers-sveltekit-repro
Run npm run build && npm preview
Increase in document size
We compare the HTML output of a short text formatted using the Stylizr library:
With gzip disabled, the document is 2.8KB
With gzip enabled, the document is 1.9KB.
We can compare it with a baseline where we removed the formatting, in this case gzip disabled is 2.3KB and gzip enabled is 1.8KB. It seems like gzip does remove the brunt of the additional size, but the size of the uncompressed payload is markedly increased by the hydration markers.
Messy HTML
Every time a formatting is applied a new component (technically Snippet) is added to the output. The result lead to very messy HTML output with hydration markers:
Describe the proposed solution
The components/snippets in the repro don't have any reactive props, it is just static text. If this case could be detected, perhaps hydration markers could be removed?
Importance
would make my life easier
