fix: html tag hydration: regard empty claimed_nodes array as content mismatch. fixes #6832 #9184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint
Fixes #6832, where nodes were missing on hydration.
Within the
claim_html_tag
function, the returnedclaimed_nodes
is sometimes an empty array (due to issues with theclaim_space
function as investigated by rmunn in discussion in #6832). However, hbirler, in the same thread, mentioned that this error in claims should not cause problems in the correctness of the output. Turns out the intended hydration was not working because an emptyclaimed_nodes
array was being regarded as properly claimed nodes rather than a case of mismatch.I did not add a test as I was unable to recreate the bug outside of SvelteKit (attempts in
test/runtime
andtest/runtime-browser
led to passing tests with output different than when I run the Svelte component in SvelteKit). Will be happy to add one if some guidance is provided as to how to recreate this within the test structure