-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[fix] Fix hydration duplicate svelte:head tag issue with @html expressions and nested components
#7745
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
Merged
Merged
[fix] Fix hydration duplicate svelte:head tag issue with @html expressions and nested components
#7745
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
2 changes: 2 additions & 0 deletions
2
test/hydration/samples/head-html-and-component/HeadNested.svelte
This file contains hidden or 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,2 @@ | ||
| {@html '<meta name="head_nested_html" content="head_nested_html">'} | ||
| <meta name="head_nested" content="head_nested"> |
This file contains hidden or 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:head> | ||
| {@html '<meta name="nested_html" content="nested_html">'} | ||
| <meta name="nested" content="nested"> | ||
| </svelte:head> |
Empty file.
12 changes: 12 additions & 0 deletions
12
test/hydration/samples/head-html-and-component/_after_head.html
This file contains hidden or 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,12 @@ | ||
| <!-- HEAD_svelte-17ibcve_START --> | ||
| <!-- HTML_TAG_START --><meta name="main_html" content="main_html"><!-- HTML_TAG_END --> | ||
| <meta name="main" content="main"> | ||
| <!-- HTML_TAG_START --><meta name="head_nested_html" content="head_nested_html"><!-- HTML_TAG_END --> | ||
| <meta name="head_nested" content="head_nested"> | ||
| <!-- HEAD_svelte-17ibcve_END --> | ||
|
|
||
| <!-- HEAD_svelte-1gqzvnn_START --> | ||
| <!-- HTML_TAG_START --><meta name="nested_html" content="nested_html"><!-- HTML_TAG_END --> | ||
| <meta name="nested" content="nested"> | ||
| <!-- HEAD_svelte-1gqzvnn_END --> | ||
|
|
Empty file.
11 changes: 11 additions & 0 deletions
11
test/hydration/samples/head-html-and-component/_before_head.html
This file contains hidden or 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,11 @@ | ||
| <!-- HEAD_svelte-17ibcve_START --> | ||
| <!-- HTML_TAG_START --><meta name="main_html" content="main_html"><!-- HTML_TAG_END --> | ||
| <meta name="main" content="main"> | ||
| <!-- HTML_TAG_START --><meta name="head_nested_html" content="head_nested_html"><!-- HTML_TAG_END --> | ||
| <meta name="head_nested" content="head_nested"> | ||
| <!-- HEAD_svelte-17ibcve_END --> | ||
|
|
||
| <!-- HEAD_svelte-1gqzvnn_START --> | ||
| <!-- HTML_TAG_START --><meta name="nested_html" content="nested_html"><!-- HTML_TAG_END --> | ||
| <meta name="nested" content="nested"> | ||
| <!-- HEAD_svelte-1gqzvnn_END --> |
12 changes: 12 additions & 0 deletions
12
test/hydration/samples/head-html-and-component/main.svelte
This file contains hidden or 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,12 @@ | ||
| <script> | ||
| import HeadNested from './HeadNested.svelte'; | ||
| import Nested from './Nested.svelte'; | ||
| </script> | ||
|
|
||
| <svelte:head> | ||
| {@html '<meta name="main_html" content="main_html">'} | ||
| <meta name="main" content="main"> | ||
| <HeadNested /> | ||
| </svelte:head> | ||
|
|
||
| <Nested/> |
8 changes: 5 additions & 3 deletions
8
test/hydration/samples/head-meta-hydrate-duplicate/_after_head.html
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| <title>Some Title</title> | ||
| <link href="/" rel="canonical"> | ||
| <meta content="some description" name="description"> | ||
| <meta content="some keywords" name="keywords"> | ||
| <!-- HEAD_svelte-1s8aodm_START --> | ||
| <link rel="canonical" href="/"> | ||
| <meta name="description" content="some description"> | ||
| <meta name="keywords" content="some keywords"> | ||
| <!-- HEAD_svelte-1s8aodm_END --> |
8 changes: 5 additions & 3 deletions
8
test/hydration/samples/head-meta-hydrate-duplicate/_before_head.html
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| <title>Some Title</title> | ||
| <link rel="canonical" href="/" data-svelte="svelte-1s8aodm"> | ||
| <meta name="description" content="some description" data-svelte="svelte-1s8aodm"> | ||
| <meta name="keywords" content="some keywords" data-svelte="svelte-1s8aodm"> | ||
| <!-- HEAD_svelte-1s8aodm_START --> | ||
| <link rel="canonical" href="/"> | ||
| <meta name="description" content="some description"> | ||
| <meta name="keywords" content="some keywords"> | ||
| <!-- HEAD_svelte-1s8aodm_END --> |
2 changes: 2 additions & 0 deletions
2
test/server-side-rendering/samples/head-html-and-component/HeadNested.svelte
This file contains hidden or 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,2 @@ | ||
| {@html '<meta name="head_nested_html" content="head_nested_html">'} | ||
| <meta name="head_nested" content="head_nested"> | ||
5 changes: 5 additions & 0 deletions
5
test/server-side-rendering/samples/head-html-and-component/Nested.svelte
This file contains hidden or 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:head> | ||
| {@html '<meta name="nested_html" content="nested_html">'} | ||
| <meta name="nested" content="nested"> | ||
| </svelte:head> |
11 changes: 11 additions & 0 deletions
11
test/server-side-rendering/samples/head-html-and-component/_expected-head.html
This file contains hidden or 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,11 @@ | ||
| <!-- HEAD_svelte-17ibcve_START --> | ||
| <!-- HTML_TAG_START --><meta name="main_html" content="main_html"><!-- HTML_TAG_END --> | ||
| <meta name="main" content="main"> | ||
| <!-- HTML_TAG_START --><meta name="head_nested_html" content="head_nested_html"><!-- HTML_TAG_END --> | ||
| <meta name="head_nested" content="head_nested"> | ||
| <!-- HEAD_svelte-17ibcve_END --> | ||
|
|
||
| <!-- HEAD_svelte-1gqzvnn_START --> | ||
| <!-- HTML_TAG_START --><meta name="nested_html" content="nested_html"><!-- HTML_TAG_END --> | ||
| <meta name="nested" content="nested"> | ||
| <!-- HEAD_svelte-1gqzvnn_END --> |
Empty file.
12 changes: 12 additions & 0 deletions
12
test/server-side-rendering/samples/head-html-and-component/main.svelte
This file contains hidden or 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,12 @@ | ||
| <script> | ||
| import HeadNested from './HeadNested.svelte'; | ||
| import Nested from './Nested.svelte'; | ||
| </script> | ||
|
|
||
| <svelte:head> | ||
| {@html '<meta name="main_html" content="main_html">'} | ||
| <meta name="main" content="main"> | ||
| <HeadNested /> | ||
| </svelte:head> | ||
|
|
||
| <Nested/> |
8 changes: 5 additions & 3 deletions
8
test/server-side-rendering/samples/head-meta-hydrate-duplicate/_expected-head.html
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| <title>Some Title</title> | ||
| <link rel="canonical" href="/" data-svelte="svelte-1s8aodm"> | ||
| <meta name="description" content="some description" data-svelte="svelte-1s8aodm"> | ||
| <meta name="keywords" content="some keywords" data-svelte="svelte-1s8aodm"> | ||
| <!-- HEAD_svelte-1s8aodm_START --> | ||
| <link rel="canonical" href="/"> | ||
| <meta name="description" content="some description"> | ||
| <meta name="keywords" content="some keywords"> | ||
| <!-- HEAD_svelte-1s8aodm_END --> |
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.
Uh oh!
There was an error while loading. Please reload this page.