-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: add reroute hook
#11537
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
feat: add reroute hook
#11537
Changes from 31 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
e6120b1
Add `rewriteUrl` hook
LorisSigrist 0aee821
Fix client manifest
LorisSigrist daeb203
Add docs
LorisSigrist 395aa01
Add changeset
LorisSigrist faf7bfe
Add tests
LorisSigrist d1324ff
Add more tests
LorisSigrist 794753c
Add recursive note to docs
LorisSigrist 83727dd
Remove empty test files
LorisSigrist 934ad8f
404 on external rewrites
LorisSigrist d945538
fmt & lint
LorisSigrist f7c1ce2
Make sure the rewrites don't get applied to external URLs
LorisSigrist 1fafa8a
Fix lockfile
LorisSigrist ef605ac
Remove unused test command
LorisSigrist 72d0b00
Error Handling
LorisSigrist cf3326b
Use obfuscated error message
LorisSigrist d3140f7
Change to `hooks.js`
LorisSigrist 707e07c
fmt
LorisSigrist 1713097
Generate Types
LorisSigrist de8eca2
Move rewrite tests into `basic` test suite
LorisSigrist d2f3e29
snake_case internal variables
LorisSigrist e3da812
fmt
LorisSigrist 8238dc0
Improve test organisation
LorisSigrist 2594d8e
fmt
LorisSigrist e6bcf35
Update documentation/docs/30-advanced/20-hooks.md
LorisSigrist 78e1fc6
Update documentation/docs/30-advanced/20-hooks.md
LorisSigrist bf2f490
Remove unnecessary lockfile changes
LorisSigrist a972b35
Update documentation/docs/30-advanced/20-hooks.md
LorisSigrist 4adb7c5
Merge branch 'master' into feat-rewrite-url
LorisSigrist 70b9787
Complete Mereg
LorisSigrist 5f393f9
Remove unused type annotatios
LorisSigrist dd0cff7
isomorphic -> universal
Rich-Harris cf73099
Update packages/kit/src/runtime/server/ambient.d.ts
Rich-Harris 7c29a50
remove junk
Rich-Harris a54f9ac
Merge branch 'feat-rewrite-url' of github.com:LorisSigrist/kit into p…
Rich-Harris ab2485d
Update documentation/docs/30-advanced/20-hooks.md
LorisSigrist b620c48
Update documentation/docs/30-advanced/20-hooks.md
LorisSigrist 897ea4a
rename `rewriteUrl` to `reroute`
LorisSigrist c8eb680
Return pathname instead of url from `reroute`
LorisSigrist 66848f6
Make return value optional
LorisSigrist 209d12d
Update docs
LorisSigrist 4f15f09
Merge commit 'b620c48109f18e10b67ff09bbce5d92a925c1f45' into feat-rew…
LorisSigrist ad201ef
fmt & lint
LorisSigrist f009ad8
Apply suggestions from code review
Rich-Harris c2def01
Update .changeset/thin-ears-double.md
Rich-Harris 6acd801
clarify reloading behaviour, print error and break in dev
Rich-Harris f76da81
Merge branch 'main' into pr/11537
Rich-Harris 976e0ae
@since
Rich-Harris 6a59dfb
update types
Rich-Harris 689811e
Update packages/kit/test/apps/basics/src/routes/reroute/error-handlin…
Rich-Harris 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@sveltejs/kit": minor | ||
| --- | ||
|
|
||
| feat: add `rewriteUrl` hook | ||
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
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
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,8 +1,4 @@ | ||
| declare module '__SERVER__/internal.js' { | ||
| export const options: import('types').SSROptions; | ||
| export const get_hooks: () => Promise<{ | ||
| handle?: import('@sveltejs/kit').Handle; | ||
| handleError?: import('@sveltejs/kit').HandleServerError; | ||
| handleFetch?: import('@sveltejs/kit').HandleFetch; | ||
| }>; | ||
| export const get_hooks: () => Promise<Partial<import('../../types/internal.js').ServerHooks>>; | ||
Rich-Harris marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.