-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make $app/navigation more resilient to bundler reordering (#9808)
* fix: make $app/navigation more resilient to bundler reordering * rename invalidate_all * changeset --------- Co-authored-by: Rich Harris <git@rich-harris.dev>
- Loading branch information
Showing
6 changed files
with
57 additions
and
37 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: make $app/navigation more resilient to bundler reordering |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
import { BROWSER } from 'esm-env'; | ||
import { client } from '../client/singletons.js'; | ||
|
||
/** | ||
* @param {string} name | ||
*/ | ||
function guard(name) { | ||
return () => { | ||
throw new Error(`Cannot call ${name}(...) on the server`); | ||
}; | ||
} | ||
|
||
export const disableScrollHandling = BROWSER | ||
? client.disable_scroll_handling | ||
: guard('disableScrollHandling'); | ||
export const goto = BROWSER ? client.goto : guard('goto'); | ||
export const invalidate = BROWSER ? client.invalidate : guard('invalidate'); | ||
export const invalidateAll = BROWSER ? client.invalidateAll : guard('invalidateAll'); | ||
export const preloadData = BROWSER ? client.preload_data : guard('preloadData'); | ||
export const preloadCode = BROWSER ? client.preload_code : guard('preloadCode'); | ||
export const beforeNavigate = BROWSER ? client.before_navigate : () => {}; | ||
export const afterNavigate = BROWSER ? client.after_navigate : () => {}; | ||
import { client_method } from '../client/singletons.js'; | ||
|
||
export const disableScrollHandling = /* @__PURE__ */ client_method('disable_scroll_handling'); | ||
|
||
export const goto = /* @__PURE__ */ client_method('goto'); | ||
|
||
export const invalidate = /* @__PURE__ */ client_method('invalidate'); | ||
|
||
export const invalidateAll = /* @__PURE__ */ client_method('invalidate_all'); | ||
|
||
export const preloadData = /* @__PURE__ */ client_method('preload_data'); | ||
|
||
export const preloadCode = /* @__PURE__ */ client_method('preload_code'); | ||
|
||
export const beforeNavigate = /* @__PURE__ */ client_method('before_navigate'); | ||
|
||
export const afterNavigate = /* @__PURE__ */ client_method('after_navigate'); |
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