-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: bail-out of hydrating head if no anchor is found (#12541)
* fix: bail-out of hydrating head if no anchor is found * add failing test * fix * fix comment --------- Co-authored-by: Rich Harris <[email protected]>
- Loading branch information
1 parent
5253c8f
commit 346cf96
Showing
7 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: bail-out of hydrating head if no anchor is found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/svelte/tests/hydration/samples/head-missing/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { test } from '../../test'; | ||
|
||
export default test({ | ||
test(assert, target, snapshot, component, window) { | ||
assert.equal(window.document.querySelectorAll('meta').length, 2); | ||
} | ||
}); |
1 change: 1 addition & 0 deletions
1
packages/svelte/tests/hydration/samples/head-missing/_expected_head.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<meta name="description" content="some description"> <meta name="keywords" content="some keywords"> |
Empty file.
6 changes: 6 additions & 0 deletions
6
packages/svelte/tests/hydration/samples/head-missing/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<svelte:head> | ||
<meta name="description" content="some description" /> | ||
<meta name="keywords" content="some keywords" /> | ||
</svelte:head> | ||
|
||
<div>Just a dummy page.</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters