This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 432
Do not reference any internal types in runtime/index.d.ts #1604
Merged
benmccann
merged 12 commits into
sveltejs:master
from
ehrencrona:do_not_reference_internal_types
Oct 23, 2020
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ea5212d
Do not reference any internal types in runtime/index.d.ts
ehrencrona 725c889
moved PreloadResult
ehrencrona 1215e62
Removed unused types
ehrencrona 9762504
end files in newline
ehrencrona f65f327
unused import
ehrencrona 128aa37
spaces to tabs
ehrencrona 9503f6e
Cleaned up the request type
ehrencrona c761c9e
added types of server routes to docs
ehrencrona d6b82e2
Rename Req and Res
ehrencrona b848114
added params and query back
ehrencrona ea59f99
Merge remote-tracking branch 'origin/master' into do_not_reference_in…
ehrencrona 46768b1
Review feedback
ehrencrona 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 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
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 @@ | ||
/* | ||
* This file exists to avoid errors on references to @sapper/common from inside Sapper. | ||
* (@sapper/common is a namespace defined in index.d.ts) | ||
*/ | ||
|
||
export default null; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
export const CONTEXT_KEY: unknown; | ||
|
||
export type Params = Record<string, string>; | ||
export type Query = Record<string, string | string[]>; | ||
export type PreloadResult = object | Promise<object>; | ||
export interface Preload { | ||
(this: PreloadContext, page: PreloadPage, session: any): PreloadResult; | ||
} |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably rather save the nice name
Page
for external usage and rename the internalPage
type to something likePageInfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be fine with that, but I generally feel this isn't a "page". The page parameters really parametrize a route, so I guess a page is more or less the same as a route, This object is attached to a request, whereas a page feels like something more permanent, at least to me.
How about
PageRequest
("a request for a page")? The request carries the parameters for the page, thePageParams
. That kind of makes sense.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really a
PageRequest
because of theerror
. I guessPageContext
makes sense