-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: tighten up preloadCode (#12217)
support absolute URLs with `data-sveltekit-preload-code="viewport"` and reroutes for preloadCode in general --------- Co-authored-by: Ben McCann <[email protected]> Co-authored-by: Chew Tee Ming <[email protected]> Co-authored-by: Simon H <[email protected]>
- Loading branch information
1 parent
0142dd8
commit 777c8ef
Showing
16 changed files
with
163 additions
and
19 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 @@ | ||
--- | ||
"@sveltejs/kit": patch | ||
--- | ||
|
||
fix: support absolute URLs and reroutes with `data-sveltekit-preload-code="viewport"` |
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
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
11 changes: 11 additions & 0 deletions
11
packages/kit/test/apps/basics/src/routes/data-sveltekit/preload-code/+page.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,11 @@ | ||
<div style="height: 200vh"></div> | ||
|
||
<a | ||
id="viewport" | ||
href="/data-sveltekit/preload-code/target/viewport" | ||
data-sveltekit-preload-code="viewport">viewport</a | ||
> | ||
<a id="hover" href="/data-sveltekit/preload-code/target/hover" data-sveltekit-preload-code="hover" | ||
>hover</a | ||
> | ||
<a id="tap" href="/data-sveltekit/preload-code/target/tap" data-sveltekit-preload-code="tap">tap</a> |
5 changes: 5 additions & 0 deletions
5
packages/kit/test/apps/basics/src/routes/data-sveltekit/preload-code/target/eager/+page.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,5 @@ | ||
export function load() { | ||
return { | ||
name: 'eager' | ||
}; | ||
} |
5 changes: 5 additions & 0 deletions
5
...ges/kit/test/apps/basics/src/routes/data-sveltekit/preload-code/target/eager/+page.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,5 @@ | ||
<script> | ||
export let data; | ||
</script> | ||
|
||
<h1>{data.name}</h1> |
5 changes: 5 additions & 0 deletions
5
packages/kit/test/apps/basics/src/routes/data-sveltekit/preload-code/target/hover/+page.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,5 @@ | ||
export function load() { | ||
return { | ||
name: 'hover' | ||
}; | ||
} |
5 changes: 5 additions & 0 deletions
5
...ges/kit/test/apps/basics/src/routes/data-sveltekit/preload-code/target/hover/+page.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,5 @@ | ||
<script> | ||
export let data; | ||
</script> | ||
|
||
<h1>{data.name}</h1> |
5 changes: 5 additions & 0 deletions
5
packages/kit/test/apps/basics/src/routes/data-sveltekit/preload-code/target/tap/+page.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,5 @@ | ||
export function load() { | ||
return { | ||
name: 'tap' | ||
}; | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/kit/test/apps/basics/src/routes/data-sveltekit/preload-code/target/tap/+page.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,5 @@ | ||
<script> | ||
export let data; | ||
</script> | ||
|
||
<h1>{data.name}</h1> |
5 changes: 5 additions & 0 deletions
5
...ages/kit/test/apps/basics/src/routes/data-sveltekit/preload-code/target/viewport/+page.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,5 @@ | ||
export function load() { | ||
return { | ||
name: 'hover' | ||
}; | ||
} |
5 changes: 5 additions & 0 deletions
5
.../kit/test/apps/basics/src/routes/data-sveltekit/preload-code/target/viewport/+page.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,5 @@ | ||
<script> | ||
export let data; | ||
</script> | ||
|
||
<h1>{data.name}</h1> |
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
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
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
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