-
-
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: avoid running load functions when prerendering if no server load…
… function exists and SSR is off (#11405)
- Loading branch information
1 parent
65b81de
commit b999cfd
Showing
6 changed files
with
34 additions
and
4 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: render SPA shell when SSR is turned off and there is no server data |
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
10 changes: 10 additions & 0 deletions
10
packages/kit/test/prerendering/basics/src/routes/spa-shell/+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,10 @@ | ||
import { redirect } from '@sveltejs/kit'; | ||
|
||
export const prerender = true; | ||
|
||
export const ssr = false; | ||
|
||
/** @type {import('@sveltejs/kit').Load} */ | ||
export function load() { | ||
redirect(301, 'https://example.com/redirected'); | ||
} |
1 change: 1 addition & 0 deletions
1
packages/kit/test/prerendering/basics/src/routes/spa-shell/+page.server.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 @@ | ||
// spa shell should still prererender when +page.server.js exists but it has no load function |
1 change: 1 addition & 0 deletions
1
packages/kit/test/prerendering/basics/src/routes/spa-shell/+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 @@ | ||
<h1>this won't be prerendered</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